[apparmor] [patch] regression tests: fix environ fail case

Steve Beattie steve at nxnw.org
Thu Feb 2 00:48:39 UTC 2017


Hi,

While researching
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1661030 I
discovered that when the exec() of the child process, we don't report
FAIL to stdout, so the regression tests consider it an error rather than
a failure and abort, short-circuiting the test script.

This patch fixes this by emitting the FAIL message when the result from
the wait() syscall indicates the child process did not succeed.

Nominated for 2.11, 2.10, and 2.9.

Signed-off-by: Steve Beattie <steve at nxnw.org>

---
 tests/regression/apparmor/environ.c |    2 ++
 1 file changed, 2 insertions(+)

Index: b/tests/regression/apparmor/environ.c
===================================================================
--- a/tests/regression/apparmor/environ.c
+++ b/tests/regression/apparmor/environ.c
@@ -63,6 +63,8 @@ int main(int argc, char *argv[])
 		if (retval == RET_CHLD_SUCCESS) {
 			printf("PASS\n");
 			retval = 0;
+		} else {
+			printf("FAIL: Child failed\n");
 		}
 
 	} else if (pid == 0) {

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20170201/efe800ab/attachment.pgp>


More information about the AppArmor mailing list