mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-29 13:28:19 +00:00
make test-aa-notify test_help_contents () less strict
Python 3.10 generates a slightly different --help output. Fixes https://gitlab.com/apparmor/apparmor/-/issues/220
This commit is contained in:
parent
583e1905e9
commit
39f4132ab9
@ -148,13 +148,15 @@ Feb 4 13:40:38 XPS-13-9370 kernel: [128552.880347] audit: type=1400 audit({epoc
|
|||||||
'''Test output of help text'''
|
'''Test output of help text'''
|
||||||
|
|
||||||
expected_return_code = 0
|
expected_return_code = 0
|
||||||
expected_output_is = \
|
expected_output_1 = \
|
||||||
'''usage: aa-notify [-h] [-p] [--display DISPLAY] [-f FILE] [-l] [-s NUM] [-v]
|
'''usage: aa-notify [-h] [-p] [--display DISPLAY] [-f FILE] [-l] [-s NUM] [-v]
|
||||||
[-u USER] [-w NUM] [--debug]
|
[-u USER] [-w NUM] [--debug]
|
||||||
|
|
||||||
Display AppArmor notifications or messages for DENIED entries.
|
Display AppArmor notifications or messages for DENIED entries.
|
||||||
|
'''
|
||||||
|
|
||||||
optional arguments:
|
expected_output_2 = \
|
||||||
|
'''
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-p, --poll poll AppArmor logs and display notifications
|
-p, --poll poll AppArmor logs and display notifications
|
||||||
--display DISPLAY set the DISPLAY environment variable (might be needed if
|
--display DISPLAY set the DISPLAY environment variable (might be needed if
|
||||||
@ -174,8 +176,9 @@ optional arguments:
|
|||||||
return_code, output = cmd(aanotify_bin + ['--help'])
|
return_code, output = cmd(aanotify_bin + ['--help'])
|
||||||
result = 'Got return code %d, expected %d\n' % (return_code, expected_return_code)
|
result = 'Got return code %d, expected %d\n' % (return_code, expected_return_code)
|
||||||
self.assertEqual(expected_return_code, return_code, result + output)
|
self.assertEqual(expected_return_code, return_code, result + output)
|
||||||
result = 'Got output "%s", expected "%s"\n' % (output, expected_output_is)
|
|
||||||
self.assertEqual(expected_output_is, output, result + output)
|
self.assertIn(expected_output_1, output)
|
||||||
|
self.assertIn(expected_output_2, output)
|
||||||
|
|
||||||
def test_entries_since_100_days(self):
|
def test_entries_since_100_days(self):
|
||||||
'''Test showing log entries since 100 days'''
|
'''Test showing log entries since 100 days'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user