diff mbox

[RFC] selftests: forwarding: Allow running specific tests

Message ID 20180423142346.30213-1-idosch@mellanox.com (mailing list archive)
State Changes Requested
Delegated to: Ido Schimmel
Headers show

Commit Message

Ido Schimmel April 23, 2018, 2:23 p.m. UTC
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 TEST environment variable.

This is useful when not all the tests can pass on a given device.
Specifically, mlxsw does not support the 'continue' action used by
match_ip_flags_test().

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
Ignore. Test patch to see if patchwork is working.
---
 .../testing/selftests/net/forwarding/tc_flower.sh  | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/tools/testing/selftests/net/forwarding/tc_flower.sh b/tools/testing/selftests/net/forwarding/tc_flower.sh
index 0c54059f1875..7e396ccf69ac 100755
--- a/tools/testing/selftests/net/forwarding/tc_flower.sh
+++ b/tools/testing/selftests/net/forwarding/tc_flower.sh
@@ -245,17 +245,9 @@  trap cleanup EXIT
 setup_prepare
 setup_wait
 
-match_dst_mac_test
-match_src_mac_test
-match_dst_ip_test
-match_src_ip_test
-match_ip_flags_test
-
-tc_offload_check
-if [[ $? -ne 0 ]]; then
-	log_info "Could not test offloaded functionality"
+if [ -n "$TEST" ]; then
+	eval $TEST
 else
-	tcflags="skip_sw"
 	match_dst_mac_test
 	match_src_mac_test
 	match_dst_ip_test
@@ -263,4 +255,20 @@  else
 	match_ip_flags_test
 fi
 
+tc_offload_check
+if [[ $? -ne 0 ]]; then
+	log_info "Could not test offloaded functionality"
+else
+	tcflags="skip_sw"
+	if [ -n "$TEST" ]; then
+		eval $TEST
+	else
+		match_dst_mac_test
+		match_src_mac_test
+		match_dst_ip_test
+		match_src_ip_test
+		match_ip_flags_test
+	fi
+fi
+
 exit $EXIT_STATUS