mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-06 01:05:11 +00:00
Test SWIG Python bindings for aa_query_file_path
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
(cherry picked from commit 2ce217b873
)
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -125,6 +125,24 @@ class AAPythonBindingsTests(unittest.TestCase):
|
||||
|
||||
# extern int aa_getpeercon(int fd, char **label, char **mode);
|
||||
|
||||
# extern int aa_query_file_path_len(uint32_t mask, const char *label,
|
||||
# size_t label_len, const char *path,
|
||||
# size_t path_len, int *allowed, int *audited);
|
||||
# extern int aa_query_file_path(uint32_t mask, const char *label,
|
||||
# const char *path, int *allowed, int *audited);
|
||||
@unittest.skipUnless(libapparmor.aa_is_enabled(), "AppArmor is not enabled")
|
||||
def test_aa_query_file_path(self):
|
||||
aa_query_mask = libapparmor.AA_MAY_EXEC | libapparmor.AA_MAY_READ | libapparmor.AA_MAY_WRITE
|
||||
allowed, audited = libapparmor.aa_query_file_path(aa_query_mask, "unconfined", "/tmp/hello")
|
||||
self.assertTrue(allowed)
|
||||
self.assertFalse(audited)
|
||||
# extern int aa_query_link_path_len(const char *label, size_t label_len,
|
||||
# const char *target, size_t target_len,
|
||||
# const char *link, size_t link_len,
|
||||
# int *allowed, int *audited);
|
||||
# extern int aa_query_link_path(const char *label, const char *target,
|
||||
# const char *link, int *allowed, int *audited);
|
||||
|
||||
|
||||
class AALogParsePythonBindingsTests(unittest.TestCase):
|
||||
|
||||
|
Reference in New Issue
Block a user