mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
utils/test/test-aa.py: skip tests that break with python2.7
For reasons that aren't entirely clear, the action to set apparmor.aa.cfg['settings']['ldd'] to './fake_ldd' does not actually work on python2.7, get_reqs() tries to use /usr/bin/ldd anyway (printing out the contents of apparmor.aa.cfg['settings']['ldd'] after the set operation shows it to still contain '/usr/bin/ldd' o.O). Therefore, skip these two tests when running under python2.7. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: Christian Boltz <apparmor@cboltz.de> Bug: https://launchpad.net/bugs/1522938
This commit is contained in:
parent
5cdc45deab
commit
4492e7cb2d
1 changed files with 7 additions and 0 deletions
|
@ -14,6 +14,7 @@ from common_test import AATest, setup_all_loops
|
|||
from common_test import read_file, write_file
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import apparmor.aa # needed to set global vars in some tests
|
||||
from apparmor.aa import (check_for_apparmor, get_output, get_reqs, get_interpreter_and_abstraction, create_new_profile,
|
||||
|
@ -93,6 +94,12 @@ class AATest_get_reqs(AATest):
|
|||
]
|
||||
|
||||
def _run_test(self, params, expected):
|
||||
# for some reason, setting the ldd config option does not get
|
||||
# honored in python2.7
|
||||
# XXX KILL when python 2.7 is dropped XXX
|
||||
if sys.version_info[0] < 3:
|
||||
print("Skipping on python < 3.x")
|
||||
return
|
||||
apparmor.aa.cfg['settings']['ldd'] = './fake_ldd'
|
||||
|
||||
self.assertEqual(get_reqs(params), expected)
|
||||
|
|
Loading…
Add table
Reference in a new issue