[apparmor] [patch 2/5] tests: check for early task exit in onexec tests
steve at nxnw.org
steve at nxnw.org
Fri Mar 18 17:29:06 UTC 2016
Based on a patch by John Johansen <john.johansen at canonical.com>
(I converted the check to look for the process directory in /proc
rather than sending signal 0 to the task, as John had done in a patch
sent to me, to prevent failures in signal delivery from blocking the
check from working correctly.)
Signed-off-by: Steve Beattie <steve at nxnw.org>
---
tests/regression/apparmor/onexec.sh | 6 ++++++
1 file changed, 6 insertions(+)
Index: b/tests/regression/apparmor/onexec.sh
===================================================================
--- a/tests/regression/apparmor/onexec.sh
+++ b/tests/regression/apparmor/onexec.sh
@@ -103,6 +103,12 @@ do_test()
# give the onexec process a chance to run
sleep 0.05
+ # check that task hasn't exited because change_onexec failed
+ if ! [ -d "/proc/${_pid}" ] ; then
+ checktestfg
+ return
+ fi
+
if ! check_current "${desc}" $_pid $prof ; then
checktestfg
return
More information about the AppArmor
mailing list