Skip to contentSkip to conversation

syscalls/modify_ldt: Replace TINFO with TPASS or TFAIL

PATCH New zhaogongyi 1 participant 1 message May 6, 2021

lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

PATCH 2/4 syscalls/modify_ldt: Replace TINFO with TPASS or TFAIL

Hi Petr,

Before my MR merged, the test case would not eixt a nozero value, is it the root cause of the problem?

Quoted 28 lines

Hi Zhao, Cyril,

Review

Quoted 1 line
(quoted diff) +0 -0

b/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
...

Quoted 7 lines
(quoted diff) +0 -1
@@ -149,15 +132,13 @@ int main(int ac, char **av)
 		(void)waitpid(pid, &status, 0);
 
 		if (WEXITSTATUS(status) != 0) {
-			flag = FAILED;
 			tst_resm(TFAIL, "Did not generate SEGV, child returned "
 				 "unexpected status");

Review int main(int ac, char **av) · line 141

Quoted 10 lines
(quoted diff) +4 -5
-		}
-
-		if (flag) {
-			tst_resm(TINFO, "block 2 FAILED");
 		} else {
-			tst_resm(TINFO, "block 2 PASSED");
+			if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGSEGV))
+				tst_resm(TPASS, "generate SEGV as expected");
+			else
+				tst_resm(TFAIL, "Did not generate SEGV");

FYI: since merging this patch (f5e8e6b11) test fails on this. Is it expected? I haven't looked closer whether it's a test bug or real issue.

Kind regards,
Petr