[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250924230413.75246-1-alessandro.zanni87@gmail.com>
Date: Thu, 25 Sep 2025 01:04:07 +0200
From: Alessandro Zanni <alessandro.zanni87@...il.com>
To: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
horms@...nel.org,
shuah@...nel.org
Cc: Alessandro Zanni <alessandro.zanni87@...il.com>,
netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] selftest: net: Fix error message if empty variable
Fix to avoid cases where the `res` shell variable is
empty in script comparisons.
The issue can be reproduced with the command:
make kselftest TARGETS=net
It solves the error:
./tfo_passive.sh: line 98: [: -eq: unary operator expected
Signed-off-by: Alessandro Zanni <alessandro.zanni87@...il.com>
---
tools/testing/selftests/net/tfo_passive.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/tfo_passive.sh b/tools/testing/selftests/net/tfo_passive.sh
index 80bf11fdc046..2655931b2396 100755
--- a/tools/testing/selftests/net/tfo_passive.sh
+++ b/tools/testing/selftests/net/tfo_passive.sh
@@ -95,7 +95,7 @@ wait
res=$(cat $out_file)
rm $out_file
-if [ $res -eq 0 ]; then
+if [ -n "$res" ] && [ $res -eq 0 ]; then
echo "got invalid NAPI ID from passive TFO socket"
cleanup_ns
exit 1
--
2.43.0
Powered by blists - more mailing lists