2 # SPDX-License-Identifier: GPL-2.0
4 readonly SERVER_MAC="aa:00:00:00:00:02"
5 readonly CLIENT_MAC="aa:00:00:00:00:01"
6 readonly TESTS=("data" "ack" "flags" "tcp" "ip" "large")
7 readonly PROTOS=("ipv4" "ipv6")
17 local ARGS=( "--${protocol}" "--dmac" "${SERVER_MAC}" \
18 "--smac" "${CLIENT_MAC}" "--test" "${test}" "--verbose" )
21 # Each test is run 3 times to deflake, because given the receive timing,
22 # not all packets that should coalesce will be considered in the same flow
24 for tries in {1..3}; do
25 # Actual test starts here
26 ip netns exec $server_ns ./gro "${ARGS[@]}" "--rx" "--iface" "server" \
29 sleep 0.5 # to allow for socket init
30 ip netns exec $client_ns ./gro "${ARGS[@]}" "--iface" "client" \
34 if [[ ${test} == "large" && -n "${KSFT_MACHINE_SLOW}" && \
35 ${exit_code} -ne 0 ]]; then
36 echo "Ignoring errors due to slow environment" 1>&2
39 if [[ "${exit_code}" -eq 0 ]]; then
49 for proto in "${PROTOS[@]}"; do
50 for test in "${TESTS[@]}"; do
51 echo "running test ${proto} ${test}" >&2
52 exit_code=$(run_test $proto $test)
53 if [[ "${exit_code}" -ne 0 ]]; then
54 failed_tests+=("${proto}_${test}")
58 if [[ ${#failed_tests[@]} -ne 0 ]]; then
59 echo "failed tests: ${failed_tests[*]}. \
60 Please see log.txt for more logs"
63 echo "All Tests Succeeded!"
70 [-t data|ack|flags|tcp|ip|large] \
71 [-p <ipv4|ipv6>]" 1>&2;
75 while getopts "i:t:p:" opt; do
92 if [ -n "$dev" ]; then
93 source setup_loopback.sh
100 if [[ "${test}" == "all" ]]; then
103 run_test "${proto}" "${test}"