[PATCH net-next internal] selftests: forwarding: Allow running specific tests

Petr Machata petrm at mellanox.com
Tue Apr 24 19:29:11 AEST 2018


Ido Schimmel <idosch at mellanox.com> writes:

> Similar to commit a511858c7536 ("selftests: fib_tests: Allow user to run
> a specific test"), allow user to run only a subset of the tests using
> the TESTS environment variable.
>
> This is useful when not all the tests can pass on a given system.
>
> Example:
> # export TESTS="ping_ipv4 ping_ipv6"
> # ./bridge_vlan_aware.sh
> TEST: ping					[PASS]
> TEST: ping6					[PASS]
>
> Signed-off-by: Ido Schimmel <idosch at mellanox.com>

Apart from the one note below:

Reviewed-by: Petr Machata <petrm at mellanox.com>

> diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh
> index 3a6385ebd5d0..9b4acaf35cfe 100755
> --- a/tools/testing/selftests/net/forwarding/tc_actions.sh
> +++ b/tools/testing/selftests/net/forwarding/tc_actions.sh
> @@ -1,6 +1,8 @@
>  #!/bin/bash
>  # SPDX-License-Identifier: GPL-2.0
>  
> +ALL_TESTS="gact_drop_and_ok_test mirred_egress_redirect_test \
> +	mirred_egress_mirror_test"
>  NUM_NETIFS=4
>  source tc_common.sh
>  source lib.sh
> @@ -179,24 +181,30 @@ cleanup()
>  	ip link set $swp1 address $swp1origmac
>  }
>  
> +mirred_egress_redirect_test()
> +{
> +	mirred_egress_test "redirect"
> +}
> +
> +mirred_egress_mirror_test()
> +{
> +	mirred_egress_test "mirror"
> +}
> +
>  trap cleanup EXIT
>  
>  setup_prepare
>  setup_wait
>  
> -gact_drop_and_ok_test
> -mirred_egress_test "redirect"
> -mirred_egress_test "mirror"
> +tests_run
>  
>  tc_offload_check
>  if [[ $? -ne 0 ]]; then
>  	log_info "Could not test offloaded functionality"
>  else
>  	tcflags="skip_sw"
> -	gact_drop_and_ok_test
> -	mirred_egress_test "redirect"
> -	mirred_egress_test "mirror"
>  	gact_trap_test
> +	tests_run

I guess it's reasonable to assume that any ACL-capable ASIC will
actually be able to trap packets.



More information about the Linux-mlxsw mailing list