summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-09 04:09:45 +0000
committerGerrit Code Review <review@openstack.org>2013-01-09 04:09:45 +0000
commitb9959b180e8035a0654313be3d6cded2da1d4894 (patch)
treeba1ac3bb47d570ef4b631dc344e31ce5be1c5c81 /nova/tests
parentddb2400047d0afd8bc8e408ac3e9034b4c625952 (diff)
parente6cae13dd21f03948a28088d45be678f6a0e5c4e (diff)
downloadnova-b9959b180e8035a0654313be3d6cded2da1d4894.tar.gz
nova-b9959b180e8035a0654313be3d6cded2da1d4894.tar.xz
nova-b9959b180e8035a0654313be3d6cded2da1d4894.zip
Merge "attach/detach_volume() take instance as a parameter"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_hypervapi.py4
-rw-r--r--nova/tests/test_libvirt.py4
-rw-r--r--nova/tests/test_virt_drivers.py8
-rw-r--r--nova/tests/test_xenapi.py4
4 files changed, 10 insertions, 10 deletions
diff --git a/nova/tests/test_hypervapi.py b/nova/tests/test_hypervapi.py
index cab877da9..f5713c457 100644
--- a/nova/tests/test_hypervapi.py
+++ b/nova/tests/test_hypervapi.py
@@ -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"])
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index f23f96c2d..bd6816d71 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -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)
diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py
index 9d9ebcad9..9e9309dfe 100644
--- a/nova/tests/test_virt_drivers.py
+++ b/nova/tests/test_virt_drivers.py
@@ -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
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
index 8ac3b640f..2e2011a74 100644
--- a/nova/tests/test_xenapi.py
+++ b/nova/tests/test_xenapi.py
@@ -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')