diff mbox series

[RFC,net-next,10/12] selftests: forwarding: Allow to get netdev interfaces names from commandline

Message ID 20180115191853.26129-11-idosch@mellanox.com
State RFC, archived
Delegated to: David Miller
Headers show
Series selftests: forwarding: Add VRF-based tests | expand

Commit Message

Ido Schimmel Jan. 15, 2018, 7:18 p.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 tools/testing/selftests/forwarding/lib.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/forwarding/lib.sh b/tools/testing/selftests/forwarding/lib.sh
index ddc3ef77f21d..85dbbe83a243 100644
--- a/tools/testing/selftests/forwarding/lib.sh
+++ b/tools/testing/selftests/forwarding/lib.sh
@@ -34,6 +34,20 @@  fi
 
 source forwarding.config
 
+# Load netdev names from command line
+
+count=0
+
+while [[ $# -gt 0 ]]; do
+	if [[ "$count" -eq "0" ]]; then
+		unset NETIFS
+		declare -A NETIFS
+	fi
+	count=$((count + 1))
+	NETIFS[p$count]="$1"
+	shift
+done
+
 for i in $(eval echo {1..$NUM_NETIFS}); do
 	ip link show dev ${NETIFS[p$i]} &> /dev/null
 	if [[ $? -ne 0 ]]; then