diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2018-05-30 14:31:12 -0400 |
---|---|---|
committer | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2018-06-06 15:44:07 -0400 |
commit | ea71a3369164685d4daeeeac9dfe85a64eeeb877 (patch) | |
tree | 5e1296cc5caa3b4f10d1ce47609b7a0927bd735c /tests/tpm-tests.c | |
parent | 2b4ccb87ec498184de50068f840eec7426d5da2a (diff) |
test: Pass TPM interface model to functions creating command line
Pass the TPM interface model, such as 'tpm-crb', through to the functions
that create the command line for QEMU.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'tests/tpm-tests.c')
-rw-r--r-- | tests/tpm-tests.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/tpm-tests.c b/tests/tpm-tests.c index adf2c618c8..10c6592aac 100644 --- a/tests/tpm-tests.c +++ b/tests/tpm-tests.c @@ -18,7 +18,8 @@ #include "libqtest.h" #include "tpm-tests.h" -void tpm_test_swtpm_test(const char *src_tpm_path, tx_func *tx) +void tpm_test_swtpm_test(const char *src_tpm_path, tx_func *tx, + const char *ifmodel) { char *args = NULL; QTestState *s; @@ -36,8 +37,8 @@ void tpm_test_swtpm_test(const char *src_tpm_path, tx_func *tx) args = g_strdup_printf( "-chardev socket,id=chr,path=%s " "-tpmdev emulator,id=dev,chardev=chr " - "-device tpm-crb,tpmdev=dev", - addr->u.q_unix.path); + "-device %s,tpmdev=dev", + addr->u.q_unix.path, ifmodel); s = qtest_start(args); g_free(args); @@ -64,7 +65,8 @@ void tpm_test_swtpm_test(const char *src_tpm_path, tx_func *tx) void tpm_test_swtpm_migration_test(const char *src_tpm_path, const char *dst_tpm_path, - const char *uri, tx_func *tx) + const char *uri, tx_func *tx, + const char *ifmodel) { gboolean succ; GPid src_tpm_pid, dst_tpm_pid; @@ -87,7 +89,8 @@ void tpm_test_swtpm_migration_test(const char *src_tpm_path, } tpm_util_migration_start_qemu(&src_qemu, &dst_qemu, - src_tpm_addr, dst_tpm_addr, uri); + src_tpm_addr, dst_tpm_addr, uri, + ifmodel); tpm_util_startup(src_qemu, tx); tpm_util_pcrextend(src_qemu, tx); |