lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b989bb17303518eb149064a6aaaa1c37d2b703c4.1633520807.git.cdleonard@gmail.com>
Date:   Wed,  6 Oct 2021 14:47:22 +0300
From:   Leonard Crestez <cdleonard@...il.com>
To:     Jakub Kicinski <kuba@...nel.org>, Shuah Khan <shuah@...nel.org>,
        David Ahern <dsahern@...nel.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Ido Schimmel <idosch@...dia.com>,
        Seth David Schoen <schoen@...alty.org>,
        netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 06/11] selftests: net/fcnal: Do not capture do_run_cmd in verbose mode

This way running with -v will show interspersed output from both nettest
client and server. This helps to identify the order of events.

It is also required in order to make nettest fork in the background by
itself because shell capturing does not stop if the target forks.

This also fixes SC2166 warning:
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.

Signed-off-by: Leonard Crestez <cdleonard@...il.com>
---
 tools/testing/selftests/net/fcnal-test.sh | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index b7fda51deb3f..09cb35e16219 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -189,21 +189,19 @@ kill_procs()
 	done
 }
 
 do_run_cmd()
 {
-	local cmd="$*"
-	local out
+	local rc cmd="$*"
 
-	if [ "$VERBOSE" = "1" ]; then
+	if [[ "$VERBOSE" = "1" ]]; then
 		echo "COMMAND: ${cmd}"
-	fi
-
-	out=$($cmd 2>&1)
-	rc=$?
-	if [ "$VERBOSE" = "1" -a -n "$out" ]; then
-		echo "$out"
+		$cmd
+		rc=$?
+	else
+		$cmd &> /dev/null
+		rc=$?
 	fi
 
 	return $rc
 }
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ