Merge "attach/detach_volume() take instance as a parameter"

This commit is contained in:
Jenkins
2013-01-09 04:09:45 +00:00
committed by Gerrit Code Review
4 changed files with 10 additions and 10 deletions

View File

@@ -508,7 +508,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase):
self._volume_target_portal, self._volume_id)
self._conn.attach_volume(connection_info,
self._instance_data["name"], '/dev/sdc')
self._instance_data, '/dev/sdc')
def test_attach_volume(self):
self._attach_volume()
@@ -527,7 +527,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase):
self._volume_target_portal, self._volume_id)
self._conn.detach_volume(connection_info,
self._instance_data["name"], '/dev/sdc')
self._instance_data, '/dev/sdc')
(_, volumes_paths, _) = self._hypervutils.get_vm_disks(
self._instance_data["name"])

View File

@@ -1706,8 +1706,8 @@ class LibvirtConnTestCase(test.TestCase):
self.assertRaises(exception.VolumeDriverNotFound,
conn.attach_volume,
{"driver_volume_type": "badtype"},
"fake",
"/dev/fake")
{"name": "fake-instance"},
"/dev/fake")
def test_multi_nic(self):
instance_data = dict(self.test_instance)

View File

@@ -379,10 +379,10 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
def test_attach_detach_volume(self):
instance_ref, network_info = self._get_running_instance()
self.connection.attach_volume({'driver_volume_type': 'fake'},
instance_ref['name'],
instance_ref,
'/mnt/nova/something')
self.connection.detach_volume({'driver_volume_type': 'fake'},
instance_ref['name'],
instance_ref,
'/mnt/nova/something')
@catch_notimplementederror
@@ -390,11 +390,11 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
instance_ref, network_info = self._get_running_instance()
self.connection.power_off(instance_ref)
self.connection.attach_volume({'driver_volume_type': 'fake'},
instance_ref['name'],
instance_ref,
'/mnt/nova/something')
self.connection.power_on(instance_ref)
self.connection.detach_volume({'driver_volume_type': 'fake'},
instance_ref['name'],
instance_ref,
'/mnt/nova/something')
@catch_notimplementederror

View File

@@ -271,7 +271,7 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase):
instance = db.instance_create(self.context, self.instance_values)
vm = xenapi_fake.create_vm(instance['name'], 'Running')
result = conn.attach_volume(self._make_connection_info(),
instance['name'], '/dev/sdc')
instance, '/dev/sdc')
# check that the VM has a VBD attached to it
# Get XenAPI record for VBD
@@ -290,7 +290,7 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase):
self.assertRaises(exception.VolumeDriverNotFound,
conn.attach_volume,
{'driver_volume_type': 'nonexist'},
instance['name'],
instance,
'/dev/sdc')