From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlmy-0001eI-S4 for qemu-devel@nongnu.org; Tue, 08 May 2012 10:53:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRlmu-0007ge-2w for qemu-devel@nongnu.org; Tue, 08 May 2012 10:53:20 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:35271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlmt-0007gL-Q8 for qemu-devel@nongnu.org; Tue, 08 May 2012 10:53:15 -0400 Received: by pbbro12 with SMTP id ro12so10991250pbb.4 for ; Tue, 08 May 2012 07:53:13 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 8 May 2012 16:51:53 +0200 Message-Id: <1336488722-13120-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1336488722-13120-1-git-send-email-pbonzini@redhat.com> References: <1336488722-13120-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1.1 13/22] stream: fix sectors not allocated test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com 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: Paolo Bonzini --- tests/qemu-iotests/030 | 1 + tests/qemu-iotests/iotests.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 38abc2c..0d2f87b 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 36787cc..e27b40e 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''' -- 1.7.10.1