mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 23:35:37 +00:00
IncludeRule: sort files in included directory
... instead of relying on the filesystem(!) ordering, which will look
random to both users and unittests.
Also partially revert the test changes from
c5a7bcd50e
/
https://gitlab.com/apparmor/apparmor/-/merge_requests/548 -
sorting the result only in the tests is a bad idea.
This commit is contained in:
@@ -360,7 +360,7 @@ class IncludeFullPathsTest(AATest):
|
||||
os.mkdir(empty_dir, 0o755)
|
||||
|
||||
tests = [
|
||||
# @@ will be replaced with self.profile_dir; if multiple entries, need to be sorted
|
||||
# @@ will be replaced with self.profile_dir
|
||||
('include <abstractions/base>', ['@@/abstractions/base'] ),
|
||||
# ('include "foo"', ['@@/foo'] ), # TODO: adjust logic to honor quoted vs. magic paths (and allow quoted relative paths in re_match_include_parse())
|
||||
('include "/foo/bar"', ['/foo/bar'] ),
|
||||
@@ -376,7 +376,7 @@ class IncludeFullPathsTest(AATest):
|
||||
exp2.append(path.replace('@@', self.profile_dir))
|
||||
|
||||
obj = IncludeRule._parse(params)
|
||||
self.assertEqual(sorted(obj.get_full_paths(self.profile_dir)), exp2)
|
||||
self.assertEqual(obj.get_full_paths(self.profile_dir), exp2)
|
||||
|
||||
## --- tests for IncludeRuleset --- #
|
||||
|
||||
|
Reference in New Issue
Block a user