]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
96851a7107a2e88b2320374fe6d19490d372c66c
[thirdparty/kernel/stable-queue.git] /
1 From foo@baz Wed Aug 22 09:16:56 CEST 2018
2 From: Jeffrin Jose T <ahiliation@gmail.com>
3 Date: Thu, 21 Jun 2018 22:30:20 +0530
4 Subject: selftests: bpf: notification about privilege required to run test_kmod.sh testing script
5
6 From: Jeffrin Jose T <ahiliation@gmail.com>
7
8 [ Upstream commit 81e167c2a216e7b54e6add9d2badcda267fe33b1 ]
9
10 The test_kmod.sh script require root privilege for the successful
11 execution of the test.
12
13 This patch is to notify the user about the privilege the script
14 demands for the successful execution of the test.
15
16 Signed-off-by: Jeffrin Jose T (Rajagiri SET) <ahiliation@gmail.com>
17 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
18 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 tools/testing/selftests/bpf/test_kmod.sh | 9 +++++++++
22 1 file changed, 9 insertions(+)
23
24 --- a/tools/testing/selftests/bpf/test_kmod.sh
25 +++ b/tools/testing/selftests/bpf/test_kmod.sh
26 @@ -1,6 +1,15 @@
27 #!/bin/sh
28 # SPDX-License-Identifier: GPL-2.0
29
30 +# Kselftest framework requirement - SKIP code is 4.
31 +ksft_skip=4
32 +
33 +msg="skip all tests:"
34 +if [ "$(id -u)" != "0" ]; then
35 + echo $msg please run this as root >&2
36 + exit $ksft_skip
37 +fi
38 +
39 SRC_TREE=../../../../
40
41 test_run()