Skip to contentSkip to conversation

proc: return exit code 4 for skipped tests

PATCH In review Alexey Dobriyan 2 participants 3 messages Jan 8, 2019 – Jan 14, 2019

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

PATCH 1/1 proc: return exit code 4 for skipped tests

Test harness uses 4 for SKIP, not 2.

---

 tools/testing/selftests/proc/proc-loadavg-001.c        |    2 +-
 tools/testing/selftests/proc/proc-self-map-files-002.c |    2 +-
 tools/testing/selftests/proc/proc-self-syscall.c       |    2 +-
 tools/testing/selftests/proc/proc-self-wchan.c         |    2 +-
 tools/testing/selftests/proc/read.c                    |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
tools/testing/selftests/proc/proc-loadavg-001.c +1 -1
@@ -30,7 +30,7 @@ int main(void)
 
 	if (unshare(CLONE_NEWPID) == -1) {
 		if (errno == ENOSYS || errno == EPERM)
-			return 2;
+			return 4;
 		return 1;
 	}
 
tools/testing/selftests/proc/proc-self-map-files-002.c +1 -1
@@ -63,7 +63,7 @@ int main(void)
 	p = mmap((void *)va, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
 	if (p == MAP_FAILED) {
 		if (errno == EPERM)
-			return 2;
+			return 4;
 		return 1;
 	}
 
tools/testing/selftests/proc/proc-self-syscall.c +1 -1
@@ -39,7 +39,7 @@ int main(void)
 	fd = open("/proc/self/syscall", O_RDONLY);
 	if (fd == -1) {
 		if (errno == ENOENT)
-			return 2;
+			return 4;
 		return 1;
 	}
 
tools/testing/selftests/proc/proc-self-wchan.c +1 -1
@@ -27,7 +27,7 @@ int main(void)
 	fd = open("/proc/self/wchan", O_RDONLY);
 	if (fd == -1) {
 		if (errno == ENOENT)
-			return 2;
+			return 4;
 		return 1;
 	}
 
tools/testing/selftests/proc/read.c +1 -1
@@ -126,7 +126,7 @@ int main(void)
 
 	d = opendir("/proc");
 	if (!d)
-		return 2;
+		return 4;
 	f(d, 0);
 	return 0;
 }
#1 lore raw
Quoted 15 lines · Alexey Dobriyan

Test harness uses 4 for SKIP, not 2.

---

 tools/testing/selftests/proc/proc-loadavg-001.c        |    2 +-
 tools/testing/selftests/proc/proc-self-map-files-002.c |    2 +-
 tools/testing/selftests/proc/proc-self-syscall.c       |    2 +-
 tools/testing/selftests/proc/proc-self-wchan.c         |    2 +-
 tools/testing/selftests/proc/read.c                    |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

tools/testing/selftests/proc/proc-loadavg-001.c int main(void) · line 35

Quoted 7 lines
tools/testing/selftests/proc/proc-loadavg-001.c +1 -1
@@ -30,7 +30,7 @@ int main(void)
 
 	if (unshare(CLONE_NEWPID) == -1) {
 		if (errno == ENOSYS || errno == EPERM)
-			return 2;
+			return 4;
 		return 1;
 	}

Can't these tests use the KSFT_SKIP macro defined in kselftest.h?

--
Thiago Jung Bauermann
IBM Linux Technology Center

#2 lore raw
Quoted 5 lines · Thiago Jung Bauermann
Quoted 4 lines · Alexey Dobriyan
tools/testing/selftests/proc/proc-loadavg-001.c +0 -0
@@ -30,7 +30,7 @@ int main(void)
 
Quoted 8 lines

tools/testing/selftests/proc/proc-loadavg-001.c int main(void) · line 35

Quoted 6 lines
tools/testing/selftests/proc/proc-loadavg-001.c +1 -1
 	if (unshare(CLONE_NEWPID) == -1) {
 		if (errno == ENOSYS || errno == EPERM)
-			return 2;
+			return 4;
 		return 1;
 	}

Can't these tests use the KSFT_SKIP macro defined in kselftest.h?

They can! I tried to find a single use of XPASS and XFAIL and failed and now I just don't want to have anything to do with that header.