From patchwork Tue Oct 15 02:41:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 283447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4C0752C00DE for ; Tue, 15 Oct 2013 13:42:25 +1100 (EST) Received: from localhost ([::1]:39441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVuaU-0001k8-EK for incoming@patchwork.ozlabs.org; Mon, 14 Oct 2013 22:42:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVuaB-0001jo-87 for qemu-devel@nongnu.org; Mon, 14 Oct 2013 22:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVua5-0003qp-8h for qemu-devel@nongnu.org; Mon, 14 Oct 2013 22:42:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVua4-0003qe-W4 for qemu-devel@nongnu.org; Mon, 14 Oct 2013 22:41:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9F2ftEB001139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Oct 2013 22:41:56 -0400 Received: from T430s.nay.redhat.com (vpn1-5-72.sin2.redhat.com [10.67.5.72]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9F2fqGa023824; Mon, 14 Oct 2013 22:41:53 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Tue, 15 Oct 2013 10:41:51 +0800 Message-Id: <1381804911-3664-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH] qemu-iotests: fix 030 for faster machines X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If the block job completes too fast, the test can fail. Change the numbers so the qmp events are more stably captured by the script. A sleep is removed for the same reason. Signed-off-by: Fam Zheng --- tests/qemu-iotests/030 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index ae56f3b..188b182 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -403,14 +403,13 @@ class TestStreamStop(iotests.QMPTestCase): result = self.vm.qmp('block-stream', device='drive0') self.assert_qmp(result, 'return', {}) - time.sleep(0.1) events = self.vm.get_qmp_events(wait=False) self.assertEqual(events, [], 'unexpected QMP event: %s' % events) self.cancel_and_wait() class TestSetSpeed(iotests.QMPTestCase): - image_len = 80 * 1024 * 1024 # MB + image_len = 512 * 1024 * 1024 # MB def setUp(self): qemu_img('create', backing_img, str(TestSetSpeed.image_len)) @@ -457,23 +456,23 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return[0]/device', 'drive0') self.assert_qmp(result, 'return[0]/speed', 0) - result = self.vm.qmp('block-job-set-speed', device='drive0', speed=8 * 1024 * 1024) + result = self.vm.qmp('block-job-set-speed', device='drive0', speed=8 * 1024) self.assert_qmp(result, 'return', {}) # Ensure the speed we set was accepted result = self.vm.qmp('query-block-jobs') self.assert_qmp(result, 'return[0]/device', 'drive0') - self.assert_qmp(result, 'return[0]/speed', 8 * 1024 * 1024) + self.assert_qmp(result, 'return[0]/speed', 8 * 1024) self.cancel_and_wait() # Check setting speed in block-stream works - result = self.vm.qmp('block-stream', device='drive0', speed=4 * 1024 * 1024) + result = self.vm.qmp('block-stream', device='drive0', speed=4 * 1024) self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block-jobs') self.assert_qmp(result, 'return[0]/device', 'drive0') - self.assert_qmp(result, 'return[0]/speed', 4 * 1024 * 1024) + self.assert_qmp(result, 'return[0]/speed', 4 * 1024) self.cancel_and_wait()