From: Jiri Pirko Date: Wed, 28 Feb 2018 10:25:15 +0000 (+0200) Subject: selftests: forwarding: Allow to get netdev interfaces names from commandline X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=781fe631fafda37402abdbc4647698a107e2284d;p=linux.git selftests: forwarding: Allow to get netdev interfaces names from commandline Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 083a16eb78037..3385ba76ac19c 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -45,6 +45,21 @@ if [[ ! -v NUM_NETIFS ]]; then exit 0 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