[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/18] tests: support QTEST_TRACE env variable
From: |
Daniel P . Berrangé |
Subject: |
[PATCH 03/18] tests: support QTEST_TRACE env variable |
Date: |
Wed, 2 Mar 2022 17:49:17 +0000 |
When debugging failing qtests it is useful to be able to turn on trace
output to stderr. The QTEST_TRACE env variable contents get injected
as a '-trace <str>' command line arg
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tests/qtest/libqtest.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 41f4da4e54..a85f8a6d05 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -260,6 +260,9 @@ QTestState *qtest_init_without_qmp_handshake(const char
*extra_args)
gchar *qmp_socket_path;
gchar *command;
const char *qemu_binary = qtest_qemu_binary();
+ const char *trace = g_getenv("QTEST_TRACE");
+ g_autofree char *tracearg = trace ?
+ g_strdup_printf("-trace %s ", trace) : g_strdup("");
s = g_new(QTestState, 1);
@@ -282,14 +285,15 @@ QTestState *qtest_init_without_qmp_handshake(const char
*extra_args)
qtest_add_abrt_handler(kill_qemu_hook_func, s);
- command = g_strdup_printf("exec %s "
+ command = g_strdup_printf("exec %s %s"
"-qtest unix:%s "
"-qtest-log %s "
"-chardev socket,path=%s,id=char0 "
"-mon chardev=char0,mode=control "
"-display none "
"%s"
- " -accel qtest", qemu_binary, socket_path,
+ " -accel qtest",
+ qemu_binary, tracearg, socket_path,
getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
qmp_socket_path,
extra_args ?: "");
--
2.34.1
- [PATCH 00/18] tests: introduce testing coverage for TLS with migration, Daniel P . Berrangé, 2022/03/02
- [PATCH 01/18] tests: fix encoding of IP addresses in x509 certs, Daniel P . Berrangé, 2022/03/02
- [PATCH 02/18] tests: improve error message when saving TLS PSK file fails, Daniel P . Berrangé, 2022/03/02
- [PATCH 03/18] tests: support QTEST_TRACE env variable,
Daniel P . Berrangé <=
- [PATCH 05/18] tests: add more helper macros for creating TLS x509 certs, Daniel P . Berrangé, 2022/03/02
- [PATCH 06/18] crypto: mandate a hostname when checking x509 creds on a client, Daniel P . Berrangé, 2022/03/02
- [PATCH 07/18] migration: fix use of TLS PSK credentials with a UNIX socket, Daniel P . Berrangé, 2022/03/02
- [PATCH 08/18] tests: merge code for UNIX and TCP migration pre-copy tests, Daniel P . Berrangé, 2022/03/02