Skip to content

Commit b7863ba

Browse files
pmachatakuba-moo
authored andcommitted
selftests: forwarding: lib: Split setup_wait()
setup_wait() takes an optional argument and then is called from the top level of the test script. That confuses shellcheck, which thinks that maybe the intention is to pass $1 of the script to the function, which is never the case. To avoid having to annotate every single new test with a SC disable, split the function in two: one that takes a mandatory argument, and one that takes no argument at all. Convert the two existing users of that optional argument, both in Spectrum resource selftest, to use the new form. Clean up vxlan_bridge_1q_mc_ul.sh to not pass a now-unused argument. Signed-off-by: Petr Machata <[email protected]> Link: https://patch.msgid.link/8e13123236fe3912ae29bc04a1528bdd8551da1f.1750847794.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 040ae95 commit b7863ba

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
5151
fi
5252

5353
${current_test}_setup_prepare
54-
setup_wait $num_netifs
54+
setup_wait_n $num_netifs
5555
# Update target in case occupancy of a certain resource changed
5656
# following the test setup.
5757
target=$(${current_test}_get_target "$should_fail")

tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
5555
continue
5656
fi
5757
${current_test}_setup_prepare
58-
setup_wait $num_netifs
58+
setup_wait_n $num_netifs
5959
# Update target in case occupancy of a certain resource
6060
# changed following the test setup.
6161
target=$(${current_test}_get_target "$should_fail")

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ setup_wait_dev_with_timeout()
526526
return 1
527527
}
528528

529-
setup_wait()
529+
setup_wait_n()
530530
{
531-
local num_netifs=${1:-$NUM_NETIFS}
531+
local num_netifs=$1; shift
532532
local i
533533

534534
for ((i = 1; i <= num_netifs; ++i)); do
@@ -539,6 +539,11 @@ setup_wait()
539539
sleep $WAIT_TIME
540540
}
541541

542+
setup_wait()
543+
{
544+
setup_wait_n "$NUM_NETIFS"
545+
}
546+
542547
wait_for_dev()
543548
{
544549
local dev=$1; shift

tools/testing/selftests/net/forwarding/vxlan_bridge_1q_mc_ul.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ ipv6_mcroute_fdb_sep_rx()
765765
trap cleanup EXIT
766766

767767
setup_prepare
768-
setup_wait "$NUM_NETIFS"
768+
setup_wait
769769
tests_run
770770

771771
exit "$EXIT_STATUS"

0 commit comments

Comments
 (0)