From: Alessandro Zanni Date: Thu, 25 Sep 2025 13:28:23 +0000 (+0200) Subject: selftest: net: Fix error message if empty variable X-Git-Tag: v6.17.8~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=285e43849f7f64420c28e835f12b9876376e9be4;p=thirdparty%2Fkernel%2Fstable.git selftest: net: Fix error message if empty variable [ Upstream commit 81dcfdd21dbd7067068c7c341ee448c3f0d6f115 ] Fix to avoid cases where the `res` shell variable is empty in script comparisons. The comparison has been modified into string comparison to handle other possible values the variable could assume. 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 Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250925132832.9828-1-alessandro.zanni87@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- diff --git a/tools/testing/selftests/net/tfo_passive.sh b/tools/testing/selftests/net/tfo_passive.sh index 80bf11fdc0462..a4550511830a9 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 [ "$res" = "0" ]; then echo "got invalid NAPI ID from passive TFO socket" cleanup_ns exit 1