Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <petrm@nvidia.com>
Link: https://patch.msgid.link/8e13123236fe3912ae29bc04a1528bdd8551da1f.1750847794.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Petr Machata and committed by
Jakub Kicinski
b7863bab 040ae95a

+10 -5
+1 -1
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
··· 51 51 fi 52 52 53 53 ${current_test}_setup_prepare 54 - setup_wait $num_netifs 54 + setup_wait_n $num_netifs 55 55 # Update target in case occupancy of a certain resource changed 56 56 # following the test setup. 57 57 target=$(${current_test}_get_target "$should_fail")
+1 -1
tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
··· 55 55 continue 56 56 fi 57 57 ${current_test}_setup_prepare 58 - setup_wait $num_netifs 58 + setup_wait_n $num_netifs 59 59 # Update target in case occupancy of a certain resource 60 60 # changed following the test setup. 61 61 target=$(${current_test}_get_target "$should_fail")
+7 -2
tools/testing/selftests/net/forwarding/lib.sh
··· 526 526 return 1 527 527 } 528 528 529 - setup_wait() 529 + setup_wait_n() 530 530 { 531 - local num_netifs=${1:-$NUM_NETIFS} 531 + local num_netifs=$1; shift 532 532 local i 533 533 534 534 for ((i = 1; i <= num_netifs; ++i)); do ··· 537 537 538 538 # Make sure links are ready. 539 539 sleep $WAIT_TIME 540 + } 541 + 542 + setup_wait() 543 + { 544 + setup_wait_n "$NUM_NETIFS" 540 545 } 541 546 542 547 wait_for_dev()
+1 -1
tools/testing/selftests/net/forwarding/vxlan_bridge_1q_mc_ul.sh
··· 765 765 trap cleanup EXIT 766 766 767 767 setup_prepare 768 - setup_wait "$NUM_NETIFS" 768 + setup_wait 769 769 tests_run 770 770 771 771 exit "$EXIT_STATUS"