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: <20230824122853.3494-12-magnus.karlsson@gmail.com>
Date: Thu, 24 Aug 2023 14:28:53 +0200
From: Magnus Karlsson <magnus.karlsson@...il.com>
To: magnus.karlsson@...el.com,
	bjorn@...nel.org,
	ast@...nel.org,
	daniel@...earbox.net,
	netdev@...r.kernel.org,
	maciej.fijalkowski@...el.com,
	bpf@...r.kernel.org,
	yhs@...com,
	andrii@...nel.org,
	martin.lau@...ux.dev,
	song@...nel.org,
	john.fastabend@...il.com,
	kpsingh@...nel.org,
	sdf@...gle.com,
	haoluo@...gle.com,
	jolsa@...nel.org,
	przemyslaw.kitszel@...el.com
Subject: [PATCH bpf-next v2 11/11] selftests/xsk: introduce XSKTEST_ETH environment variable

From: Magnus Karlsson <magnus.karlsson@...el.com>

Introduce the XSKTEST_ETH environment variable to be able to set the
network interface that should be used for testing.

Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
---
 tools/testing/selftests/bpf/test_xsk.sh | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
index 9ec718043c1a..3e0a2302a185 100755
--- a/tools/testing/selftests/bpf/test_xsk.sh
+++ b/tools/testing/selftests/bpf/test_xsk.sh
@@ -88,14 +88,12 @@
 
 . xsk_prereqs.sh
 
-ETH=""
-
 while getopts "vi:dm:lt:h" flag
 do
 	case "${flag}" in
 		v) verbose=1;;
 		d) debug=1;;
-		i) ETH=${OPTARG};;
+		i) XSKTEST_ETH=${OPTARG};;
 		m) XSKTEST_MODE=${OPTARG};;
 		l) list=1;;
 		t) XSKTEST_TEST=${OPTARG};;
@@ -157,9 +155,9 @@ if [[ $help -eq 1 ]]; then
         exit
 fi
 
-if [ ! -z $ETH ]; then
-	VETH0=${ETH}
-	VETH1=${ETH}
+if [ -n "$XSKTEST_ETH" ]; then
+	VETH0=${XSKTEST_ETH}
+	VETH1=${XSKTEST_ETH}
 else
 	validate_root_exec
 	validate_veth_support ${VETH0}
@@ -203,10 +201,10 @@ fi
 
 exec_xskxceiver
 
-if [ -z $ETH ]; then
+if [ -z $XSKTEST_ETH ]; then
 	cleanup_exit ${VETH0} ${VETH1}
 else
-	cleanup_iface ${ETH} ${MTU}
+	cleanup_iface ${XSKTEST_ETH} ${MTU}
 fi
 
 if [[ $list -eq 1 ]]; then
@@ -216,17 +214,17 @@ fi
 TEST_NAME="XSK_SELFTESTS_${VETH0}_BUSY_POLL"
 busy_poll=1
 
-if [ -z $ETH ]; then
+if [ -z $XSKTEST_ETH ]; then
 	setup_vethPairs
 fi
 exec_xskxceiver
 
 ## END TESTS
 
-if [ -z $ETH ]; then
+if [ -z $XSKTEST_ETH ]; then
 	cleanup_exit ${VETH0} ${VETH1}
 else
-	cleanup_iface ${ETH} ${MTU}
+	cleanup_iface ${XSKTEST_ETH} ${MTU}
 fi
 
 failures=0
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ