mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Merge branch 'cboltz-test-parse-profile-start' into 'master'
parse_profile_start: test with un-named profile See merge request apparmor/apparmor!367 Acked-by: Eric Chiang <ericchiang@google.com>
This commit is contained in:
commit
c6128da1fc
1 changed files with 6 additions and 1 deletions
|
@ -507,7 +507,7 @@ class AaTest_is_skippable_dir(AATest):
|
|||
class AaTest_parse_profile_start(AATest):
|
||||
def _parse(self, line, profile, hat):
|
||||
return parse_profile_start(line, 'somefile', 1, profile, hat)
|
||||
# (profile, hat, flags, in_contained_hat, pps_set_profile, pps_set_hat_external)
|
||||
# (profile, hat, attachment, xattrs, flags, in_contained_hat, pps_set_profile, pps_set_hat_external)
|
||||
|
||||
def test_parse_profile_start_01(self):
|
||||
result = self._parse('/foo {', None, None)
|
||||
|
@ -549,6 +549,11 @@ class AaTest_parse_profile_start(AATest):
|
|||
expected = ('/foo', '/foo', None, 'user.bar=bar user.foo=*', None, False, False, False)
|
||||
self.assertEqual(result, expected)
|
||||
|
||||
def test_parse_profile_start_09(self):
|
||||
result = self._parse('/usr/bin/xattrs-test xattrs=(myvalue="foo.bar") {', None, None)
|
||||
expected = ('/usr/bin/xattrs-test', '/usr/bin/xattrs-test', None, 'myvalue="foo.bar"', None, False, False, False)
|
||||
self.assertEqual(result, expected)
|
||||
|
||||
def test_parse_profile_start_unsupported_01(self):
|
||||
with self.assertRaises(AppArmorException):
|
||||
self._parse('/foo///bar///baz {', None, None) # XXX deeply nested external hat
|
||||
|
|
Loading…
Add table
Reference in a new issue