qemuxml2argvtest: Add negative cases for TPM version

Now that we have all the machinery needed, we can introduce two
simple test cases:

1) only TPM 1.2 is supported, but TPM 2.0 was requested in domain XML,
2) only TPM 2.0 is supported, but TPM 1.2 was requested in domain XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
Michal Privoznik 2022-08-02 10:23:42 +02:00
parent b91dbf4851
commit 67b03faaf1
3 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1 @@
unsupported configuration: TPM version '2.0' is not supported

View File

@ -0,0 +1 @@
unsupported configuration: TPM version '1.2' is not supported

View File

@ -2564,6 +2564,12 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("aarch64-tpm", "aarch64");
DO_TEST_PARSE_ERROR_NOCAPS("aarch64-tpm-wrong-model");
g_setenv(TEST_TPM_ENV_VAR, TPM_VER_2_0, true);
DO_TEST_CAPS_LATEST_PARSE_ERROR("tpm-emulator");
g_setenv(TEST_TPM_ENV_VAR, TPM_VER_1_2, true);
DO_TEST_CAPS_LATEST_PARSE_ERROR("tpm-emulator-tpm2");
unsetenv(TEST_TPM_ENV_VAR);
DO_TEST_PARSE_ERROR_NOCAPS("pci-domain-invalid");
DO_TEST_PARSE_ERROR_NOCAPS("pci-bus-invalid");
DO_TEST_PARSE_ERROR_NOCAPS("pci-slot-invalid");