staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / drivers / net / mlxsw / spectrum / resource_scale.sh
blob43ba1b438f6dbad35bdcb3b65b494f7addd25025
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 lib_dir=$(dirname $0)/../../../../net/forwarding
6 NUM_NETIFS=6
7 source $lib_dir/lib.sh
8 source $lib_dir/tc_common.sh
9 source devlink_lib_spectrum.sh
11 current_test=""
13 cleanup()
15 pre_cleanup
16 if [ ! -z $current_test ]; then
17 ${current_test}_cleanup
19 devlink_sp_size_kvd_to_default
22 devlink_sp_read_kvd_defaults
23 trap cleanup EXIT
25 ALL_TESTS="router tc_flower mirror_gre"
26 for current_test in ${TESTS:-$ALL_TESTS}; do
27 source ${current_test}_scale.sh
29 num_netifs_var=${current_test^^}_NUM_NETIFS
30 num_netifs=${!num_netifs_var:-$NUM_NETIFS}
32 for profile in $KVD_PROFILES; do
33 RET=0
34 devlink_sp_resource_kvd_profile_set $profile
35 if [[ $RET -gt 0 ]]; then
36 log_test "'$current_test' [$profile] setting"
37 continue
40 for should_fail in 0 1; do
41 RET=0
42 target=$(${current_test}_get_target "$should_fail")
43 ${current_test}_setup_prepare
44 setup_wait $num_netifs
45 ${current_test}_test "$target" "$should_fail"
46 ${current_test}_cleanup
47 if [[ "$should_fail" -eq 0 ]]; then
48 log_test "'$current_test' [$profile] $target"
49 else
50 log_test "'$current_test' [$profile] overflow $target"
52 done
53 done
54 done
55 current_test=""
57 exit "$RET"