[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent
From: |
Alex Bennée |
Subject: |
Re: [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent from accelerator |
Date: |
Fri, 30 Apr 2021 16:35:34 +0100 |
User-agent: |
mu4e 1.5.12; emacs 28.0.50 |
Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> Now than we can probe if the TCG accelerator is available
> at runtime with a QMP command, do it once at the beginning
> and only register the tests we can run.
> We can then replace the #ifdef'ry by an assertion.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Since v1: use global tcg_accel_available, call qtest_has_accel() once
> ---
> tests/qtest/bios-tables-test.c | 99 ++++++++++++++++++----------------
> 1 file changed, 52 insertions(+), 47 deletions(-)
>
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index 156d4174aa3..a4c7bddf6f3 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -97,6 +97,7 @@ typedef struct {
> QTestState *qts;
> } test_data;
>
> +static bool tcg_accel_available;
> static char disk[] = "tests/acpi-test-disk-XXXXXX";
> static const char *data_dir = "tests/data/acpi";
> #ifdef CONFIG_IASL
> @@ -718,15 +719,11 @@ 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 */
> + assert(!data->tcg_only || tcg_accel_available);
I find it odd that we need TCG here (especially on an x86 system) to
test what are essentially device models we use in KVM. On the other hand
it maintains the current effect with less ifdef hacks so:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
- [PATCH v4 05/12] qtest/arm-cpu-features: Restrict sve_tests_sve_off_kvm test to KVM, (continued)
- [PATCH v4 05/12] qtest/arm-cpu-features: Restrict sve_tests_sve_off_kvm test to KVM, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 06/12] qtest/arm-cpu-features: Remove TCG fallback to KVM specific tests, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 07/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for TCG, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent from accelerator, Philippe Mathieu-Daudé, 2021/04/15
- Re: [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent from accelerator,
Alex Bennée <=
- [PATCH v4 09/12] qtest/migration-test: Skip tests if KVM not builtin on s390x/ppc64, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 10/12] qtest/qmp-cmd-test: Make test build-independent from accelerator, Philippe Mathieu-Daudé, 2021/04/15