From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579739813; cv=none; d=zohomail.com; s=zohoarc; b=nTz8m7CF/NAm8lC08+9xNPmacUZiLWUEdrk8eLkIQAS4df+IhYlZF2hsy2FMurBkIFdK4A50mWVHR6drJ63vYOwqBaKg8bp5upnU5jsJUfGnjYy/DCxRHHVFCnosPWJjyJs8XyZ9bqZ62HhcBfTgG1yHkha8FnYXEn52B4pe5Rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579739813; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=/2apbwhRNfDklNmkih1t8Cxh6sWeUkA+QXjuH6egj8I=; b=mFH1kM8IBwe6x7qOn4TTUIXEUYZeWlHTEXJ9xqMGfTY7zB7tAftjANqYiCLHEpvD7w1RTJlXRcuS84kZy/SO4rfoy/gf6joVX7J/f3A2m2D/BDr4kltlnsFpNg4V+/3EdEkWF+EmXz7FXJYrU43TmujFmz9UzbpKi+/DAwu14DE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579739813337592.264858027896; Wed, 22 Jan 2020 16:36:53 -0800 (PST) Received: from localhost ([::1]:49374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuQUN-0007jd-Er for importer@patchew.org; Wed, 22 Jan 2020 19:36:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43022) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuQTg-0007Kh-Um for qemu-devel@nongnu.org; Wed, 22 Jan 2020 19:36:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuQTf-000078-IS for qemu-devel@nongnu.org; Wed, 22 Jan 2020 19:36:08 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:50835) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuQTf-000066-CT for qemu-devel@nongnu.org; Wed, 22 Jan 2020 19:36:07 -0500 Received: by mail-wm1-x342.google.com with SMTP id a5so733567wmb.0 for ; Wed, 22 Jan 2020 16:36:07 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id n16sm649500wro.88.2020.01.22.16.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 16:36:05 -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:mime-version :content-transfer-encoding; bh=/2apbwhRNfDklNmkih1t8Cxh6sWeUkA+QXjuH6egj8I=; b=dLoHT3uUYFFmkCDMW3+FTF4oRnxQB3XifbNI4V5nY1vTBtS+PNRgnmdcKIqRikyZWx DS7Z+aJOiXNjerRCESTr/IePkOK5pFG8YePzI73pzxW55m37ufQeY5PfHjF0gfMTRXDH XeOpREW8ZaijhexoCuT5AwN+iv9xjLVZk+77thCcr1dFO0Z4cbgTG7JvJPn2AkwDkbYQ f23bumu2KJcd2sE5hvTjcHcOQ5vdIlIcnei0XnpY/ULGVC6pLpb5LB1XQ6S8UqBu73CD lQz6d27QpmOjvuDIRXPTTbNXpYd91pdFS4fu3DDRUR3Uv1pQ78a/FIEUXPaQj3BtW5/z 3JAA== 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 :mime-version:content-transfer-encoding; bh=/2apbwhRNfDklNmkih1t8Cxh6sWeUkA+QXjuH6egj8I=; b=T+SHW8jc1uCydoHEJp6efbO6q4xQHEeZZYZfWLZAYKt11Q0smIQmNMFhdGwEXStSH5 az7WUcWE0dgd/lUh3g7sdOaj53p5NxDl4QVLCno0anIdIIA4VhneFZ30OuDA0z0mlkK+ xKsjVMYU9g/yNLm7h7rRNB6PMA+H9V2BtSuOZGFCO9VY0+LTKTSaruXgS0My72JJIGny uI6VyXPjaWr0ivFvoulGDzL27SBMeIx5sA9bfPwIeHxOaCTi68DYU4cob6+xucmebKX5 9IW9ju5s0U8OLnrPZGZiBpnANzAhFI+6L+RGZn+TqBA90pCDgzeYtazRkwZuLie21d1m ALTw== X-Gm-Message-State: APjAAAWwuZLkx8XL+BppxOumh76o0nQ0vXJuy/A5ELR76Dtjl7ASyA3l FkMOda59qlyFYxQP4Ac8lcFM03sZ X-Google-Smtp-Source: APXvYqxUNQErt/RnWarRlqNvZkr1xJaSM+TAS9jfKIiw2pGf0wB8Z6WG91pItnufyqinG21t4NR2og== X-Received: by 2002:a1c:2dcd:: with SMTP id t196mr833229wmt.22.1579739765837; Wed, 22 Jan 2020 16:36:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Helge Deller , qemu-devel@nongnu.org Subject: [PATCH] tests/boot-serial-test: Allow the HPPA machine to shudown Date: Thu, 23 Jan 2020 01:36:03 +0100 Message-Id: <20200123003603.11610-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Sven Schnelle , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The boot-serial test uses SeaBIOS on HPPA, and expects to read the "SeaBIOS wants SYSTEM HALT" string, see [*]: 122 void __VISIBLE __noreturn hlt(void) 123 { 124 if (pdc_debug) 125 printf("HALT initiated from %p\n", __builtin_return_address(0= )); 126 printf("SeaBIOS wants SYSTEM HALT.\n\n"); 127 asm volatile("\t.word 0xfffdead0": : :"memory"); 128 while (1); 129 } A 'SYSTEM HALT' would really halts the CPU, but SeaBIOS implements it as an infinite loop. If SeaBIOS does not use the expected serial port but another device, we might poll the console indefinitely while the machine is halted. Allow the HPPA machine to 'shutdown'. When it does, we'll get a qtest error: $ make check-qtest-hppa TEST check-qtest-hppa: tests/qtest/boot-serial-test ** (tests/qtest/boot-serial-test:31924): ERROR **: 01:12:37.604: Failed t= o find expected string. Please check '/tmp/qtest-boot-serial-sjxoM6Q' ERROR - Bail out! FATAL-ERROR: Failed to find expected string. Please che= ck '/tmp/qtest-boot-serial-sjxoM6Q' make: *** [tests/Makefile.include:628: check-qtest-hppa] Error 1 [*] https://github.com/qemu/seabios-hppa/blob/1630ac7d65/src/parisc/parisc.= c#L138 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- I first used: shutdown =3D !strcmp(test->arch, "hppa"); Then remembered we'll have other HPPA machines soon. Instead of: shutdown =3D !strcmp(test->machine, "hppa"); I find the check on the SeaBIOS specific string more accurate (since someone might add some assembly lines as the other tests). --- tests/qtest/boot-serial-test.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 05c7f44457..4e92f292f5 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -188,6 +188,17 @@ static void test_machine(const void *data) const uint8_t *code =3D NULL; QTestState *qts; int ser_fd; + bool shutdown; + + /* + * This test uses SeaBIOS on HPPA, and expects to read the + * "SeaBIOS wants SYSTEM HALT" string. A 'SYSTEM HALT' really + * halts the CPU. If SeaBIOS does not use the expected serial + * port but another device, we might poll the console + * indefinitely while the machine is halted. + * Keep using this option for all the other tests. + */ + shutdown =3D !strcmp(test->expect, "SeaBIOS wants SYSTEM HALT"); =20 ser_fd =3D mkstemp(serialtmp); g_assert(ser_fd !=3D -1); @@ -215,10 +226,11 @@ static void test_machine(const void *data) * Make sure that this test uses tcg if available: It is used as a * fast-enough smoketest for that. */ - qts =3D qtest_initf("%s %s -M %s -no-shutdown " + qts =3D qtest_initf("%s %s -M %s %s " "-chardev file,id=3Dserial0,path=3D%s " "-serial chardev:serial0 -accel tcg -accel kvm %s", codeparam, code ? codetmp : "", test->machine, + shutdown ? "" : "-no-shutdown", serialtmp, test->extra); if (code) { unlink(codetmp); --=20 2.21.1