提交 25556f4e 编写于 作者: C Cleber Rosa

VM Plugin: no need to gracefully shutdown VM if it's state will be reverted

Let's be practical and simply destroy (pull the plug on the VM) that
will have its state (snapshot reverted).

Not shutting down (or powering off/destroying) the VM has the side
effect of not reverting the state of the (still running) VM on a
couple of platforms, including EL7.

This fixed issue #396.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 cbadb41c
......@@ -145,5 +145,7 @@ class VMTestResult(RemoteTestResult):
def tear_down(self):
super(VMTestResult, self).tear_down()
if self.args.vm_cleanup is True and self.vm.snapshot is not None:
if self.args.vm_cleanup is True:
self.vm.stop()
if self.vm.snapshot is not None:
self.vm.restore_snapshot()
......@@ -52,6 +52,7 @@ class VMTestResultTest(unittest.TestCase):
self.remote = VMTestResult(Stream, Args)
# vm.RemoteTestResult.tear_down()
RemoteTestResult.should_receive('tear_down').once().ordered()
mock_vm.should_receive('stop').once().ordered()
mock_vm.should_receive('restore_snapshot').once().ordered()
def tearDown(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册