Skip to content

Commit 0a66c52

Browse files
author
CKI Backport Bot
committed
selftests: net: lib: fix shift count out of range
JIRA: https://issues.redhat.com/browse/RHEL-115594 commit 47c8499 Author: Hangbin Liu <liuhangbin@gmail.com> Date: Wed Jul 9 09:12:44 2025 +0000 selftests: net: lib: fix shift count out of range I got the following warning when writing other tests: + handle_test_result_pass 'bond 802.3ad' '(lacp_active off)' + local 'test_name=bond 802.3ad' + shift + local 'opt_str=(lacp_active off)' + shift + log_test_result 'bond 802.3ad' '(lacp_active off)' ' OK ' + local 'test_name=bond 802.3ad' + shift + local 'opt_str=(lacp_active off)' + shift + local 'result= OK ' + shift + local retmsg= + shift /net/tools/testing/selftests/net/forwarding/../lib.sh: line 315: shift: shift count out of range This happens because an extra shift is executed even after all arguments have been consumed. Remove the last shift in log_test_result() to avoid this warning. Fixes: a923af1 ("selftests: forwarding: Convert log_test() to recognize RET values") Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Link: https://patch.msgid.link/20250709091244.88395-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 540abc9 commit 0a66c52

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/net

1 file changed

+1
-1
lines changed

tools/testing/selftests/net/lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ log_test_result()
263263
local test_name=$1; shift
264264
local opt_str=$1; shift
265265
local result=$1; shift
266-
local retmsg=$1; shift
266+
local retmsg=$1
267267

268268
printf "TEST: %-60s [%s]\n" "$test_name $opt_str" "$result"
269269
if [[ $retmsg ]]; then

0 commit comments

Comments
 (0)