From patchwork Mon Feb 18 18:06:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 10818549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 873AD17D5 for ; Mon, 18 Feb 2019 18:08:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7538E25F31 for ; Mon, 18 Feb 2019 18:08:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6915B2B85D; Mon, 18 Feb 2019 18:08:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 10E6925F31 for ; Mon, 18 Feb 2019 18:08:32 +0000 (UTC) Received: from localhost ([127.0.0.1]:34844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvnLD-00062v-Cs for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Feb 2019 13:08:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvnJp-0005M6-7j for qemu-devel@nongnu.org; Mon, 18 Feb 2019 13:07:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvnJo-0006Tm-91 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 13:07:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23110) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvnJa-0006Be-NP; Mon, 18 Feb 2019 13:06:53 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A7B3C057E39; Mon, 18 Feb 2019 18:06:48 +0000 (UTC) Received: from localhost (ovpn-204-76.brq.redhat.com [10.40.204.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCA485ED44; Mon, 18 Feb 2019 18:06:47 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 18 Feb 2019 19:06:46 +0100 Message-Id: <20190218180646.30282-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 18 Feb 2019 18:06:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] iotests: Skip 211 on insufficient memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP VDI keeps the whole bitmap in memory, and the maximum size (which is tested here) is 2 GB. This may not be available on all machines, and it rarely is available when running a 32 bit build. Fix this by making VM.run_job() return the error string if an error occurred, and checking whether that contains "Could not allocate bmap" in 211. If so, the test is skipped. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- tests/qemu-iotests/211 | 4 +++- tests/qemu-iotests/iotests.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211 index 5d285450b5..6afc894f76 100755 --- a/tests/qemu-iotests/211 +++ b/tests/qemu-iotests/211 @@ -32,7 +32,9 @@ def blockdev_create(vm, options): if 'return' in result: assert result['return'] == {} - vm.run_job('job0') + error = vm.run_job('job0') + if error and 'Could not allocate bmap' in error: + iotests.notrun('Insufficient memory') iotests.log("") with iotests.FilePath('t.vdi') as disk_path, \ diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 387e026556..4910fb2005 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -532,7 +532,9 @@ class VM(qtest.QEMUQtestMachine): log(result, filters, indent=indent) return result + # Returns None on success, and an error string on failure def run_job(self, job, auto_finalize=True, auto_dismiss=False): + error = None while True: for ev in self.get_qmp_events_filtered(wait=True): if ev['event'] == 'JOB_STATUS_CHANGE': @@ -541,13 +543,14 @@ class VM(qtest.QEMUQtestMachine): result = self.qmp('query-jobs') for j in result['return']: if j['id'] == job: + error = j['error'] log('Job failed: %s' % (j['error'])) elif status == 'pending' and not auto_finalize: self.qmp_log('job-finalize', id=job) elif status == 'concluded' and not auto_dismiss: self.qmp_log('job-dismiss', id=job) elif status == 'null': - return + return error else: iotests.log(ev)