mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
tests: Use QMP to check whether a TPM device model is available
Use QMP to check whether a given TPM device model is available and if it is not the case then do not register the tests that require it. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20210802215246.1433175-9-stefanb@linux.ibm.com
This commit is contained in:
parent
343776a685
commit
58edc32cfc
3 changed files with 43 additions and 5 deletions
|
@ -1094,7 +1094,6 @@ uint64_t tpm_tis_base_addr;
|
|||
static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
|
||||
uint64_t base, enum TPMVersion tpm_version)
|
||||
{
|
||||
#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);
|
||||
|
@ -1140,9 +1139,6 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
|
|||
g_free(tmp_dir_name);
|
||||
g_free(args);
|
||||
free_test_data(&data);
|
||||
#else
|
||||
g_test_skip("TPM disabled");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void test_acpi_q35_tcg_tpm_tis(void)
|
||||
|
@ -1518,7 +1514,9 @@ int main(int argc, char *argv[])
|
|||
return ret;
|
||||
}
|
||||
qtest_add_func("acpi/q35/oem-fields", test_acpi_oem_fields_q35);
|
||||
qtest_add_func("acpi/q35/tpm-tis", test_acpi_q35_tcg_tpm_tis);
|
||||
if (tpm_model_is_available("-machine q35", "tpm-tis")) {
|
||||
qtest_add_func("acpi/q35/tpm2-tis", test_acpi_q35_tcg_tpm_tis);
|
||||
}
|
||||
qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
|
||||
qtest_add_func("acpi/oem-fields", test_acpi_oem_fields_pc);
|
||||
qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue