diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-03-09 16:19:45 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-03-09 16:19:45 +0000 |
| commit | 0c3c67e085018316d2e6174d852bbc8cd2e4ccb1 (patch) | |
| tree | 311c0f03a0166e85c9f5c094014ecefd6cb05ede /nova/tests | |
| parent | 76a2da5ebc46e52d0939a430dbacb94bb9f837f2 (diff) | |
| parent | 86bcb49b43e052b17fc173520ce8094dcc1db965 (diff) | |
Merge "Simplify unnecessary XenAPI Async calls to be synchronous"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_xenapi.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 408c27982..e7357b028 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -210,10 +210,6 @@ def configure_instance(*args): pass -def _find_rescue_vbd_ref(*args): - pass - - class XenAPIVMTestCase(test.TestCase): """Unit tests for VM operations.""" def setUp(self): @@ -235,8 +231,6 @@ class XenAPIVMTestCase(test.TestCase): stubs.stubout_is_vdi_pv(self.stubs) self.stubs.Set(vmops.VMOps, '_configure_instance', configure_instance) - self.stubs.Set(vmops.VMOps, '_find_rescue_vbd_ref', - _find_rescue_vbd_ref) stubs.stub_out_vm_methods(self.stubs) glance_stubs.stubout_glance_client(self.stubs) fake_utils.stub_out_utils_execute(self.stubs) @@ -699,7 +693,15 @@ class XenAPIVMTestCase(test.TestCase): str(3 * 1024)) def test_rescue(self): + def _find_rescue_vbd_ref(*args): + return vbd + + self.stubs.Set(vmops.VMOps, '_find_rescue_vbd_ref', + _find_rescue_vbd_ref) instance = self._create_instance() + session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass') + vm = vm_utils.VMHelper.lookup(session, instance.name) + vbd = xenapi_fake.create_vbd(vm, None) conn = xenapi_conn.get_connection(False) conn.rescue(self.context, instance, [], None) |
