From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F32CEECAAD3 for ; Thu, 1 Sep 2022 09:50:24 +0000 (UTC) Received: from localhost ([::1]:45316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTgq7-0002gu-Sm for qemu-devel@archiver.kernel.org; Thu, 01 Sep 2022 05:50:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTg8Z-00062E-5u for qemu-devel@nongnu.org; Thu, 01 Sep 2022 05:05:23 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]:34644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTg8W-00065h-9o for qemu-devel@nongnu.org; Thu, 01 Sep 2022 05:05:22 -0400 Received: by mail-lj1-x232.google.com with SMTP id z23so14329434ljk.1 for ; Thu, 01 Sep 2022 02:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=l4mQr0rKf79oNY1Ct6p5bxtvMWDxa8e0ajf1qs01Yic=; b=ncIqfSGkSebz1kZTpBUsLZqvkxGRJW5qSBcW3m8tN+wTG2NW1nZsyD7OpVkZQ26eXk uPBq9205xybYxYXQqODcWC5TCHRLAf9eo3b6UQgYp4/x/lMPsuVAOz/11WiUpHWIRMcx GzFn1/2DfltN5s/7PbSJpnX9e893v9YtPpMsJWU05c7LIn6k1prjwVBB2o1pS9oAzAzy m6CVoU/cZowOQ4faSEcbT2AuFGQmtOngWhINQqaX2W/x1ryU1SLZDA1E3m6arFRiD3mZ CeqlzYCY4BoKJV4Eb0TJ+LDSvf6UED7Mlg9Fa+cxeQfU+vVc/5P0J1yxuS9g3Q1qCVzS NBXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=l4mQr0rKf79oNY1Ct6p5bxtvMWDxa8e0ajf1qs01Yic=; b=2M4iL/wepZPDihqUgiYj0QOBZ/mu8wYh2REuuLbw12GhP0ije2zH+qh6NiWJuJoC9J MM+3DlueXVVFn9vxA79qexe85hyBGaIKyq2W2FidDgeKtV0VmUQvWAz/ZP+O0WtcabHa YIzEjB0rBAcuTIph1NtKLVLDLFewNd1j69wtUmbA6ASRNtoAtmx4wEcfnUmwuoej5uKi sz5MvRIbcQuuvMlPjMhhGc2nmVryWxVGIJCco7YU5ClLl83+XjXblpKiZayZjns1E8sI aBP1OF/sjqrV9G+f2v61pEzCelNZmpuN6Yuh7bVX0wX5Tqo+ALtZZI1etCjKnqGFmYun /RPA== X-Gm-Message-State: ACgBeo2M2tGsebZuwG5sbYx+ez0YuBWZCj4XC8MKFFEOLbYlohQcNqjy rVGI9FLYsgvjq85iLtp0yKBiqcVn5dYtLwrKZKo= X-Google-Smtp-Source: AA6agR7fPNNcwR4orRhHE7HBs0xKecZA2G7GXVLsy75+awjvMAfsffWMMMU0uEKvoVBY/zCE4zIL/mkqxFJrT8QWaKg= X-Received: by 2002:a05:651c:a04:b0:25e:753b:db42 with SMTP id k4-20020a05651c0a0400b0025e753bdb42mr9458681ljq.529.1662023116909; Thu, 01 Sep 2022 02:05:16 -0700 (PDT) MIME-Version: 1.0 References: <20220824094029.1634519-1-bmeng.cn@gmail.com> <20220824094029.1634519-35-bmeng.cn@gmail.com> In-Reply-To: <20220824094029.1634519-35-bmeng.cn@gmail.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Thu, 1 Sep 2022 13:05:05 +0400 Message-ID: Subject: Re: [PATCH 34/51] tests/qtest: bios-tables-test: Adapt the case for win32 To: Bin Meng Cc: qemu-devel@nongnu.org, Bin Meng , Ani Sinha , Igor Mammedov , "Michael S. Tsirkin" Content-Type: multipart/alternative; boundary="0000000000007df08505e799e924" Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=marcandre.lureau@gmail.com; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --0000000000007df08505e799e924 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 24, 2022 at 3:02 PM Bin Meng wrote: > From: Bin Meng > > Single quotes in the arguments (oem_id=3D'CRASH ') are not removed in > the Windows environment before it is passed to the QEMU executable. > The space in the argument causes the "-acpitable" option parser to > think that all of its parameters are done, hence it complains: > > '-acpitable' requires one of 'data' or 'file' > > Change to use double quotes which works fine on all platforms. > > Also /dev/null does not work on win32, and nul should be used. > > Signed-off-by: Bin Meng > Reviewed-by: Marc-Andr=C3=A9 Lureau > --- > > tests/qtest/bios-tables-test.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/tests/qtest/bios-tables-test.c > b/tests/qtest/bios-tables-test.c > index 36783966b0..0148ce388c 100644 > --- a/tests/qtest/bios-tables-test.c > +++ b/tests/qtest/bios-tables-test.c > @@ -1615,6 +1615,12 @@ static void test_acpi_virt_viot(void) > free_test_data(&data); > } > > +#ifndef _WIN32 > +# define DEV_NULL "/dev/null" > +#else > +# define DEV_NULL "nul" > +#endif > + > static void test_acpi_q35_slic(void) > { > test_data data =3D { > @@ -1622,9 +1628,9 @@ static void test_acpi_q35_slic(void) > .variant =3D ".slic", > }; > > - test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D'CRASH ',oem_table_id= =3D'ME'," > - "oem_rev=3D00002210,asl_compiler_id=3D'qemu'," > - "asl_compiler_rev=3D00000000,data=3D/dev/null", > + test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D\"CRASH \",oem_table_i= d=3DME," > + "oem_rev=3D00002210,asl_compiler_id=3Dqemu," > + "asl_compiler_rev=3D00000000,data=3D" DEV_NULL, > &data); > free_test_data(&data); > } > -- > 2.34.1 > > > --=20 Marc-Andr=C3=A9 Lureau --0000000000007df08505e799e924 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Aug 24, 2022 at 3:02 PM Bin M= eng <bmeng.cn@gmail.com> wr= ote:
From: Bin M= eng <bin.men= g@windriver.com>

Single quotes in the arguments (oem_id=3D'CRASH ') are not removed = in
the Windows environment before it is passed to the QEMU executable.
The space in the argument causes the "-acpitable" option parser t= o
think that all of its parameters are done, hence it complains:

=C2=A0 '-acpitable' requires one of 'data' or 'file'= ;

Change to use double quotes which works fine on all platforms.

Also /dev/null does not work on win32, and nul should be used.

Signed-off-by: Bin Meng <bin.meng@windriver.com>

=
Reviewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
=C2=A0
---

=C2=A0tests/qtest/bios-tables-test.c | 12 +++++++++---
=C2=A01 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.= c
index 36783966b0..0148ce388c 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1615,6 +1615,12 @@ static void test_acpi_virt_viot(void)
=C2=A0 =C2=A0 =C2=A0free_test_data(&data);
=C2=A0}

+#ifndef _WIN32
+# define DEV_NULL "/dev/null"
+#else
+# define DEV_NULL "nul"
+#endif
+
=C2=A0static void test_acpi_q35_slic(void)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0test_data data =3D {
@@ -1622,9 +1628,9 @@ static void test_acpi_q35_slic(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.variant =3D ".slic",
=C2=A0 =C2=A0 =C2=A0};

-=C2=A0 =C2=A0 test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D'CRAS= H ',oem_table_id=3D'ME',"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "oem_r= ev=3D00002210,asl_compiler_id=3D'qemu',"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "asl_c= ompiler_rev=3D00000000,data=3D/dev/null",
+=C2=A0 =C2=A0 test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D\"CR= ASH \",oem_table_id=3DME,"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "oem_r= ev=3D00002210,asl_compiler_id=3Dqemu,"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "asl_c= ompiler_rev=3D00000000,data=3D" DEV_NULL,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&d= ata);
=C2=A0 =C2=A0 =C2=A0free_test_data(&data);
=C2=A0}
--
2.34.1




--
Marc-Andr=C3=A9 Lureau
--0000000000007df08505e799e924--