2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

Use *Rule.match() in aa.py

Replace usage of RE_PROFILE_CAP and RE_PROFILE_NETWORK with
CapabilityRule.match() and NetworkRule.match() calls.
This also means aa.py doesn't need to import those regexes anymore.

As a side effect of this change, test-regex_matches.py needs a small
fix because it imported RE_PROFILE_CAP from apparmor.aa instead of
apparmor.regex.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
Christian Boltz
2015-04-26 22:02:01 +02:00
parent 6dade51f92
commit c9fe061525
2 changed files with 8 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ import unittest
from common_test import AATest, setup_all_loops
from apparmor.common import AppArmorBug
from apparmor.regex import strip_quotes, parse_profile_start_line, RE_PROFILE_START
from apparmor.regex import strip_quotes, parse_profile_start_line, RE_PROFILE_START, RE_PROFILE_CAP
class AARegexTest(AATest):
@@ -204,7 +204,7 @@ class AARegexCapability(AARegexTest):
'''Tests for RE_PROFILE_CAP'''
def setUp(self):
self.regex = aa.RE_PROFILE_CAP
self.regex = RE_PROFILE_CAP
tests = [
(' capability net_raw,', (None, None, 'net_raw', 'net_raw', None)),