The child spawned by mqns04.c terminates by calling tst_exit().
tst_exit() basically calls exit(0).  In the case where the child
was spawned with fork+unshare that's fine, but in the case where
it was spawned by clone() it is not:  it causes the parent to see
the exit status as 4, as in:

posixmq_namespace_04    1  TFAIL  :  Child did not exit normally (status 4)

This patch simply makes the child do _exit(0) on success, and that
works fine.  I wonder if there is some way we can generically do
the right thing at txt_exit()?

Note that other tests have the same problem:
pid_namespace1    0  TWARN  :  child exited with signal 4
pid_namespace4    2  TFAIL  :  Container init pid got killed by signal 4
pidns20     1  TBROK  :  parent: cinit is terminated by 4

Should we just do this same "fix" in those testcases?

Signed-off-by: Serge Hallyn <[email protected]>
---
 testcases/kernel/containers/mqns/mqns_04.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/containers/mqns/mqns_04.c 
b/testcases/kernel/containers/mqns/mqns_04.c
index 98d4e39..6f4bb8f 100644
--- a/testcases/kernel/containers/mqns/mqns_04.c
+++ b/testcases/kernel/containers/mqns/mqns_04.c
@@ -78,6 +78,7 @@ int check_mqueue(void *vtest)
        write(p2[1], "go", 3);
        read(p1[0], buf, 3);
 
+       _exit(0);
        tst_exit();
 }
 
-- 
1.7.0


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to