From nobody Sat Oct 25 21:45:33 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 1521179047726429.2989437661057; Thu, 15 Mar 2018 22:44:07 -0700 (PDT) Received: from localhost ([::1]:55108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewi9v-0008Cc-0V for importer@patchew.org; Fri, 16 Mar 2018 01:44:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewi6E-0005eg-BU for qemu-devel@nongnu.org; Fri, 16 Mar 2018 01:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewi6D-0003DZ-8g for qemu-devel@nongnu.org; Fri, 16 Mar 2018 01:40:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60430 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewi6A-00038w-Ke; Fri, 16 Mar 2018 01:40:14 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E99AA1BE1; Fri, 16 Mar 2018 05:40:14 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A7AB215CDAF; Fri, 16 Mar 2018 05:40:11 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Fri, 16 Mar 2018 06:39:55 +0100 Message-Id: <1521178795-21894-4-git-send-email-thuth@redhat.com> In-Reply-To: <1521178795-21894-1-git-send-email-thuth@redhat.com> References: <1521178795-21894-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 16 Mar 2018 05:40:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 16 Mar 2018 05:40:14 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 3/3] tests/cdrom-test: Test that -cdrom parameter is working 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 , Victor Kaplansky , qemu-block@nongnu.org, "Michael S. Tsirkin" , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-s390x@nongnu.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit 1454509726719e0933c800 recently broke the "-cdrom" parameter on a couple of boards without us noticing it immediately. Thus let's add a test which checks that "-cdrom" can at least be used to start QEMU with certain machine types. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/cdrom-test.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 58 insertions(+) diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c index 5bbf322..7a1fce5 100644 --- a/tests/cdrom-test.c +++ b/tests/cdrom-test.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "boot-sector.h" +#include "qapi/qmp/qdict.h" =20 static char isoimage[] =3D "cdrom-boot-iso-XXXXXX"; =20 @@ -89,6 +90,32 @@ cleanup: return ret; } =20 +/** + * Check that at least the -cdrom parameter is basically working, i.e. we = can + * see the filename of the ISO image in the output of "info block" afterwa= rds + */ +static void test_cdrom_param(gconstpointer data) +{ + QTestState *qts; + char *resp; + + qts =3D qtest_startf("-M %s -cdrom %s", (const char *)data, isoimage); + resp =3D qtest_hmp(qts, "info block"); + g_assert(strstr(resp, isoimage) !=3D 0); + g_free(resp); + qtest_quit(qts); +} + +static void add_cdrom_param_tests(const char **machines) +{ + while (*machines) { + char *testname =3D g_strdup_printf("cdrom/param/%s", *machines); + qtest_add_data_func(testname, *machines, test_cdrom_param); + g_free(testname); + machines++; + } +} + static void test_cdboot(gconstpointer data) { QTestState *qts; @@ -154,6 +181,37 @@ int main(int argc, char **argv) add_x86_tests(); } else if (g_str_equal(arch, "s390x")) { add_s390x_tests(); + } else if (g_str_equal(arch, "ppc64")) { + const char *ppcmachines[] =3D { + "pseries", "mac99", "g3beige", "40p", "prep", NULL + }; + add_cdrom_param_tests(ppcmachines); + } else if (g_str_equal(arch, "sparc")) { + const char *sparcmachines[] =3D { + "LX", "SPARCClassic", "SPARCbook", "SS-10", "SS-20", "SS-4", + "SS-5", "SS-600MP", "Voyager", "leon3_generic", NULL + }; + add_cdrom_param_tests(sparcmachines); + } else if (g_str_equal(arch, "sparc64")) { + const char *sparc64machines[] =3D { + "niagara", "sun4u", "sun4v", NULL + }; + add_cdrom_param_tests(sparc64machines); + } else if (!strncmp(arch, "mips64", 6)) { + const char *mips64machines[] =3D { + "magnum", "malta", "mips", "pica61", NULL + }; + add_cdrom_param_tests(mips64machines); + } else if (g_str_equal(arch, "arm") || g_str_equal(arch, "aarch64")) { + const char *armmachines[] =3D { + "realview-eb", "realview-eb-mpcore", "realview-pb-a8", + "realview-pbx-a9", "versatileab", "versatilepb", "vexpress-a15= ", + "vexpress-a9", "virt", NULL + }; + add_cdrom_param_tests(armmachines); + } else { + const char *nonemachine[] =3D { "none", NULL }; + add_cdrom_param_tests(nonemachine); } =20 ret =3D g_test_run(); --=20 1.8.3.1