[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] qtest/bios-tables-test: Make test build-independent from acc
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 3/6] qtest/bios-tables-test: Make test build-independent from accelerator |
Date: |
Fri, 12 Mar 2021 00:11:59 +0100 |
Now than we can probe if the TCG accelerator is available
at runtime with a QMP command, we can remove the #ifdef'ry.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/qtest/bios-tables-test.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index e020c83d2a5..73378f9da94 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -718,15 +718,13 @@ static void test_acpi_one(const char *params, test_data
*data)
char *args;
bool use_uefi = data->uefi_fl1 && data->uefi_fl2;
-#ifndef CONFIG_TCG
- if (data->tcg_only) {
- g_test_skip("TCG disabled, skipping ACPI tcg_only test");
- return;
- }
-#endif /* CONFIG_TCG */
-
args = test_acpi_create_args(data, params, use_uefi);
data->qts = qtest_init(args);
+ if (data->tcg_only && !qtest_probe_accel(data->qts, "tcg")) {
+ g_test_skip("TCG not available, skipping test");
+ goto done;
+ }
+
test_acpi_load_tables(data, use_uefi);
if (getenv(ACPI_REBUILD_EXPECTED_AML)) {
@@ -745,6 +743,7 @@ static void test_acpi_one(const char *params, test_data
*data)
test_smbios_structs(data);
}
+done:
qtest_quit(data->qts);
g_free(args);
}
--
2.26.2
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, (continued)
[PATCH 2/6] tests/qtest: Add qtest_probe_accel() method, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 4/6] qtest/arm-cpu-features: Check KVM availability at runtime, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 3/6] qtest/bios-tables-test: Make test build-independent from accelerator,
Philippe Mathieu-Daudé <=
[PATCH 5/6] qtest/arm-cpu-features: Check TCG availability at runtime, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 6/6] tests/qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore, Philippe Mathieu-Daudé, 2021/03/11