diff options
author | Jiri Pirko <jiri@mellanox.com> | 2018-02-28 11:25:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-28 18:25:48 +0100 |
commit | 781fe631fafda37402abdbc4647698a107e2284d (patch) | |
tree | 4582d51fcfc7b1f8fdd744b18430b76d74c6a0c9 /tools/testing/selftests | |
parent | selftests: forwarding: Add MAC get helper (diff) | |
download | linux-781fe631fafda37402abdbc4647698a107e2284d.tar.xz linux-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/selftests')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 15 |
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 |