lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180115191853.26129-12-idosch@mellanox.com>
Date:   Mon, 15 Jan 2018 21:18:52 +0200
From:   Ido Schimmel <idosch@...lanox.com>
To:     netdev@...r.kernel.org, linux-kselftest@...r.kernel.org
Cc:     davem@...emloft.net, shuah@...nel.org, dsahern@...il.com,
        nikolay@...ulusnetworks.com, roopa@...ulusnetworks.com,
        andy@...yhouse.net, jiri@...lanox.com, mlxsw@...lanox.com,
        saeedm@...lanox.com, tariqt@...lanox.com, jhs@...atatu.com,
        lucasb@...atatu.com, f.fainelli@...il.com,
        vivien.didelot@...oirfairelinux.com, andrew@...n.ch,
        jakub.kicinski@...ronome.com, simon.horman@...ronome.com,
        Ido Schimmel <idosch@...lanox.com>
Subject: [RFC PATCH net-next 11/12] selftests: forwarding: Allow to pass commandline options

From: Jiri Pirko <jiri@...lanox.com>

Signed-off-by: Jiri Pirko <jiri@...lanox.com>
Signed-off-by: Ido Schimmel <idosch@...lanox.com>
---
 tools/testing/selftests/forwarding/lib.sh | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/forwarding/lib.sh b/tools/testing/selftests/forwarding/lib.sh
index 85dbbe83a243..b9b049af93cb 100644
--- a/tools/testing/selftests/forwarding/lib.sh
+++ b/tools/testing/selftests/forwarding/lib.sh
@@ -34,17 +34,23 @@ fi
 
 source forwarding.config
 
-# Load netdev names from command line
+# Load options and netdev names from command line
 
 count=0
 
 while [[ $# -gt 0 ]]; do
-	if [[ "$count" -eq "0" ]]; then
-		unset NETIFS
-		declare -A NETIFS
+	echo $1 | grep "=" &> /dev/null
+	if [[ $? -eq 0 ]]; then
+		splitarr=(${1//=/ })
+		OPTIONS[${splitarr[0]}]=${splitarr[1]}
+	else
+		if [[ "$count" -eq "0" ]]; then
+			unset NETIFS
+			declare -A NETIFS
+		fi
+		count=$((count + 1))
+		NETIFS[p$count]="$1"
 	fi
-	count=$((count + 1))
-	NETIFS[p$count]="$1"
 	shift
 done
 
-- 
2.14.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ