test_libvirt:LibvirtUtilsTestCase.test_get_fs_info fails on Mac OS X

Bug #893840 reported by Lorin Hochstein on 2011-11-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Lorin Hochstein

Bug Description

test_libvirt:LibvirtUtilsTestCase.test_get_fs_info fails on Mac OS X because its "df" program doesn't support the -B flag.

$ ./run_tests.sh test_libvirt:LibvirtUtilsTestCase.test_get_fs_info --nologcapture
    test_get_fs_info ERROR

ERROR: test_get_fs_info (nova.tests.test_libvirt.LibvirtUtilsTestCase)
Traceback (most recent call last):
  File "/Users/lorin/nova/nova/tests/test_libvirt.py", line 1847, in test_get_fs_info
    stdout, stderr = utils.execute('df', '-B1', '/tmp')
  File "/Users/lorin/nova/nova/utils.py", line 193, in execute
    cmd=' '.join(cmd))
ProcessExecutionError: Unexpected error while running command.
Command: df -B1 /tmp
Exit code: 64
Stdout: ''
Stderr: 'df: illegal option -- B\nusage: df [-b | -H | -h | -k | -m | -g | -P] [-ailn] [-T type] [-t] [filesystem ...]\n'

Lorin Hochstein (lorinh) wrote :

Note that you can't set a blocksize of 1 with df on OS X at all:

$ BLOCKSIZE=1 df /tmp
df: minimum blocksize is 512
df: minimum blocksize is 512
Filesystem 512-blocks Used Available Capacity Mounted on
/dev/disk1 974803248 289149696 685141552 30% /

Reviewed: https://review.openstack.org/1861
Committed: http://github.com/openstack/nova/commit/bbbd489590e20d5a476fd3f68359f32d549752ca
Submitter: Jenkins
Branch: master

 status fixcommitted

commit bbbd489590e20d5a476fd3f68359f32d549752ca
Author: Lorin Hochstein <email address hidden>
Date: Tue Nov 22 20:45:58 2011 -0500

    Call df with -k instead of -B1

    Fix bug 893840

    Change-Id: Ibdb5fe364f3ce086ee198d90f3593f3852fe2c97

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx) on 2011-12-14
Changed in nova:
milestone: none → essex-2
status: Fix Committed → Fix Released
Mark McLoughlin (markmc) on 2012-04-03
Changed in nova:
assignee: nobody → Lorin Hochstein (lorinh)
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers