diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-23 18:26:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-23 18:26:19 -0400 |
commit | b13fbe77132575f621ce992a9be47d067a606308 (patch) | |
tree | 6bb580204791240954e3abd5fcac8bdb594aa25b | |
parent | 81f9c4e4177d31ced6f52a89bb70e93bfb77ca03 (diff) | |
parent | eb83d5f7d07ed913d62ca4ad1e14fb6ca4937bab (diff) |
Merge tag 'linux-kselftest-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest fixes from Shuah Khan:
- fix new sparc64 adi driver test compile errors on non-sparc systems
- fix config fragment for sync framework for improved test coverage
- fix several tests to return correct Kselftest skip code
* tag 'linux-kselftest-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests: sparc64: Add missing SPDX License Identifiers
selftests: sparc64: delete RUN_TESTS and EMIT_TESTS overrides
selftests: sparc64: Fix to do nothing on non-sparc64
selftests: sync: add config fragment for testing sync framework
selftests: vm: return Kselftest Skip code for skipped tests
selftests: zram: return Kselftest Skip code for skipped tests
selftests: user: return Kselftest Skip code for skipped tests
selftests: sysctl: return Kselftest Skip code for skipped tests
selftests: static_keys: return Kselftest Skip code for skipped tests
selftests: pstore: return Kselftest Skip code for skipped tests
-rwxr-xr-x | tools/testing/selftests/pstore/pstore_post_reboot_tests | 5 | ||||
-rw-r--r-- | tools/testing/selftests/sparc64/Makefile | 20 | ||||
-rw-r--r-- | tools/testing/selftests/sparc64/drivers/Makefile | 2 | ||||
-rwxr-xr-x | tools/testing/selftests/static_keys/test_static_keys.sh | 13 | ||||
-rw-r--r-- | tools/testing/selftests/sync/config | 4 | ||||
-rwxr-xr-x | tools/testing/selftests/sysctl/sysctl.sh | 20 | ||||
-rwxr-xr-x | tools/testing/selftests/user/test_user_copy.sh | 7 | ||||
-rw-r--r-- | tools/testing/selftests/vm/compaction_test.c | 4 | ||||
-rw-r--r-- | tools/testing/selftests/vm/mlock2-tests.c | 12 | ||||
-rwxr-xr-x | tools/testing/selftests/vm/run_vmtests | 5 | ||||
-rw-r--r-- | tools/testing/selftests/vm/userfaultfd.c | 4 | ||||
-rwxr-xr-x | tools/testing/selftests/zram/zram.sh | 5 | ||||
-rwxr-xr-x | tools/testing/selftests/zram/zram_lib.sh | 5 |
13 files changed, 79 insertions, 27 deletions
diff --git a/tools/testing/selftests/pstore/pstore_post_reboot_tests b/tools/testing/selftests/pstore/pstore_post_reboot_tests index 6ccb154cb4aa..22f8df1ad7d4 100755 --- a/tools/testing/selftests/pstore/pstore_post_reboot_tests +++ b/tools/testing/selftests/pstore/pstore_post_reboot_tests | |||
@@ -7,13 +7,16 @@ | |||
7 | # | 7 | # |
8 | # Released under the terms of the GPL v2. | 8 | # Released under the terms of the GPL v2. |
9 | 9 | ||
10 | # Kselftest framework requirement - SKIP code is 4. | ||
11 | ksft_skip=4 | ||
12 | |||
10 | . ./common_tests | 13 | . ./common_tests |
11 | 14 | ||
12 | if [ -e $REBOOT_FLAG ]; then | 15 | if [ -e $REBOOT_FLAG ]; then |
13 | rm $REBOOT_FLAG | 16 | rm $REBOOT_FLAG |
14 | else | 17 | else |
15 | prlog "pstore_crash_test has not been executed yet. we skip further tests." | 18 | prlog "pstore_crash_test has not been executed yet. we skip further tests." |
16 | exit 0 | 19 | exit $ksft_skip |
17 | fi | 20 | fi |
18 | 21 | ||
19 | prlog -n "Mounting pstore filesystem ... " | 22 | prlog -n "Mounting pstore filesystem ... " |
diff --git a/tools/testing/selftests/sparc64/Makefile b/tools/testing/selftests/sparc64/Makefile index 2082eeffd779..a19531dba4dc 100644 --- a/tools/testing/selftests/sparc64/Makefile +++ b/tools/testing/selftests/sparc64/Makefile | |||
@@ -1,7 +1,18 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | uname_M := $(shell uname -m 2>/dev/null || echo not) | ||
3 | ARCH ?= $(shell echo $(uname_M) | sed -e s/x86_64/x86/) | ||
4 | |||
5 | ifneq ($(ARCH),sparc64) | ||
6 | nothing: | ||
7 | .PHONY: all clean run_tests install | ||
8 | .SILENT: | ||
9 | else | ||
10 | |||
1 | SUBDIRS := drivers | 11 | SUBDIRS := drivers |
2 | 12 | ||
3 | TEST_PROGS := run.sh | 13 | TEST_PROGS := run.sh |
4 | 14 | ||
15 | |||
5 | .PHONY: all clean | 16 | .PHONY: all clean |
6 | 17 | ||
7 | include ../lib.mk | 18 | include ../lib.mk |
@@ -18,10 +29,6 @@ all: | |||
18 | fi \ | 29 | fi \ |
19 | done | 30 | done |
20 | 31 | ||
21 | override define RUN_TESTS | ||
22 | @cd $(OUTPUT); ./run.sh | ||
23 | endef | ||
24 | |||
25 | override define INSTALL_RULE | 32 | override define INSTALL_RULE |
26 | mkdir -p $(INSTALL_PATH) | 33 | mkdir -p $(INSTALL_PATH) |
27 | install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) | 34 | install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) |
@@ -33,10 +40,6 @@ override define INSTALL_RULE | |||
33 | done; | 40 | done; |
34 | endef | 41 | endef |
35 | 42 | ||
36 | override define EMIT_TESTS | ||
37 | echo "./run.sh" | ||
38 | endef | ||
39 | |||
40 | override define CLEAN | 43 | override define CLEAN |
41 | @for DIR in $(SUBDIRS); do \ | 44 | @for DIR in $(SUBDIRS); do \ |
42 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ | 45 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
@@ -44,3 +47,4 @@ override define CLEAN | |||
44 | make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ | 47 | make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
45 | done | 48 | done |
46 | endef | 49 | endef |
50 | endif | ||
diff --git a/tools/testing/selftests/sparc64/drivers/Makefile b/tools/testing/selftests/sparc64/drivers/Makefile index 6264f40bbdbc..deb0df415565 100644 --- a/tools/testing/selftests/sparc64/drivers/Makefile +++ b/tools/testing/selftests/sparc64/drivers/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | 1 | # SPDX-License-Identifier: GPL-2.0 | |
2 | INCLUDEDIR := -I. | 2 | INCLUDEDIR := -I. |
3 | CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g | 3 | CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g |
4 | 4 | ||
diff --git a/tools/testing/selftests/static_keys/test_static_keys.sh b/tools/testing/selftests/static_keys/test_static_keys.sh index 24cff498b31a..fc9f8cde7d42 100755 --- a/tools/testing/selftests/static_keys/test_static_keys.sh +++ b/tools/testing/selftests/static_keys/test_static_keys.sh | |||
@@ -2,6 +2,19 @@ | |||
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | # Runs static keys kernel module tests | 3 | # Runs static keys kernel module tests |
4 | 4 | ||
5 | # Kselftest framework requirement - SKIP code is 4. | ||
6 | ksft_skip=4 | ||
7 | |||
8 | if ! /sbin/modprobe -q -n test_static_key_base; then | ||
9 | echo "static_key: module test_static_key_base is not found [SKIP]" | ||
10 | exit $ksft_skip | ||
11 | fi | ||
12 | |||
13 | if ! /sbin/modprobe -q -n test_static_keys; then | ||
14 | echo "static_key: module test_static_keys is not found [SKIP]" | ||
15 | exit $ksft_skip | ||
16 | fi | ||
17 | |||
5 | if /sbin/modprobe -q test_static_key_base; then | 18 | if /sbin/modprobe -q test_static_key_base; then |
6 | if /sbin/modprobe -q test_static_keys; then | 19 | if /sbin/modprobe -q test_static_keys; then |
7 | echo "static_key: ok" | 20 | echo "static_key: ok" |
diff --git a/tools/testing/selftests/sync/config b/tools/testing/selftests/sync/config new file mode 100644 index 000000000000..1ab7e8130db2 --- /dev/null +++ b/tools/testing/selftests/sync/config | |||
@@ -0,0 +1,4 @@ | |||
1 | CONFIG_STAGING=y | ||
2 | CONFIG_ANDROID=y | ||
3 | CONFIG_SYNC=y | ||
4 | CONFIG_SW_SYNC=y | ||
diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh index ec232c3cfcaa..584eb8ea780a 100755 --- a/tools/testing/selftests/sysctl/sysctl.sh +++ b/tools/testing/selftests/sysctl/sysctl.sh | |||
@@ -14,6 +14,9 @@ | |||
14 | 14 | ||
15 | # This performs a series tests against the proc sysctl interface. | 15 | # This performs a series tests against the proc sysctl interface. |
16 | 16 | ||
17 | # Kselftest framework requirement - SKIP code is 4. | ||
18 | ksft_skip=4 | ||
19 | |||
17 | TEST_NAME="sysctl" | 20 | TEST_NAME="sysctl" |
18 | TEST_DRIVER="test_${TEST_NAME}" | 21 | TEST_DRIVER="test_${TEST_NAME}" |
19 | TEST_DIR=$(dirname $0) | 22 | TEST_DIR=$(dirname $0) |
@@ -41,7 +44,7 @@ test_modprobe() | |||
41 | echo "$0: $DIR not present" >&2 | 44 | echo "$0: $DIR not present" >&2 |
42 | echo "You must have the following enabled in your kernel:" >&2 | 45 | echo "You must have the following enabled in your kernel:" >&2 |
43 | cat $TEST_DIR/config >&2 | 46 | cat $TEST_DIR/config >&2 |
44 | exit 1 | 47 | exit $ksft_skip |
45 | fi | 48 | fi |
46 | } | 49 | } |
47 | 50 | ||
@@ -98,28 +101,30 @@ test_reqs() | |||
98 | uid=$(id -u) | 101 | uid=$(id -u) |
99 | if [ $uid -ne 0 ]; then | 102 | if [ $uid -ne 0 ]; then |
100 | echo $msg must be run as root >&2 | 103 | echo $msg must be run as root >&2 |
101 | exit 0 | 104 | exit $ksft_skip |
102 | fi | 105 | fi |
103 | 106 | ||
104 | if ! which perl 2> /dev/null > /dev/null; then | 107 | if ! which perl 2> /dev/null > /dev/null; then |
105 | echo "$0: You need perl installed" | 108 | echo "$0: You need perl installed" |
106 | exit 1 | 109 | exit $ksft_skip |
107 | fi | 110 | fi |
108 | if ! which getconf 2> /dev/null > /dev/null; then | 111 | if ! which getconf 2> /dev/null > /dev/null; then |
109 | echo "$0: You need getconf installed" | 112 | echo "$0: You need getconf installed" |
110 | exit 1 | 113 | exit $ksft_skip |
111 | fi | 114 | fi |
112 | if ! which diff 2> /dev/null > /dev/null; then | 115 | if ! which diff 2> /dev/null > /dev/null; then |
113 | echo "$0: You need diff installed" | 116 | echo "$0: You need diff installed" |
114 | exit 1 | 117 | exit $ksft_skip |
115 | fi | 118 | fi |
116 | } | 119 | } |
117 | 120 | ||
118 | function load_req_mod() | 121 | function load_req_mod() |
119 | { | 122 | { |
120 | trap "test_modprobe" EXIT | ||
121 | |||
122 | if [ ! -d $DIR ]; then | 123 | if [ ! -d $DIR ]; then |
124 | if ! modprobe -q -n $TEST_DRIVER; then | ||
125 | echo "$0: module $TEST_DRIVER not found [SKIP]" | ||
126 | exit $ksft_skip | ||
127 | fi | ||
123 | modprobe $TEST_DRIVER | 128 | modprobe $TEST_DRIVER |
124 | if [ $? -ne 0 ]; then | 129 | if [ $? -ne 0 ]; then |
125 | exit | 130 | exit |
@@ -765,6 +770,7 @@ function parse_args() | |||
765 | test_reqs | 770 | test_reqs |
766 | allow_user_defaults | 771 | allow_user_defaults |
767 | check_production_sysctl_writes_strict | 772 | check_production_sysctl_writes_strict |
773 | test_modprobe | ||
768 | load_req_mod | 774 | load_req_mod |
769 | 775 | ||
770 | trap "test_finish" EXIT | 776 | trap "test_finish" EXIT |
diff --git a/tools/testing/selftests/user/test_user_copy.sh b/tools/testing/selftests/user/test_user_copy.sh index d60506fc77f8..f9b31a57439b 100755 --- a/tools/testing/selftests/user/test_user_copy.sh +++ b/tools/testing/selftests/user/test_user_copy.sh | |||
@@ -2,6 +2,13 @@ | |||
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | # Runs copy_to/from_user infrastructure using test_user_copy kernel module | 3 | # Runs copy_to/from_user infrastructure using test_user_copy kernel module |
4 | 4 | ||
5 | # Kselftest framework requirement - SKIP code is 4. | ||
6 | ksft_skip=4 | ||
7 | |||
8 | if ! /sbin/modprobe -q -n test_user_copy; then | ||
9 | echo "user: module test_user_copy is not found [SKIP]" | ||
10 | exit $ksft_skip | ||
11 | fi | ||
5 | if /sbin/modprobe -q test_user_copy; then | 12 | if /sbin/modprobe -q test_user_copy; then |
6 | /sbin/modprobe -q -r test_user_copy | 13 | /sbin/modprobe -q -r test_user_copy |
7 | echo "user_copy: ok" | 14 | echo "user_copy: ok" |
diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c index 1097f04e4d80..bcec71250873 100644 --- a/tools/testing/selftests/vm/compaction_test.c +++ b/tools/testing/selftests/vm/compaction_test.c | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <unistd.h> | 16 | #include <unistd.h> |
17 | #include <string.h> | 17 | #include <string.h> |
18 | 18 | ||
19 | #include "../kselftest.h" | ||
20 | |||
19 | #define MAP_SIZE 1048576 | 21 | #define MAP_SIZE 1048576 |
20 | 22 | ||
21 | struct map_list { | 23 | struct map_list { |
@@ -169,7 +171,7 @@ int main(int argc, char **argv) | |||
169 | printf("Either the sysctl compact_unevictable_allowed is not\n" | 171 | printf("Either the sysctl compact_unevictable_allowed is not\n" |
170 | "set to 1 or couldn't read the proc file.\n" | 172 | "set to 1 or couldn't read the proc file.\n" |
171 | "Skipping the test\n"); | 173 | "Skipping the test\n"); |
172 | return 0; | 174 | return KSFT_SKIP; |
173 | } | 175 | } |
174 | 176 | ||
175 | lim.rlim_cur = RLIM_INFINITY; | 177 | lim.rlim_cur = RLIM_INFINITY; |
diff --git a/tools/testing/selftests/vm/mlock2-tests.c b/tools/testing/selftests/vm/mlock2-tests.c index 4997b9222cfa..637b6d0ac0d0 100644 --- a/tools/testing/selftests/vm/mlock2-tests.c +++ b/tools/testing/selftests/vm/mlock2-tests.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <stdbool.h> | 9 | #include <stdbool.h> |
10 | #include "mlock2.h" | 10 | #include "mlock2.h" |
11 | 11 | ||
12 | #include "../kselftest.h" | ||
13 | |||
12 | struct vm_boundaries { | 14 | struct vm_boundaries { |
13 | unsigned long start; | 15 | unsigned long start; |
14 | unsigned long end; | 16 | unsigned long end; |
@@ -303,7 +305,7 @@ static int test_mlock_lock() | |||
303 | if (mlock2_(map, 2 * page_size, 0)) { | 305 | if (mlock2_(map, 2 * page_size, 0)) { |
304 | if (errno == ENOSYS) { | 306 | if (errno == ENOSYS) { |
305 | printf("Cannot call new mlock family, skipping test\n"); | 307 | printf("Cannot call new mlock family, skipping test\n"); |
306 | _exit(0); | 308 | _exit(KSFT_SKIP); |
307 | } | 309 | } |
308 | perror("mlock2(0)"); | 310 | perror("mlock2(0)"); |
309 | goto unmap; | 311 | goto unmap; |
@@ -412,7 +414,7 @@ static int test_mlock_onfault() | |||
412 | if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) { | 414 | if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) { |
413 | if (errno == ENOSYS) { | 415 | if (errno == ENOSYS) { |
414 | printf("Cannot call new mlock family, skipping test\n"); | 416 | printf("Cannot call new mlock family, skipping test\n"); |
415 | _exit(0); | 417 | _exit(KSFT_SKIP); |
416 | } | 418 | } |
417 | perror("mlock2(MLOCK_ONFAULT)"); | 419 | perror("mlock2(MLOCK_ONFAULT)"); |
418 | goto unmap; | 420 | goto unmap; |
@@ -425,7 +427,7 @@ static int test_mlock_onfault() | |||
425 | if (munlock(map, 2 * page_size)) { | 427 | if (munlock(map, 2 * page_size)) { |
426 | if (errno == ENOSYS) { | 428 | if (errno == ENOSYS) { |
427 | printf("Cannot call new mlock family, skipping test\n"); | 429 | printf("Cannot call new mlock family, skipping test\n"); |
428 | _exit(0); | 430 | _exit(KSFT_SKIP); |
429 | } | 431 | } |
430 | perror("munlock()"); | 432 | perror("munlock()"); |
431 | goto unmap; | 433 | goto unmap; |
@@ -457,7 +459,7 @@ static int test_lock_onfault_of_present() | |||
457 | if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) { | 459 | if (mlock2_(map, 2 * page_size, MLOCK_ONFAULT)) { |
458 | if (errno == ENOSYS) { | 460 | if (errno == ENOSYS) { |
459 | printf("Cannot call new mlock family, skipping test\n"); | 461 | printf("Cannot call new mlock family, skipping test\n"); |
460 | _exit(0); | 462 | _exit(KSFT_SKIP); |
461 | } | 463 | } |
462 | perror("mlock2(MLOCK_ONFAULT)"); | 464 | perror("mlock2(MLOCK_ONFAULT)"); |
463 | goto unmap; | 465 | goto unmap; |
@@ -583,7 +585,7 @@ static int test_vma_management(bool call_mlock) | |||
583 | if (call_mlock && mlock2_(map, 3 * page_size, MLOCK_ONFAULT)) { | 585 | if (call_mlock && mlock2_(map, 3 * page_size, MLOCK_ONFAULT)) { |
584 | if (errno == ENOSYS) { | 586 | if (errno == ENOSYS) { |
585 | printf("Cannot call new mlock family, skipping test\n"); | 587 | printf("Cannot call new mlock family, skipping test\n"); |
586 | _exit(0); | 588 | _exit(KSFT_SKIP); |
587 | } | 589 | } |
588 | perror("mlock(ONFAULT)\n"); | 590 | perror("mlock(ONFAULT)\n"); |
589 | goto out; | 591 | goto out; |
diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftests/vm/run_vmtests index 22d564673830..88cbe5575f0c 100755 --- a/tools/testing/selftests/vm/run_vmtests +++ b/tools/testing/selftests/vm/run_vmtests | |||
@@ -2,6 +2,9 @@ | |||
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | #please run as root | 3 | #please run as root |
4 | 4 | ||
5 | # Kselftest framework requirement - SKIP code is 4. | ||
6 | ksft_skip=4 | ||
7 | |||
5 | mnt=./huge | 8 | mnt=./huge |
6 | exitcode=0 | 9 | exitcode=0 |
7 | 10 | ||
@@ -36,7 +39,7 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then | |||
36 | echo $(( $lackpgs + $nr_hugepgs )) > /proc/sys/vm/nr_hugepages | 39 | echo $(( $lackpgs + $nr_hugepgs )) > /proc/sys/vm/nr_hugepages |
37 | if [ $? -ne 0 ]; then | 40 | if [ $? -ne 0 ]; then |
38 | echo "Please run this test as root" | 41 | echo "Please run this test as root" |
39 | exit 1 | 42 | exit $ksft_skip |
40 | fi | 43 | fi |
41 | while read name size unit; do | 44 | while read name size unit; do |
42 | if [ "$name" = "HugePages_Free:" ]; then | 45 | if [ "$name" = "HugePages_Free:" ]; then |
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index de2f9ec8a87f..7b8171e3128a 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c | |||
@@ -69,6 +69,8 @@ | |||
69 | #include <setjmp.h> | 69 | #include <setjmp.h> |
70 | #include <stdbool.h> | 70 | #include <stdbool.h> |
71 | 71 | ||
72 | #include "../kselftest.h" | ||
73 | |||
72 | #ifdef __NR_userfaultfd | 74 | #ifdef __NR_userfaultfd |
73 | 75 | ||
74 | static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; | 76 | static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; |
@@ -1322,7 +1324,7 @@ int main(int argc, char **argv) | |||
1322 | int main(void) | 1324 | int main(void) |
1323 | { | 1325 | { |
1324 | printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n"); | 1326 | printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n"); |
1325 | return 0; | 1327 | return KSFT_SKIP; |
1326 | } | 1328 | } |
1327 | 1329 | ||
1328 | #endif /* __NR_userfaultfd */ | 1330 | #endif /* __NR_userfaultfd */ |
diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh index 754de7da426a..232e958ec454 100755 --- a/tools/testing/selftests/zram/zram.sh +++ b/tools/testing/selftests/zram/zram.sh | |||
@@ -2,6 +2,9 @@ | |||
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | TCID="zram.sh" | 3 | TCID="zram.sh" |
4 | 4 | ||
5 | # Kselftest framework requirement - SKIP code is 4. | ||
6 | ksft_skip=4 | ||
7 | |||
5 | . ./zram_lib.sh | 8 | . ./zram_lib.sh |
6 | 9 | ||
7 | run_zram () { | 10 | run_zram () { |
@@ -24,5 +27,5 @@ elif [ -b /dev/zram0 ]; then | |||
24 | else | 27 | else |
25 | echo "$TCID : No zram.ko module or /dev/zram0 device file not found" | 28 | echo "$TCID : No zram.ko module or /dev/zram0 device file not found" |
26 | echo "$TCID : CONFIG_ZRAM is not set" | 29 | echo "$TCID : CONFIG_ZRAM is not set" |
27 | exit 1 | 30 | exit $ksft_skip |
28 | fi | 31 | fi |
diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh index f6a9c73e7a44..9e73a4fb9b0a 100755 --- a/tools/testing/selftests/zram/zram_lib.sh +++ b/tools/testing/selftests/zram/zram_lib.sh | |||
@@ -18,6 +18,9 @@ MODULE=0 | |||
18 | dev_makeswap=-1 | 18 | dev_makeswap=-1 |
19 | dev_mounted=-1 | 19 | dev_mounted=-1 |
20 | 20 | ||
21 | # Kselftest framework requirement - SKIP code is 4. | ||
22 | ksft_skip=4 | ||
23 | |||
21 | trap INT | 24 | trap INT |
22 | 25 | ||
23 | check_prereqs() | 26 | check_prereqs() |
@@ -27,7 +30,7 @@ check_prereqs() | |||
27 | 30 | ||
28 | if [ $uid -ne 0 ]; then | 31 | if [ $uid -ne 0 ]; then |
29 | echo $msg must be run as root >&2 | 32 | echo $msg must be run as root >&2 |
30 | exit 0 | 33 | exit $ksft_skip |
31 | fi | 34 | fi |
32 | } | 35 | } |
33 | 36 | ||