Skip to contentSkip to conversation

selftests: bpf: notification about privilege required to run test_lwt_seg6local.sh testing script

PATCH In review Jeffrin Jose T 3 participants 3 messages Jun 22, 2018 – Jun 26, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests: bpf: notification about privilege required to run test_lwt_seg6local.sh testing script

This test needs root privilege for it's successful execution.

This patch is atleast used to notify the user about the privilege the script demands for the smooth execution of the test.

Signed-off-by Jeffrin Jose T (Rajagiri SET) <ahiliation at gmail.com>
---
 tools/testing/selftests/bpf/test_lwt_seg6local.sh | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/testing/selftests/bpf/test_lwt_seg6local.sh +9 -0
index 1c77994b5e71..30575577a8b2 100755
@@ -21,6 +21,15 @@
 # An UDP datagram is sent from fb00::1 to fb00::6. The test succeeds if this
 # datagram can be read on NS6 when binding to fb00::6.
 
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
+msg="skip all tests:"
+if [ $UID != 0 ]; then
+    echo $msg please run this as root >&2
+    exit $ksft_skip
+fi
+
 TMP_FILE="/tmp/selftest_lwt_seg6local.txt"
 
 cleanup()
Signature · 6 lines
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v2 1/1
#1 lore raw
Quoted 6 lines · Jeffrin Jose T

This test needs root privilege for it's successful execution.

This patch is atleast used to notify the user about the privilege the script demands for the smooth execution of the test.

Signed-off-by Jeffrin Jose T (Rajagiri SET) <ahiliation at gmail.com>
Acked-by Song Liu <songliubraving at fb.com>
Quoted 25 lines
---
 tools/testing/selftests/bpf/test_lwt_seg6local.sh | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/testing/selftests/bpf/test_lwt_seg6local.sh +9 -1
index 1c77994b5e71..30575577a8b2 100755
@@ -21,6 +21,15 @@
 # An UDP datagram is sent from fb00::1 to fb00::6. The test succeeds if this
 # datagram can be read on NS6 when binding to fb00::6.
 
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
+msg="skip all tests:"
+if [ $UID != 0 ]; then
+    echo $msg please run this as root >&2
+    exit $ksft_skip
+fi
+
 TMP_FILE="/tmp/selftest_lwt_seg6local.txt"
 
 cleanup()
--
Quoted 2 lines

2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#2 lore raw
In reply to Jeffrin Jose T
Quoted 6 lines · Jeffrin Jose T

This test needs root privilege for it's successful execution.

This patch is atleast used to notify the user about the privilege the script demands for the smooth execution of the test.

Signed-off-by Jeffrin Jose T (Rajagiri SET) <ahiliation at gmail.com>

Applied to bpf, thanks Jeffrin!
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html