diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-07-26 17:23:16 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-07-26 17:23:16 +0000 |
| commit | 3fc62d308afeea7c1bb5d0edc3e86244b7efe2bf (patch) | |
| tree | 092ebb70c856e9f0a481b316bc65d3d60d57a1ed /nova/tests | |
| parent | cf1cd2863afbc418dcd0056a575ec47807de7df6 (diff) | |
| parent | 8f1664416abf7aaf8e049ba26ca404ab627b7d57 (diff) | |
Merge "libvirt driver: set driver name consistently"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_libvirt.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 91b3a312c..322cd080a 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -3184,6 +3184,19 @@ class LibvirtUtilsTestCase(test.TestCase): self.mox.ReplayAll() libvirt_utils.create_cow_image('/some/path', '/the/new/cow') + def test_pick_disk_driver_name(self): + type_map = {'kvm': ([True, 'qemu'], [False, 'qemu'], [None, 'qemu']), + 'qemu': ([True, 'qemu'], [False, 'qemu'], [None, 'qemu']), + 'xen': ([True, 'phy'], [False, 'tap'], [None, 'tap']), + 'uml': ([True, None], [False, None], [None, None]), + 'lxc': ([True, None], [False, None], [None, None])} + + for (libvirt_type, checks) in type_map.iteritems(): + self.flags(libvirt_type=libvirt_type) + for (is_block_dev, expected_result) in checks: + result = libvirt_utils.pick_disk_driver_name(is_block_dev) + self.assertEquals(result, expected_result) + def test_get_disk_size(self): self.mox.StubOutWithMock(utils, 'execute') utils.execute('env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', |
