diff mbox series

[net-next] selftests: Declare local variable for pause in fcnal-test.sh

Message ID 20240130154327.33848-1-dsahern@kernel.org (mailing list archive)
State Accepted
Commit e79027c08302e299571555a9606b751820afa409
Delegated to: Netdev Maintainers
Headers show
Series [net-next] selftests: Declare local variable for pause in fcnal-test.sh | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 1 this patch: 0
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-01-31--06-00 (tests: 715)

Commit Message

David Ahern Jan. 30, 2024, 3:43 p.m. UTC
Running fcnal-test.sh script with -P argument is causing test failures:

  $ ./fcnal-test.sh -t ping -P
  TEST: ping out - ns-B IP                                       [ OK ]

  hit enter to continue, 'q' to quit

  fcnal-test.sh: line 106: [: ping: integer expression expected
  TEST: out,                                                     [FAIL]
      expected rc ping; actual rc 0

  hit enter to continue, 'q' to quit

The test functions use local variable 'a' for addresses and
then log_test is also using 'a' without a local declaration.
Fix by declaring a local variable and using 'ans' (for answer)
in the read.

Signed-off-by: David Ahern <dsahern@kernel.org>
---
 tools/testing/selftests/net/fcnal-test.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 1, 2024, 5:20 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 30 Jan 2024 08:43:27 -0700 you wrote:
> Running fcnal-test.sh script with -P argument is causing test failures:
> 
>   $ ./fcnal-test.sh -t ping -P
>   TEST: ping out - ns-B IP                                       [ OK ]
> 
>   hit enter to continue, 'q' to quit
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: Declare local variable for pause in fcnal-test.sh
    https://git.kernel.org/netdev/net-next/c/e79027c08302

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index d7cfb7c2b427..386ebd829df5 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -100,6 +100,7 @@  log_test()
 	local rc=$1
 	local expected=$2
 	local msg="$3"
+	local ans
 
 	[ "${VERBOSE}" = "1" ] && echo
 
@@ -113,16 +114,16 @@  log_test()
 		if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
 			echo
 			echo "hit enter to continue, 'q' to quit"
-			read a
-			[ "$a" = "q" ] && exit 1
+			read ans
+			[ "$ans" = "q" ] && exit 1
 		fi
 	fi
 
 	if [ "${PAUSE}" = "yes" ]; then
 		echo
 		echo "hit enter to continue, 'q' to quit"
-		read a
-		[ "$a" = "q" ] && exit 1
+		read ans
+		[ "$ans" = "q" ] && exit 1
 	fi
 
 	kill_procs