From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PwpeICCg; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id D73325A0271 for ; Fri, 26 Sep 2025 08:16:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758867365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jL1/epE/Rr9nMU3jk31SyhHrFIrO3q3MMFe2eSTYyoA=; b=PwpeICCgFsmEk695ZyYpvyH3raV3tzYypI4eykm5vQu5OjNMvdyuvzD2W5A5LBdHh+xN4Z 4ZmN0oJRs7o5a5XSxh32b/ZsTZct36JMcvvPb1L3QAnWdghm9cr9NyebE/9U3ezAtgkY0a KTDK2mbv2E/6ElAssNkNuqdcrn7rauQ= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-t0h6KJsFMzShoJ_MP5Q25A-1; Fri, 26 Sep 2025 02:16:02 -0400 X-MC-Unique: t0h6KJsFMzShoJ_MP5Q25A-1 X-Mimecast-MFC-AGG-ID: t0h6KJsFMzShoJ_MP5Q25A_1758867361 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8C39F19560BB; Fri, 26 Sep 2025 06:16:00 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.72.112.110]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 593241800579; Fri, 26 Sep 2025 06:15:56 +0000 (UTC) From: Yumei Huang To: passt-dev@passt.top, sbrivio@redhat.com Subject: [PATCH] test: Update lib/term for clearer output when DEBUG is enabled Date: Fri, 26 Sep 2025 14:15:53 +0800 Message-ID: <20250926061553.16039-1-yuhuang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: qffJvqimOovqWRfcQdFQKr16W6YkNSzPmm9oakrnMM0_1758867361 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: JDTNNBQL7Q6E2R32HE4RSJKSOOT4PR4N X-Message-ID-Hash: JDTNNBQL7Q6E2R32HE4RSJKSOOT4PR4N X-MailFrom: yuhuang@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: david@gibson.dropbear.id.au, yuhuang@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Signed-off-by: Yumei Huang --- 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