diff mbox

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

Message ID wih4lk0yl96.fsf@dev-r-vrt-156.mtr.labs.mlnx (mailing list archive)
State Not Applicable
Headers show

Commit Message

Petr Machata April 24, 2018, 10:03 a.m. UTC
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?


One could also simply do this, but then listing the test in TESTS would
lead to it being executed even in SW-only scenarios.

	tcflags="skip_sw"
        ALL_TESTS="$ALL_TESTS gact_trap_test"
	tests_run

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 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 \