diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-16 13:13:04 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-16 13:13:04 +0000 |
| commit | 5b51f6157941bc4fcd819b4b49b56ac837ea8b77 (patch) | |
| tree | 4ff8089eac9ecd56cbcae793fda167b347b37f5e /nova/tests | |
| parent | 56f5172f33bbd1da1b8749b7754805de44c3ab9c (diff) | |
| parent | fc786dd469a15bda1b9d3c7bacf9f1771b9b9956 (diff) | |
Merge "Detach volume fails when using multipath iscsi"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_libvirt_volume.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nova/tests/test_libvirt_volume.py b/nova/tests/test_libvirt_volume.py index 1186ed268..6d2dc9dce 100644 --- a/nova/tests/test_libvirt_volume.py +++ b/nova/tests/test_libvirt_volume.py @@ -389,6 +389,36 @@ class LibvirtVolumeTestCase(test.TestCase): self.assertEqual(tree.find('./source').get('dev'), mpdev_filepath) libvirt_driver.disconnect_volume(connection_info, 'vde') + def test_libvirt_kvm_volume_with_multipath_getmpdev(self): + self.flags(libvirt_iscsi_use_multipath=True) + self.stubs.Set(os.path, 'exists', lambda x: True) + libvirt_driver = volume.LibvirtISCSIVolumeDriver(self.fake_conn) + name0 = 'volume-00000000' + location0 = '10.0.2.15:3260' + iqn0 = 'iqn.2010-10.org.openstack:%s' % name0 + vol0 = {'id': 0, 'name': name0} + dev0 = '/dev/disk/by-path/ip-%s-iscsi-%s-lun-0' % (location0, iqn0) + name = 'volume-00000001' + location = '10.0.2.15:3260' + iqn = 'iqn.2010-10.org.openstack:%s' % name + vol = {'id': 1, 'name': name} + dev = '/dev/disk/by-path/ip-%s-iscsi-%s-lun-1' % (location, iqn) + devs = [dev0, dev] + self.stubs.Set(self.fake_conn, 'get_all_block_devices', lambda: devs) + connection_info = self.iscsi_connection(vol, location, iqn) + mpdev_filepath = '/dev/mapper/foo' + disk_info = { + "bus": "virtio", + "dev": "vde", + "type": "disk", + } + target_portals = ['fake_portal1', 'fake_portal2'] + libvirt_driver._get_multipath_device_name = lambda x: mpdev_filepath + conf = libvirt_driver.connect_volume(connection_info, disk_info) + tree = conf.format_dom() + self.assertEqual(tree.find('./source').get('dev'), mpdev_filepath) + libvirt_driver.disconnect_volume(connection_info, 'vde') + def test_libvirt_nfs_driver(self): # NOTE(vish) exists is to make driver assume connecting worked mnt_base = '/mnt' |
