From patchwork Wed Dec 13 21:35:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10110963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7B84F602B3 for ; Wed, 13 Dec 2017 21:44:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B83C28EF0 for ; Wed, 13 Dec 2017 21:44:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DDCD28FBF; Wed, 13 Dec 2017 21:44:37 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C167E28EF0 for ; Wed, 13 Dec 2017 21:44:36 +0000 (UTC) Received: from localhost ([::1]:37873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePEpP-0006mk-Mw for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Dec 2017 16:44:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePEhY-0000se-Cn for qemu-devel@nongnu.org; Wed, 13 Dec 2017 16:36:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePEhV-00024e-9G for qemu-devel@nongnu.org; Wed, 13 Dec 2017 16:36:28 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:44002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePEhV-00023x-5e for qemu-devel@nongnu.org; Wed, 13 Dec 2017 16:36:25 -0500 Received: by mail-qt0-x241.google.com with SMTP id w10so5525245qtb.10 for ; Wed, 13 Dec 2017 13:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bX+wDT1QNK/cjDvZnfBBX1BwVlWckDItF48G9eNAAyc=; b=N/03LCipZNVIHphJAhxb8lfOXQrKZNNHfLQ5cyF8Dlm7GE7gkajXinFEwUkJqeNt1U /60WRyZaB9MMJKHr50v9aePsg8ixOggAiSn1jS9s1NjG1JhtK6YjNFuk3TSYLSp4LVS/ tRR7s4UXCNpUbW18RlJNGAdk5D5GAnKZiDC7gk9mmyhnM9I4EiO3urDmntUjr77KYlhK 5u/G7FQokTGP3FqOqOog8N2Ktwmvylz7j1/7zVD4Rf38h/Ai1E7J8ZsnBpe7qmzlbEQ+ yJw4/JO8ou2HdVzw4J5uKKR9EnLE3e9oB2HX1uXYw6P73sY+mJhD5gZp8KhSthAFPVqi dJVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bX+wDT1QNK/cjDvZnfBBX1BwVlWckDItF48G9eNAAyc=; b=At4DlkD+9jMET/3aTvp9K+dPuOnCQISZwo6jdm6pJk4/KcJgRKaqGUuZiAE0UOqPWX S+41DfT7O6h3ijSPNe5wYJdnkq/4avIK6M7MdmDYMbe/sPnWH1f1J9wPAaDRXQPvsDlj fK1MlDxgafIM1leKUEKydf6WvL319FJOEc5v3/dhFsjYSjKXD0vJYZkR6WKgOZPmtA9f NteBChv5ioanmr2ZmPWhb/7b49b+yRdJv5iUMtaq7SUBxiRzM5IYZgdZIClXJSM5Chaf h+F7oR6rwUZNjs/BxeEKnM9uRhjyBFT3oVKNx12iMHVsuKH3EoeueFj71rHGNeuWz5Kx JrTQ== X-Gm-Message-State: AKGB3mJD5J3nqr+TDulE47fP/U20JzxZNhd3N1rSHG0jbgOVdYQsqs8K 2IgPGIeLQxs02n838052aFg= X-Google-Smtp-Source: ACJfBotmqUxF3FOkuAbP57ErD97Cfo3kQTozvY624egS60y3CzVKKxDdwjFVp9kxQRkKGre9wXKAXg== X-Received: by 10.237.55.9 with SMTP id i9mr13246490qtb.164.1513200984680; Wed, 13 Dec 2017 13:36:24 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id x23sm1617150qkb.4.2017.12.13.13.36.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 13:36:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , "Edgar E . Iglesias" , Cleber Rosa , Kevin Wolf , Max Reitz , John Snow , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng Date: Wed, 13 Dec 2017 18:35:55 -0300 Message-Id: <20171213213557.26561-5-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171213213557.26561-1-f4bug@amsat.org> References: <20171213213557.26561-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 4/6] qtest.py: add verify_machine(supported_machines) 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We can now restrict tests to specific machines. Signed-off-by: Philippe Mathieu-Daudé --- scripts/qtest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/qtest.py b/scripts/qtest.py index 733686a6fe..429eb67c2a 100644 --- a/scripts/qtest.py +++ b/scripts/qtest.py @@ -19,6 +19,7 @@ import re import unittest import logging import tempfile +import subprocess qemu_prog = os.environ.get('QEMU_PROG', 'qemu') @@ -210,3 +211,18 @@ def notrun(reason): def verify_platform(supported_oses=['linux']): if True not in [sys.platform.startswith(x) for x in supported_oses]: notrun('not suitable for this OS: %s' % sys.platform) + +def verify_machine(supported_machines): + if 'any' in supported_machines: + return + args = list((qemu_prog, "-machine", "help")) + subp = subprocess.Popen(args, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + exitcode = subp.wait() + if exitcode < 0: + sys.stderr.write('qemu received signal %i: %s\n' % (-exitcode, + ' '.join(args))) + machines = re.split("\n([\w\.-]+)\s.*", subp.communicate()[0]) + + if True not in [x in machines for x in supported_machines]: + notrun('not machine suitable for this test')