attach_disconnected test from test_regression_testsuite of ubuntu_qrt_apparmor failed with "Unable to run test sub-executable" on Mantic

Bug #2051932 reported by Po-Hsu Lin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QA Regression Testing
New
Undecided
Unassigned
ubuntu-kernel-tests
New
Undecided
Unassigned

Bug Description

Issue found on Mantic since 6.5.0-11.11

Test failed with:
  running attach_disconnected
  Fatal Error (unix_fd_server): Unable to run test sub-executable

By hacking the tests/regression/apparmor/prologue.inc:
diff --git a/prologue.inc.orig b/prologue.inc
index 9da05f2..fafc244 100755
--- a/prologue.inc.orig
+++ b/prologue.inc
@@ -297,7 +297,9 @@ checktestfg()
 {
        # global _pfmode _known _testdesc outfile teststatus testname
        local ret expectedsig killedsig
+ echo "==== $outfile ==="
        ret=`cat $outfile 2>/dev/null`
+ echo "$ret"
        teststatus=pass

        case "$ret" in

Run tests/regression/apparmor/attach_disconnected.sh manually, you will find the test is failing because the second test generates "PASS" twice (it's not appending the result to the $outfile as we are using "$testexec "$@" > $outfile 2>&1 &" in runtestfg():

$ sudo bash attach_disconnected.sh
==== /tmp/sdtest.345049-12729-P0mta1/output.unix_fd_server ===
PASS
==== /tmp/sdtest.345049-12729-P0mta1/output.unix_fd_server ===
PASS
PASS
Fatal Error (unix_fd_server): Unable to run test sub-executable

The $ret become 'PASS\nPASS' and consequently falls in the case of testerror:
  *) testerror
          return
          ;;

Po-Hsu Lin (cypressyew)
description: updated
description: updated
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

One interesting finding is that if you run the test directly, it will just print "PASS"

$ sudo /tmp/testlib_4jpn6z_/source/mantic/apparmor-4.0.0~alpha2/tests/regression/apparmor/unix_fd_server /tmp/sdtest.346048-11072-CHR92J/file /tmp/testlib_4jpn6z_/source/mantic/apparmor-4.0.0~alpha2/tests/regression/apparmor/attach_disconnected /tmp/sdtest.346048-11072-CHR92J/unix_fd_test /dev/loop6 /tmp/sdtest.346048-11072-CHR92J/new_root/ /tmp/sdtest.346048-11072-CHR92J/new_root/put_old/
PASS

But if you redirect it into a file, you will see PASS twice:
$ sudo /tmp/testlib_4jpn6z_/source/mantic/apparmor-4.0.0~alpha2/tests/regression/apparmor/unix_fd_server /tmp/sdtest.346048-11072-CHR92J/file /tmp/testlib_4jpn6z_/source/mantic/apparmor-4.0.0~alpha2/tests/regression/apparmor/attach_disconnected /tmp/sdtest.346048-11072-CHR92J/unix_fd_test /dev/loop6 /tmp/sdtest.346048-11072-CHR92J/new_root/ /tmp/sdtest.346048-11072-CHR92J/new_root/put_old/ > /tmp/a
$ cat /tmp/a
PASS
PASS

I am not sure why this is happening for the moment.

Revision history for this message
Georgia Garcia (georgiag) wrote :

Hello!

Thanks for reporting! I fixed this issue upstream, commit https://gitlab.com/apparmor/apparmor/-/commit/dc73f0fc0b81a70e71899592f9969026f450420c
I'll add it to the QA Regression Tests.

Revision history for this message
Georgia Garcia (georgiag) wrote :
Revision history for this message
Bethany Jamison (bjamison) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.