From nobody Thu Nov 6 01:19:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538094825957373.1355671943936; Thu, 27 Sep 2018 17:33:45 -0700 (PDT) Received: from localhost ([::1]:40447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5giz-0005fh-OX for importer@patchew.org; Thu, 27 Sep 2018 20:33:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5gh5-0003lC-Vo for qemu-devel@nongnu.org; Thu, 27 Sep 2018 20:31:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5gh4-0008KY-0I for qemu-devel@nongnu.org; Thu, 27 Sep 2018 20:31:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54724) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5gh2-0008IE-31 for qemu-devel@nongnu.org; Thu, 27 Sep 2018 20:31:40 -0400 Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62BD9308624E; Fri, 28 Sep 2018 00:31:39 +0000 (UTC) Received: from x1w.redhat.com (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F289C3091375; Fri, 28 Sep 2018 00:31:36 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Cleber Rosa , Eduardo Habkost , Caio Carrara Date: Fri, 28 Sep 2018 01:30:58 +0100 Message-Id: <20180928003058.12786-4-philmd@redhat.com> In-Reply-To: <20180928003058.12786-1-philmd@redhat.com> References: <20180928003058.12786-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 28 Sep 2018 00:31:39 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [RFC PATCH 3/3] acceptance tests: Add EDK2 AAVMF boot and console checking test 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: Ard Biesheuvel , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Laszlo Ersek , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This test boots EDK2 AAVMF and check the debug console (PL011) reports enou= gh information on the initialized devices. Example: $ avocado --show=3Dconsole run tests/acceptance/boot_firmware.py --cit-= parameter-file aarch64.cit having aarch64.cit: [parameters] qemu_bin: aarch64-softmmu/qemu-system-aarch64 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- - requires (even for single parameter): $ pip install avocado-framework-plugin-varianter-cit - use gzip kludge (avocado only support tarballs) - can not set $arch param since pick_default_qemu_bin() forces to host os.u= name()[4] --- tests/acceptance/boot_firmware.py | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/acceptance/boot_firmware.py b/tests/acceptance/boot_firm= ware.py index 05f6728212..4f5554c0ad 100644 --- a/tests/acceptance/boot_firmware.py +++ b/tests/acceptance/boot_firmware.py @@ -10,6 +10,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 import os +import gzip import time import shutil import logging @@ -122,3 +123,45 @@ class BootFirmwareX86(Test): if line + '\r\n' not in lines: self.fail('missing: %s' % line) shutil.rmtree(tmpdirname, ignore_errors=3DTrue) + + +class BootFirmwareAarch64(Test): + """ + Boots the EDK2 firmware on a default virt machine and checks the conso= le is + operational + + :avocado: enable + :avocado: tags=3Darch:aarch64 + :avocado: tags=3Daarch64,quick + """ + + timeout =3D 15 + + def test_aavmf(self): + tmpdirname =3D tempfile.mkdtemp() + image_url =3D ('http://snapshots.linaro.org/components/kernel/' + 'leg-virt-tianocore-edk2-upstream/latest/' + 'QEMU-AARCH64/DEBUG_GCC5/QEMU_EFI.img.gz') + image_path_gz =3D self.fetch_asset(image_url) + image_path =3D os.path.join(tmpdirname, 'flash.img') + with gzip.open(image_path_gz) as gz, open(image_path, 'wb') as img: + shutil.copyfileobj(gz, img) + + self.vm.set_machine('virt') + self.vm.set_console() + self.vm.add_args('-nographic', + '-cpu', 'cortex-a57', + '-m', '1G', + '-pflash', image_path) + self.vm.launch() + console =3D self.vm.console_socket.makefile() + serial_logger =3D logging.getLogger('serial') + + # serial console checks + while True: + msg =3D console.readline() + if not '\x1b' in msg: # ignore ANSI sequences + serial_logger.debug(msg.strip()) + if 'Start PXE over IPv4InstallProtocolInterface:' in msg: + break + shutil.rmtree(tmpdirname, ignore_errors=3DTrue) --=20 2.17.1