diff options
Diffstat (limited to 'nova/tests/virt/xenapi/test_vmops.py')
-rw-r--r-- | nova/tests/virt/xenapi/test_vmops.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nova/tests/virt/xenapi/test_vmops.py b/nova/tests/virt/xenapi/test_vmops.py index 1acc4d515..18a444f41 100644 --- a/nova/tests/virt/xenapi/test_vmops.py +++ b/nova/tests/virt/xenapi/test_vmops.py @@ -151,3 +151,18 @@ class VMOpsTestCase(test.TestCase): self._vmops._determine_vm_mode(fake_instance, fake_vdis, fake_disk_type)) self.mox.VerifyAll() + + def test_xsm_sr_check_relaxed_cached(self): + self.make_plugin_call_count = 0 + + def fake_make_plugin_call(plugin, method, **args): + self.make_plugin_call_count = self.make_plugin_call_count + 1 + return "true" + + self.stubs.Set(self._vmops, "_make_plugin_call", + fake_make_plugin_call) + + self.assertTrue(self._vmops._is_xsm_sr_check_relaxed()) + self.assertTrue(self._vmops._is_xsm_sr_check_relaxed()) + + self.assertEqual(self.make_plugin_call_count, 1) |