From: Sunil V L <sunilvl@ventanamicro.com>
To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Ani Sinha" <anisinha@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
"Alistair Francis" <alistair23@gmail.com>,
"Andrew Jones" <ajones@ventanamicro.com>,
"Anup Patel" <apatel@ventanamicro.com>,
"Haibo1 Xu" <haibo1.xu@intel.com>,
"Sunil V L" <sunilvl@ventanamicro.com>
Subject: [PATCH 06/12] tests/qtest/bios-tables-test.c: Add support for arch in path
Date: Fri, 15 Mar 2024 18:39:18 +0530 [thread overview]
Message-ID: <20240315130924.2378849-4-sunilvl@ventanamicro.com> (raw)
In-Reply-To: <20240315130924.2378849-1-sunilvl@ventanamicro.com>
Since virt machine is common for multiple architectures, add "arch" in
the path to search expected AML files. Since the AML files are still
under old path, support both by searching with and without arch in the
path.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
---
tests/qtest/bios-tables-test.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index ea3ba1992b..c492438ced 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -78,6 +78,7 @@
typedef struct {
bool tcg_only;
const char *machine;
+ const char *arch;
const char *machine_param;
const char *variant;
const char *uefi_fl1;
@@ -262,8 +263,20 @@ static void dump_aml_files(test_data *data, bool rebuild)
g_assert(exp_sdt->aml);
if (rebuild) {
- aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+ aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir,
+ data->machine, data->arch,
sdt->aml, ext);
+
+ /*
+ * To keep test cases not failing when the DATA files are moved to
+ * ARCH under virt folder, add this check which can be removed once
+ * the DATA files are moved.
+ */
+ if (!g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+ aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+ sdt->aml, ext);
+ }
+
if (!g_file_test(aml_file, G_FILE_TEST_EXISTS) &&
sdt->aml_len == exp_sdt->aml_len &&
!memcmp(sdt->aml, exp_sdt->aml, sdt->aml_len)) {
@@ -398,8 +411,13 @@ static GArray *load_expected_aml(test_data *data)
memset(&exp_sdt, 0, sizeof(exp_sdt));
try_again:
- aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
- sdt->aml, ext);
+ aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir, data->machine,
+ data->arch, sdt->aml, ext);
+ if (!g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+ aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+ sdt->aml, ext);
+ }
+ exp_sdt.aml_file = aml_file;
if (verbosity_level >= 2) {
fprintf(stderr, "Looking for expected file '%s'\n", aml_file);
}
@@ -1561,6 +1579,7 @@ static void test_acpi_aarch64_virt_tcg_memhp(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
@@ -1654,6 +1673,7 @@ static void test_acpi_aarch64_virt_tcg_numamem(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
@@ -1676,6 +1696,7 @@ static void test_acpi_aarch64_virt_tcg_pxb(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
@@ -1749,6 +1770,7 @@ static void test_acpi_aarch64_virt_tcg_acpi_hmat(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
@@ -1905,6 +1927,7 @@ static void test_acpi_aarch64_virt_tcg(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
@@ -1924,6 +1947,7 @@ static void test_acpi_aarch64_virt_tcg_topology(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.variant = ".topology",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
@@ -2007,6 +2031,7 @@ static void test_acpi_aarch64_virt_viot(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
@@ -2139,6 +2164,7 @@ static void test_acpi_aarch64_virt_oem_fields(void)
{
test_data data = {
.machine = "virt",
+ .arch = "aarch64",
.tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
--
2.40.1
next prev parent reply other threads:[~2024-03-15 13:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 13:09 [PATCH 03/12] uefi-test-tools: Add support for python based build script Sunil V L
2024-03-15 13:09 ` [PATCH 04/12] tests/data/uefi-boot-images: Add RISC-V ISO image Sunil V L
2024-04-29 3:44 ` Alistair Francis
2024-03-15 13:09 ` [PATCH 05/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them Sunil V L
2024-04-29 3:45 ` Alistair Francis
2024-03-15 13:09 ` Sunil V L [this message]
2024-04-29 3:47 ` [PATCH 06/12] tests/qtest/bios-tables-test.c: Add support for arch in path Alistair Francis
2024-03-15 13:09 ` [PATCH 07/12] tests/data/acpi/virt: Move ACPI tables under aarch64 Sunil V L
2024-04-29 3:47 ` Alistair Francis
2024-03-15 13:09 ` [PATCH 08/12] meson.build: Add RISC-V to the edk2-target list Sunil V L
2024-04-29 3:48 ` Alistair Francis
2024-03-15 13:09 ` [PATCH 09/12] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs Sunil V L
2024-04-29 3:49 ` Alistair Francis
2024-03-15 13:09 ` [PATCH 10/12] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V Sunil V L
2024-04-29 3:52 ` Alistair Francis
2024-03-15 13:09 ` [PATCH 11/12] tests/data/acpi/virt/riscv64: Add expected ACPI tables for RISC-V Sunil V L
2024-04-29 3:52 ` Alistair Francis
2024-03-15 13:09 ` [PATCH 12/12] tests/qtest/bios-tables-test.c: Enable basic testing " Sunil V L
2024-04-29 3:53 ` Alistair Francis
2024-03-15 14:17 ` [PATCH 03/12] uefi-test-tools: Add support for python based build script Gerd Hoffmann
2024-03-18 5:25 ` Sunil V L
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240315130924.2378849-4-sunilvl@ventanamicro.com \
--to=sunilvl@ventanamicro.com \
--cc=ajones@ventanamicro.com \
--cc=alistair23@gmail.com \
--cc=anisinha@redhat.com \
--cc=apatel@ventanamicro.com \
--cc=berrange@redhat.com \
--cc=dbarboza@ventanamicro.com \
--cc=haibo1.xu@intel.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.