From: Yumei Huang <yuhuang@redhat.com>
To: passt-dev@passt.top, sbrivio@redhat.com
Cc: david@gibson.dropbear.id.au, yuhuang@redhat.com
Subject: [PATCH] test: Update lib/term for clearer output when DEBUG is enabled
Date: Fri, 26 Sep 2025 14:15:53 +0800 [thread overview]
Message-ID: <20250926061553.16039-1-yuhuang@redhat.com> (raw)
When running tests with DEBUG=1, we used to get some
"DEBUG:DEBUG:DEBUG:" in logs, which is not very helpful for
debugging.
With this patch, the log would show the steps like below:
DEBUG: g1tools ip jq dhclient socat cat
DEBUG: htools ip jq
DEBUG:
DEBUG: set MAP_HOST4 192.0.2.1
DEBUG: set MAP_HOST6 2001:db8:9a55::1
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Yumei Huang <yuhuang@redhat.com>
---
test/lib/term | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/test/lib/term b/test/lib/term
index 089364c..6400746 100755
--- a/test/lib/term
+++ b/test/lib/term
@@ -32,29 +32,29 @@ PR_DELAY_INIT=100 # ms
# $@: Message to print
info() {
tmux select-pane -t ${PANE_INFO}
- printf "${@}\n" >> $STATEBASE/log_pipe
- printf "${@}\n" >> "${LOGFILE}"
+ printf "${*}\n" >> $STATEBASE/log_pipe
+ printf "${*}\n" >> "${LOGFILE}"
}
# info_n() - Highlight, print message to pane and to log file without newline
# $@: Message to print
info_n() {
tmux select-pane -t ${PANE_INFO}
- printf "${@}" >> $STATEBASE/log_pipe
- printf "${@}" >> "${LOGFILE}"
+ printf "${*}" >> $STATEBASE/log_pipe
+ printf "${*}" >> "${LOGFILE}"
}
# info_nolog() - Highlight test log pane, print message to it
# $@: Message to print
info_nolog() {
tmux select-pane -t ${PANE_INFO}
- printf "${@}\n" >> $STATEBASE/log_pipe
+ printf "${*}\n" >> $STATEBASE/log_pipe
}
# info_nolog() - Print message to log file
# $@: Message to print
log() {
- printf "${@}\n" >> "${LOGFILE}"
+ printf "${*}\n" >> "${LOGFILE}"
}
# info_nolog_n() - Send message to pane without highlighting it, without newline
@@ -363,8 +363,8 @@ status_test_start() {
info_check() {
switch_pane ${PANE_INFO}
- printf "${PR_YELLOW}?${PR_NC} ${@}" >> $STATEBASE/log_pipe
- printf "? ${@}" >> "${LOGFILE}"
+ printf "${PR_YELLOW}?${PR_NC} ${*}" >> $STATEBASE/log_pipe
+ printf "? ${*}" >> "${LOGFILE}"
}
# info_check_passed() - Display and log a new line when a check passes
--
2.47.0
next reply other threads:[~2025-09-26 6:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 6:15 Yumei Huang [this message]
2025-09-26 6:23 ` Stefano Brivio
2025-09-26 6:23 ` David Gibson
2025-09-26 12:37 ` Stefano Brivio
2025-09-28 1:40 ` Yumei Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250926061553.16039-1-yuhuang@redhat.com \
--to=yuhuang@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).