提交 863a5d04 编写于 作者: P Paolo Bonzini 提交者: Kevin Wolf

stream: fix sectors not allocated test

The test on sectors not allocated can fail if the L1/L2 tables are
not on disk yet.  Allow tests to shutdown the VM early.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 cc785c34
......@@ -78,6 +78,7 @@ class TestSingleDrive(ImageStreamingTestCase):
completed = True
self.assert_no_active_streams()
self.vm.shutdown()
self.assertFalse('sectors not allocated' in qemu_io('-c', 'map', test_img),
'image file not fully populated after streaming')
......
......@@ -87,10 +87,12 @@ class VM(object):
def shutdown(self):
'''Terminate the VM and clean up'''
self._qmp.cmd('quit')
self._popen.wait()
os.remove(self._monitor_path)
os.remove(self._qemu_log_path)
if not self._popen is None:
self._qmp.cmd('quit')
self._popen.wait()
os.remove(self._monitor_path)
os.remove(self._qemu_log_path)
self._popen = None
def qmp(self, cmd, **args):
'''Invoke a QMP command and return the result dict'''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册