From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Subject: [iptables PATCH 2/5] tests: shell: Print escape sequences with terminals only
Date: Wed, 6 Nov 2024 17:42:29 +0100 [thread overview]
Message-ID: <20241106164232.3384-2-phil@nwl.cc> (raw)
In-Reply-To: <20241106164232.3384-1-phil@nwl.cc>
If stdout is not a terminal, don't print the '[EXECUTING]' status line
which has to be cleared again.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
iptables/tests/shell/run-tests.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/iptables/tests/shell/run-tests.sh b/iptables/tests/shell/run-tests.sh
index 2ad259c21644c..565b654e9f134 100755
--- a/iptables/tests/shell/run-tests.sh
+++ b/iptables/tests/shell/run-tests.sh
@@ -165,7 +165,7 @@ do_test() {
rc_spec=`echo $(basename ${testfile}) | cut -d _ -f2-`
- msg_info "[EXECUTING] $testfile"
+ [ -t 1 ] && msg_info "[EXECUTING] $testfile"
if [ "$VERBOSE" = "y" ]; then
XT_MULTI=$xtables_multi unshare -n ${testfile}
@@ -173,7 +173,7 @@ do_test() {
else
XT_MULTI=$xtables_multi unshare -n ${testfile} > /dev/null 2>&1
rc_got=$?
- echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
+ [ -t 1 ] && echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
fi
if [ "$rc_got" == "$rc_spec" ] ; then
--
2.47.0
next prev parent reply other threads:[~2024-11-06 16:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 16:42 [iptables PATCH 1/5] tests: shell: iptables/0010-wait_0 is unreliable Phil Sutter
2024-11-06 16:42 ` Phil Sutter [this message]
2024-11-06 16:42 ` [iptables PATCH 3/5] tests: iptables-test: Fix for 'make distcheck' Phil Sutter
2024-11-06 16:42 ` [iptables PATCH 4/5] tests: xlate-test: " Phil Sutter
2024-11-06 16:42 ` [iptables PATCH 5/5] Makefile.am: Revert to old serial test harness Phil Sutter
2024-11-06 17:13 ` [iptables PATCH 1/5] tests: shell: iptables/0010-wait_0 is unreliable Phil Sutter
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=20241106164232.3384-2-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox