mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Test SWIG Python bindings for aa_query_file_path
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
parent
edb4a72c8c
commit
2ce217b873
1 changed files with 18 additions and 0 deletions
|
@ -125,6 +125,24 @@ class AAPythonBindingsTests(unittest.TestCase):
|
||||||
|
|
||||||
# extern int aa_getpeercon(int fd, char **label, char **mode);
|
# 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):
|
class AALogParsePythonBindingsTests(unittest.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue