summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-02-14 21:44:45 +0000
committerGerrit Code Review <review@openstack.org>2012-02-14 21:44:45 +0000
commit028c62f378d06ffbae8f698611e1d1ce80f1ede2 (patch)
treedaae10bb19cbdc7e7ec61da22f4398b1e1da65ae /nova/tests
parenta8795a40fd8f4ba42fde1cc4c3c3f0494850f12f (diff)
parente40b659d320b3c6894862b87adf1011e31cbf8fc (diff)
Merge "Add support for LXC volumes."
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_libvirt.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index dbcccb11e..66a8db2b5 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -195,6 +195,27 @@ class LibvirtVolumeTestCase(test.TestCase):
libvirt_driver.disconnect_volume(connection_info, mount_device)
connection_info = vol_driver.terminate_connection(vol, self.connr)
+ def test_libvirt_lxc_volume(self):
+ self.stubs.Set(os.path, 'exists', lambda x: True)
+ vol_driver = volume_driver.ISCSIDriver()
+ libvirt_driver = volume.LibvirtISCSIVolumeDriver(self.fake_conn)
+ location = '10.0.2.15:3260'
+ name = 'volume-00000001'
+ iqn = 'iqn.2010-10.org.openstack:%s' % name
+ vol = {'id': 1,
+ 'name': name,
+ 'provider_auth': None,
+ 'provider_location': '%s,fake %s' % (location, iqn)}
+ connection_info = vol_driver.initialize_connection(vol, self.connr)
+ mount_device = "vde"
+ xml = libvirt_driver.connect_volume(connection_info, mount_device)
+ tree = xml_to_tree(xml)
+ dev_str = '/dev/disk/by-path/ip-%s-iscsi-%s-lun-0' % (location, iqn)
+ self.assertEqual(tree.get('type'), 'block')
+ self.assertEqual(tree.find('./source').get('dev'), dev_str)
+ libvirt_driver.disconnect_volume(connection_info, mount_device)
+ connection_info = vol_driver.terminate_connection(vol, self.connr)
+
class CacheConcurrencyTestCase(test.TestCase):
def setUp(self):