mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
utils: test in test-minitools for resiliency against unparseable profiles
Since all the tools that load profiles go through the same module, this should be sufficient as a first pass. Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
@@ -66,6 +66,17 @@ class MinitoolsTest(AATest):
|
|||||||
None,
|
None,
|
||||||
'Audit flag could not be removed in profile ' + self.local_profilename)
|
'Audit flag could not be removed in profile ' + self.local_profilename)
|
||||||
|
|
||||||
|
def test_audit_with_garbage(self):
|
||||||
|
# Inject a garbage profile into the profile directory and check that
|
||||||
|
# test_audit still passes
|
||||||
|
with open(self.profile_dir + "/duchamps_readymades", "w") as fil:
|
||||||
|
fil.write("a porcelain toilet rotated on its side and signed")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.test_audit()
|
||||||
|
finally:
|
||||||
|
os.unlink(self.profile_dir + "/duchamps_readymades")
|
||||||
|
|
||||||
def test_complain(self):
|
def test_complain(self):
|
||||||
# Set test profile to complain mode and check if it was correctly set
|
# Set test profile to complain mode and check if it was correctly set
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
|
Reference in New Issue
Block a user