aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2018-02-28 12:25:15 +0200
committerDavid S. Miller <davem@davemloft.net>2018-02-28 12:25:48 -0500
commit781fe631fafda37402abdbc4647698a107e2284d (patch)
tree4582d51fcfc7b1f8fdd744b18430b76d74c6a0c9 /tools/testing
parentselftests: forwarding: Add MAC get helper (diff)
downloadlinux-dev-781fe631fafda37402abdbc4647698a107e2284d.tar.xz
linux-dev-781fe631fafda37402abdbc4647698a107e2284d.zip
selftests: forwarding: Allow to get netdev interfaces names from commandline
Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/net/forwarding/lib.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 083a16eb7803..3385ba76ac19 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -46,6 +46,21 @@ if [[ ! -v NUM_NETIFS ]]; then
fi
##############################################################################
+# Command line options handling
+
+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
+
+##############################################################################
# Network interfaces configuration
for i in $(eval echo {1..$NUM_NETIFS}); do