diff options
| author | Lorin Hochstein <lorin@isi.edu> | 2011-11-22 20:45:58 -0500 |
|---|---|---|
| committer | Lorin Hochstein <lorin@isi.edu> | 2011-11-22 20:49:03 -0500 |
| commit | bbbd489590e20d5a476fd3f68359f32d549752ca (patch) | |
| tree | 05d539f33e50fbbaf640a8bcb60b20bbf6056a5c | |
| parent | b30096473c9927c22ca3d89b70aad17cd0def361 (diff) | |
| download | nova-bbbd489590e20d5a476fd3f68359f32d549752ca.tar.gz nova-bbbd489590e20d5a476fd3f68359f32d549752ca.tar.xz nova-bbbd489590e20d5a476fd3f68359f32d549752ca.zip | |
Call df with -k instead of -B1
Fix bug 893840
Change-Id: Ibdb5fe364f3ce086ee198d90f3593f3852fe2c97
| -rw-r--r-- | nova/tests/test_libvirt.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index f27905ed4..500a4d133 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -1844,14 +1844,17 @@ disk size: 4.4M''', '')) libvirt_utils.run_ajaxterm(shell_cmd, token, port) def test_get_fs_info(self): - stdout, stderr = utils.execute('df', '-B1', '/tmp') + # Use a 1024-byte block size (df -k) because OS X does not support + # the -B flag + blocksize = 1024 + stdout, stderr = utils.execute('df', '-k', '/tmp') info_line = ' '.join(stdout.split('\n')[1:]) _dev, total, used, free, _percentage, _mntpnt = info_line.split() fs_info = libvirt_utils.get_fs_info('/tmp') - self.assertEquals(int(total), fs_info['total']) - self.assertEquals(int(free), fs_info['free']) - self.assertEquals(int(used), fs_info['used']) + self.assertEquals(int(total) * blocksize, fs_info['total']) + self.assertEquals(int(free) * blocksize, fs_info['free']) + self.assertEquals(int(used) * blocksize, fs_info['used']) def test_fetch_image(self): self.mox.StubOutWithMock(images, 'fetch') |
