[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/12] tests/qtest/bios-tables-test.c: Add support for arch in pa
From: |
Sunil V L |
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 |
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
- [PATCH 03/12] uefi-test-tools: Add support for python based build script, Sunil V L, 2024/03/15
- [PATCH 05/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them, Sunil V L, 2024/03/15
- [PATCH 04/12] tests/data/uefi-boot-images: Add RISC-V ISO image, Sunil V L, 2024/03/15
- [PATCH 09/12] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs, Sunil V L, 2024/03/15
- [PATCH 08/12] meson.build: Add RISC-V to the edk2-target list, Sunil V L, 2024/03/15
- [PATCH 10/12] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V, Sunil V L, 2024/03/15
- [PATCH 06/12] tests/qtest/bios-tables-test.c: Add support for arch in path,
Sunil V L <=
- [PATCH 07/12] tests/data/acpi/virt: Move ACPI tables under aarch64, Sunil V L, 2024/03/15
- [PATCH 11/12] tests/data/acpi/virt/riscv64: Add expected ACPI tables for RISC-V, Sunil V L, 2024/03/15
- [PATCH 12/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V, Sunil V L, 2024/03/15
- Re: [PATCH 03/12] uefi-test-tools: Add support for python based build script, Gerd Hoffmann, 2024/03/15