From patchwork Fri Oct 26 14:15:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 989584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42hR1K2v4Nz9sLt for ; Sat, 27 Oct 2018 01:18:29 +1100 (AEDT) Received: from localhost ([::1]:60323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG2wV-00039L-0b for incoming@patchwork.ozlabs.org; Fri, 26 Oct 2018 10:18:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG2u9-00020A-KU for qemu-devel@nongnu.org; Fri, 26 Oct 2018 10:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG2u8-00066D-Qy for qemu-devel@nongnu.org; Fri, 26 Oct 2018 10:16:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49976) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gG2u8-00065A-HV for qemu-devel@nongnu.org; Fri, 26 Oct 2018 10:16:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C599930020CB; Fri, 26 Oct 2018 14:15:59 +0000 (UTC) Received: from magic.redhat.com (ovpn-116-212.ams2.redhat.com [10.36.116.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5725605FA; Fri, 26 Oct 2018 14:15:55 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 26 Oct 2018 22:15:26 +0800 Message-Id: <20181026141529.4305-7-famz@redhat.com> In-Reply-To: <20181026141529.4305-1-famz@redhat.com> References: <20181026141529.4305-1-famz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 26 Oct 2018 14:15:59 +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] [PULL 6/9] tests/vm: Add a BaseVM::arch property 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The 'arch' property gives a hint on which architecture the guest image runs. This can be use to select the correct QEMU binary path. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20181013004034.6968-6-f4bug@amsat.org> Reviewed-by: Richard Henderson Signed-off-by: Fam Zheng --- tests/vm/basevm.py | 4 +++- tests/vm/centos | 1 + tests/vm/freebsd | 1 + tests/vm/netbsd | 1 + tests/vm/openbsd | 1 + tests/vm/ubuntu.i386 | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 81a1cb05dd..b2e0de2022 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -42,6 +42,8 @@ class BaseVM(object): BUILD_SCRIPT = "" # The guest name, to be overridden by subclasses name = "#base" + # The guest architecture, to be overridden by subclasses + arch = "#arch" def __init__(self, debug=False, vcpus=None): self._guest = None self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", @@ -151,7 +153,7 @@ class BaseVM(object): "-device", "virtio-blk,drive=drive0,bootindex=0"] args += self._data_args + extra_args logging.debug("QEMU args: %s", " ".join(args)) - qemu_bin = os.environ.get("QEMU", "qemu-system-x86_64") + qemu_bin = os.environ.get("QEMU", "qemu-system-" + self.arch) guest = QEMUMachine(binary=qemu_bin, args=args) try: guest.launch() diff --git a/tests/vm/centos b/tests/vm/centos index afd560c564..daa2dbca03 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -19,6 +19,7 @@ import time class CentosVM(basevm.BaseVM): name = "centos" + arch = "x86_64" BUILD_SCRIPT = """ set -e; cd $(mktemp -d); diff --git a/tests/vm/freebsd b/tests/vm/freebsd index b6983127d0..19a3729172 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -18,6 +18,7 @@ import basevm class FreeBSDVM(basevm.BaseVM): name = "freebsd" + arch = "x86_64" BUILD_SCRIPT = """ set -e; rm -rf /var/tmp/qemu-test.* diff --git a/tests/vm/netbsd b/tests/vm/netbsd index a4e25820d5..fac6a7ce51 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -18,6 +18,7 @@ import basevm class NetBSDVM(basevm.BaseVM): name = "netbsd" + arch = "x86_64" BUILD_SCRIPT = """ set -e; rm -rf /var/tmp/qemu-test.* diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 52500ee52b..cfe0572c59 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -18,6 +18,7 @@ import basevm class OpenBSDVM(basevm.BaseVM): name = "openbsd" + arch = "x86_64" BUILD_SCRIPT = """ set -e; rm -rf /var/tmp/qemu-test.* diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index 3f6ed48b74..1b7e1ab8f0 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -19,6 +19,7 @@ import time class UbuntuX86VM(basevm.BaseVM): name = "ubuntu.i386" + arch = "i386" BUILD_SCRIPT = """ set -e; cd $(mktemp -d);