2 # SPDX-License-Identifier: GPL-2.0
4 lib_dir=$(dirname $0)/../../../../net/forwarding
8 source $lib_dir/tc_common.sh
9 source devlink_lib_spectrum.sh
16 if [ ! -z $current_test ]; then
17 ${current_test}_cleanup
19 devlink_sp_size_kvd_to_default
22 devlink_sp_read_kvd_defaults
35 for current_test in ${TESTS:-$ALL_TESTS}; do
37 source ${current_test}_scale.sh
39 num_netifs_var=${current_test^^}_NUM_NETIFS
40 num_netifs=${!num_netifs_var:-$NUM_NETIFS}
42 for profile in $KVD_PROFILES; do
44 devlink_sp_resource_kvd_profile_set $profile
45 if [[ $RET -gt 0 ]]; then
46 log_test "'$current_test' [$profile] setting"
50 for should_fail in 0 1; do
52 target=$(${current_test}_get_target "$should_fail")
53 if ((target == 0)); then
54 log_test_skip "'$current_test' [$profile] should_fail=$should_fail test"
57 ${current_test}_setup_prepare
58 setup_wait $num_netifs
59 # Update target in case occupancy of a certain resource
60 # changed following the test setup.
61 target=$(${current_test}_get_target "$should_fail")
62 ${current_test}_test "$target" "$should_fail"
63 if [[ "$should_fail" -eq 0 ]]; then
64 log_test "'$current_test' [$profile] $target"
67 tt=${current_test}_traffic_test
68 if [[ $(type -t $tt) == "function" ]]
71 log_test "'$current_test' [$profile] $target traffic test"
75 log_test "'$current_test' [$profile] overflow $target"
77 ${current_test}_cleanup $target
78 RET_FIN=$(( RET_FIN || RET ))