bios-tables-test: Fix "-tpmdev: invalid option"
PATCH 1/1 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.
--- tests/qtest/bios-tables-test.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/qtest/bios-tables-test.c +4 -0
@@ -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 )
Signature · 1 line
2.20.1
Quoted 7 lines · Eric Auger
When configure is run with "--disable-tpm", the bios-tables-test q35/tis test fails with "-tpmdev: invalid option".
Skip the test if
CONFIG_TPMis unset.Signed-off-by Eric Auger <[email protected]>Reported-by Philippe Mathieu-Daudé <[email protected]>
Quoted 26 lines
--- tests/qtest/bios-tables-test.c | 4 ++++ 1 file changed, 4 insertions(+)tests/qtest/bios-tables-test.c +4
-0@@ -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 )
Quoted 25 lines · Eric Auger
When configure is run with "--disable-tpm", the bios-tables-test q35/tis test fails with "-tpmdev: invalid option".
Skip the test if
CONFIG_TPMis unset.Signed-off-by Eric Auger <[email protected]>Reported-by Philippe Mathieu-Daudé <[email protected]>--- tests/qtest/bios-tables-test.c | 4 ++++ 1 file changed, 4 insertions(+)tests/qtest/bios-tables-test.c +1
-0@@ -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 );
tests/qtest/bios-tables-test.c static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if, · line 933
Quoted 9 lines
tests/qtest/bios-tables-test.c +3
-0@@ -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 )
This is simpler than Thomas' version.
Thomas Huth
Reviewed-byQuoted 33 lines · Philippe Mathieu-Daudé
Quoted 32 lines · Eric Auger
When configure is run with "--disable-tpm", the bios-tables-test q35/tis test fails with "-tpmdev: invalid option".
Skip the test if
CONFIG_TPMis unset.Signed-off-by Eric Auger <[email protected]>Reported-by Philippe Mathieu-Daudé <[email protected]>--- tests/qtest/bios-tables-test.c | 4 ++++ 1 file changed, 4 insertions(+)tests/qtest/bios-tables-test.c +4
-0@@ -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 }
Quoted 8 lines
tests/qtest/bios-tables-test.c static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if, · line 933
Quoted 2 lines
tests/qtest/bios-tables-test.c +0
-0static void test_acpi_q35_tcg_tpm_tis (void )This is simpler than Thomas' version.
Fixes 5da7c35e25 ("bios-tables-test: Add Q35/TPM-TIS test")Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Your version is indeed nicer than mine, so let's use yours!