diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 38abc2ce77046ff3c3df8ebc8b259197a013c0d6..0d2f87baa5bc539a85a8d94a448dc1ce26e58b8b 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -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') diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 36787cca928bca2bf86e249da2bdde9fbf0a243d..e27b40e2898b65ffbfd24fa43926a862815784b1 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -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'''