[apparmor] [patch] complete test coverage for FileRule

Christian Boltz apparmor at cboltz.de
Sun Oct 9 14:06:50 UTC 2016


Hello,

this patch adds a testcase with exec-only permissions (which get ignored by
get_perms_for_path()) to increase FileRule test coverage to 100%.


[ 01-test-file-coverage.diff ]

=== modified file 'utils/test/test-file.py'
--- utils/test/test-file.py     2016-10-01 18:57:09 +0000
+++ utils/test/test-file.py     2016-10-09 14:02:39 +0000
@@ -965,6 +965,7 @@
         (('/foo/bar',                           False,  True ), {'allow': {'all': set(),         'owner': set()  },  'deny': {'all': set(),          'owner': set()   }, 'paths': set()                                                                         }),
         (('/etc/foo/dovecot-deny.conf',         False,  True ), {'allow': {'all': set(),         'owner': set()  },  'deny': {'all': {'r'     },     'owner': set()   }, 'paths': {'/etc/foo/dovecot-deny.conf'                                             }   }),
         (('/etc/foo/foo.conf',                  False,  True ), {'allow': {'all': set(),         'owner': set()  },  'deny': {'all': set(),          'owner': set()   }, 'paths': set()                                                                         }),
+        (('/usr/lib/dovecot/config',            False,  False), {'allow': {'all': set(),         'owner': set()  },  'deny': {'all': set(),          'owner': set()   }, 'paths': set()                     }),  # exec perms are not honored by get_perms_for_path()
     ]
 
     def _run_test(self, params, expected):





Regards,

Christian Boltz
-- 
Ich sehe schon, die meiste manpower des Projektes fließt derzeit in die
Gestaltung der "--help"-Option.  Ich glaube,  wir greifen den Vorschlag
von Christian auf und richten mehrere Hilfsseiten ein.  Gleicher Inhalt,
andere Formatierung. :-)))                    [Ratti in fontlinge-devel]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20161009/f7813b50/attachment.pgp>


More information about the AppArmor mailing list