[apparmor] [patch] AATest: don't limit diff length
Christian Boltz
apparmor at cboltz.de
Sat Apr 11 18:23:09 UTC 2015
Hello,
this patch adds setUp() to AATest that sets "self.maxDiff = None"
(unlimited). This gives us unlimited array diffs everywhere where AATest
is used.
Also replace several setUp() functions in test-regex_matches.py that
just set a class variable with setting the class variable directly.
This avoids that the shiny new AATest setUp() gets overwritten.
[ 39-aatest-maxdiff.diff ]
=== modified file utils/test/common_test.py
--- utils/test/common_test.py 2015-04-03 17:41:54.632932445 +0200
+++ utils/test/common_test.py 2015-04-11 20:06:33.272044715 +0200
@@ -39,6 +39,9 @@
class AATest(unittest.TestCase):
+ def setUp(self):
+ self.maxDiff = None
+
tests = []
class AAParseTest(unittest.TestCase):
=== modified file utils/test/test-regex_matches.py
--- utils/test/test-regex_matches.py 2015-04-03 17:41:54.634932327 +0200
+++ utils/test/test-regex_matches.py 2015-04-11 20:14:03.718860436 +0200
@@ -203,8 +203,7 @@
class AARegexCapability(AARegexTest):
'''Tests for RE_PROFILE_CAP'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_CAP
+ regex = aa.RE_PROFILE_CAP
tests = [
(' capability net_raw,', (None, None, 'net_raw', 'net_raw', None)),
@@ -218,8 +217,7 @@
class AARegexPath(AARegexTest):
'''Tests for RE_PROFILE_PATH_ENTRY'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_PATH_ENTRY
+ regex = aa.RE_PROFILE_PATH_ENTRY
tests = [
(' /tmp/foo r,',
@@ -237,8 +235,7 @@
class AARegexBareFile(AARegexTest):
'''Tests for RE_PROFILE_BARE_FILE_ENTRY'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_BARE_FILE_ENTRY
+ regex = aa.RE_PROFILE_BARE_FILE_ENTRY
tests = [
(' file,', (None, None, None, None)),
@@ -255,8 +252,7 @@
class AARegexDbus(AARegexTest):
'''Tests for RE_PROFILE_DBUS'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_DBUS
+ regex = aa.RE_PROFILE_DBUS
tests = [
(' dbus,', (None, None, 'dbus,', None)),
@@ -271,8 +267,7 @@
class AARegexMount(AARegexTest):
'''Tests for RE_PROFILE_MOUNT'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_MOUNT
+ regex = aa.RE_PROFILE_MOUNT
tests = [
(' mount,', (None, None, 'mount,', 'mount', None, None)),
@@ -295,8 +290,7 @@
class AARegexSignal(AARegexTest):
'''Tests for RE_PROFILE_SIGNAL'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_SIGNAL
+ regex = aa.RE_PROFILE_SIGNAL
tests = [
(' signal,', (None, None, 'signal,', None)),
@@ -321,8 +315,7 @@
class AARegexPtrace(AARegexTest):
'''Tests for RE_PROFILE_PTRACE'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_PTRACE
+ regex = aa.RE_PROFILE_PTRACE
tests = [
(' ptrace,', (None, None, 'ptrace,', None)),
@@ -343,8 +336,7 @@
class AARegexPivotRoot(AARegexTest):
'''Tests for RE_PROFILE_PIVOT_ROOT'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_PIVOT_ROOT
+ regex = aa.RE_PROFILE_PIVOT_ROOT
tests = [
(' pivot_root,', (None, None, 'pivot_root,', None)),
@@ -370,8 +362,7 @@
class AARegexUnix(AARegexTest):
'''Tests for RE_PROFILE_UNIX'''
- def setUp(self):
- self.regex = aa.RE_PROFILE_UNIX
+ regex = aa.RE_PROFILE_UNIX
tests = [
(' unix,', (None, None, 'unix,', None)),
@@ -395,8 +386,7 @@
class AANamedRegexProfileStart_2(AANamedRegexTest):
'''Tests for RE_PROFILE_START'''
- def setUp(self):
- self.regex = RE_PROFILE_START
+ regex = RE_PROFILE_START
tests = [
('/bin/foo ', False), # no '{'
Regards,
Christian Boltz
--
> Can I get some more info from the machine? 'dmesg', 'cat
> /proc/bus/input/devices', etc ...
Sorry, there's no command calles "etc" on my machine... ;-)
[Rasmus Plewe on https://bugzilla.novell.com/show_bug.cgi?id=176022]
More information about the AppArmor
mailing list