aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2020-06-15 15:50:51 +0200
committerThomas Huth <thuth@redhat.com>2020-06-15 18:26:46 +0200
commit55b9757c7e58092068d6788114b9e347406ed7f9 (patch)
tree80de940d2aaa74489218776b48c7e7134fdb1e04 /tests
parent7d3660e79830a069f1848bb4fa1cdf8f666424fb (diff)
downloadqemu-55b9757c7e58092068d6788114b9e347406ed7f9.zip
qemu-55b9757c7e58092068d6788114b9e347406ed7f9.tar.gz
qemu-55b9757c7e58092068d6788114b9e347406ed7f9.tar.bz2
bios-tables-test: Fix "-tpmdev: invalid option"
When configure is run with "--disable-tpm", the bios-tables-test q35/tis test fails with "-tpmdev: invalid option". Skip the test if CONFIG_TPM is unset. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200615135051.2213-1-eric.auger@redhat.com> Tested-by: Stefan Berger <stefanb@linux.ibm.com> Fixes: 5da7c35e25 ("bios-tables-test: Add Q35/TPM-TIS test") Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/bios-tables-test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 53f104a..b482f76 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -882,6 +882,7 @@ uint64_t tpm_tis_base_addr;
static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
uint64_t base)
{
+#ifdef CONFIG_TPM
gchar *tmp_dir_name = g_strdup_printf("qemu-test_acpi_%s_tcg_%s.XXXXXX",
machine, tpm_if);
char *tmp_path = g_dir_make_tmp(tmp_dir_name, NULL);
@@ -924,6 +925,9 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
g_free(tmp_path);
g_free(tmp_dir_name);
free_test_data(&data);
+#else
+ g_test_skip("TPM disabled");
+#endif
}
static void test_acpi_q35_tcg_tpm_tis(void)