mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
Adjust test-signal_parse.py to use SignalRule
The tests in test-signal_parse.py used aa.parse_signal_rule(), which is based on Raw_Signal_Rule (= regex check + "just store it"). This patch changes the tests to test against SignalRule.get_clean(). Since get_clean() does some cleanups, the expected result slightly differs from the original rule. Finally switch to the AATest class and setup_all_loops() we use in most tests. Also change test-regex_matches.py to import RE_PROFILE_SIGNAL directly from apparmor.regex instead of apparmor.aa (where it will vanish soon). Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import unittest
|
||||
from common_test import AATest, setup_all_loops
|
||||
from apparmor.common import AppArmorBug, AppArmorException
|
||||
|
||||
from apparmor.regex import strip_quotes, parse_profile_start_line, re_match_include, RE_PROFILE_START, RE_PROFILE_CAP
|
||||
from apparmor.regex import strip_quotes, parse_profile_start_line, re_match_include, RE_PROFILE_START, RE_PROFILE_CAP, RE_PROFILE_SIGNAL
|
||||
|
||||
|
||||
class AARegexTest(AATest):
|
||||
@@ -296,7 +296,7 @@ class AARegexSignal(AARegexTest):
|
||||
'''Tests for RE_PROFILE_SIGNAL'''
|
||||
|
||||
def AASetup(self):
|
||||
self.regex = aa.RE_PROFILE_SIGNAL
|
||||
self.regex = RE_PROFILE_SIGNAL
|
||||
|
||||
tests = [
|
||||
(' signal,', (None, None, 'signal,', None, None)),
|
||||
|
Reference in New Issue
Block a user