1#!/bin/bash 2# SPDX-License-Identifier: GPL-2.0 3 4lib_dir=$(dirname $0)/../../../../net/forwarding 5 6NUM_NETIFS=6 7source $lib_dir/lib.sh 8source $lib_dir/tc_common.sh 9source $lib_dir/devlink_lib.sh 10 11current_test="" 12 13cleanup() 14{ 15 pre_cleanup 16 if [ ! -z $current_test ]; then 17 ${current_test}_cleanup 18 fi 19} 20 21trap cleanup EXIT 22 23ALL_TESTS="mirror_gre" 24for current_test in ${TESTS:-$ALL_TESTS}; do 25 source ${current_test}_scale.sh 26 27 num_netifs_var=${current_test^^}_NUM_NETIFS 28 num_netifs=${!num_netifs_var:-$NUM_NETIFS} 29 30 for should_fail in 0 1; do 31 RET=0 32 target=$(${current_test}_get_target "$should_fail") 33 ${current_test}_setup_prepare 34 setup_wait $num_netifs 35 ${current_test}_test "$target" "$should_fail" 36 ${current_test}_cleanup 37 if [[ "$should_fail" -eq 0 ]]; then 38 log_test "'$current_test' $target" 39 else 40 log_test "'$current_test' overflow $target" 41 fi 42 done 43done 44current_test="" 45 46exit "$RET" 47