Hello,

While testing the latest iteration of Ubuntu 2.8.95 preliminary packages,
I found that the magic token used in the test suite is incorrectly stored
as an int rather than unsigned long in at least two cases.

The test case currently fails with:

running changehat_misc
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 20184 Killed                  $testexec "$@" > $outfile 2>&1
Error: changehat_twice failed. Test 'CHANGEHAT (subprofile->subprofile)' was 
expected to 'pass'. Reason for failure 'killed by signal 9'

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 20190 Killed                  $testexec "$@" > $outfile 2>&1

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 20222 Killed                  $testexec "$@" > $outfile 2>&1



With this patch the output is:
running changehat_misc

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 26647 Killed                  $testexec "$@" > $outfile 2>&1

*** A 'Killed' message from bash is expected for the following test
/tmp/testlibCTcwOe/source/trusty/apparmor-2.8.95~2411/tests/regression/apparmor/prologue.inc:
 line 176: 26679 Killed                  $testexec "$@" > $outfile 2>&1



This patch looks necessary in both trunk and 2.8 branches, though I have
not tested how 2.8 actually handles now.

Signed-off-by: Seth Arnold <seth.arn...@canonical.com>

Thanks
=== modified file 'tests/regression/apparmor/changehat_twice.c'
--- tests/regression/apparmor/changehat_twice.c	2010-12-20 20:29:10 +0000
+++ tests/regression/apparmor/changehat_twice.c	2014-03-04 04:03:01 +0000
@@ -22,7 +22,8 @@
 
 int main(int argc, char *argv[])
 {
-	int rc, magic;
+	int rc;
+	unsigned long magic;
 
 	if (argc != 5){
 		fprintf(stderr, "usage: %s profile1 profile2 goodmagic|badmagic file\n",

=== modified file 'tests/regression/apparmor/changehat_wrapper.c'
--- tests/regression/apparmor/changehat_wrapper.c	2012-03-26 13:10:18 +0000
+++ tests/regression/apparmor/changehat_wrapper.c	2014-03-04 04:03:48 +0000
@@ -87,7 +87,7 @@
 	int filedes[2];
 	int c, o;
 	char buf[BUFSIZ];
-	unsigned int magic_token = SD_ID_MAGIC+1;
+	unsigned long magic_token = SD_ID_MAGIC+1;
 	int manual = 0;
 	int exit_hat = 0;
 	char * manual_string;

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to