diff mbox

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

Message ID 20180424104720.GA27020@splinter.mtl.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Ido Schimmel April 24, 2018, 10:47 a.m. UTC
On Tue, Apr 24, 2018 at 01:03:17PM +0300, Petr Machata wrote:
> Petr Machata <petrm@mellanox.com> writes:
> 
> > Ido Schimmel <idosch@mellanox.com> writes:
> >
> >>  	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.
> 
> But wait, the test also assumes that redirect is supported. Maybe do
> this, and just add the test to ALL_TESTS?
> 
> diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh
> index 3a6385e..7abd6e3 100755
> --- a/tools/testing/selftests/net/forwarding/tc_actions.sh
> +++ b/tools/testing/selftests/net/forwarding/tc_actions.sh
> @@ -111,6 +111,10 @@ gact_trap_test()
>  {
>  	RET=0
>  
> +	if [ "${tcflags/skip_hw}" != "$tcflags" ]; then
> +		return 0;
> +	fi
> +
>  	tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \
>  		skip_hw dst_ip 192.0.2.2 action drop
>  	tc filter add dev $swp1 ingress protocol ip pref 3 handle 103 flower \

How about the below?

Linux-mlxsw mailing list
Linux-mlxsw@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linux-mlxsw

Comments

Petr Machata April 24, 2018, 11:04 a.m. UTC | #1
Ido Schimmel <idosch@mellanox.com> writes:

> How about the below?
>
> @@ -113,6 +113,10 @@ gact_trap_test()
>  {
>  	RET=0
>  
> +	if [[ "$tcflags" != "skip_sw" ]]; then
> +		return 0;
> +	fi
> +

If "tcflags" is not intended for more general flags, then this is OK.
I just wasn't sure.

Petr
diff mbox

Patch

diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh
index 9b4acaf35cfe..813d02d1939d 100755
--- a/tools/testing/selftests/net/forwarding/tc_actions.sh
+++ b/tools/testing/selftests/net/forwarding/tc_actions.sh
@@ -2,7 +2,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
 
 ALL_TESTS="gact_drop_and_ok_test mirred_egress_redirect_test \
-	mirred_egress_mirror_test"
+	mirred_egress_mirror_test gact_trap_test"
 NUM_NETIFS=4
 source tc_common.sh
 source lib.sh
@@ -113,6 +113,10 @@  gact_trap_test()
 {
 	RET=0
 
+	if [[ "$tcflags" != "skip_sw" ]]; then
+		return 0;
+	fi
+
 	tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \
 		skip_hw dst_ip 192.0.2.2 action drop
 	tc filter add dev $swp1 ingress protocol ip pref 3 handle 103 flower \
@@ -203,7 +207,6 @@  if [[ $? -ne 0 ]]; then
 	log_info "Could not test offloaded functionality"
 else
 	tcflags="skip_sw"
-	gact_trap_test
 	tests_run
 fi
_______________________________________________