From 6e7e003344a70842be9834ad03fcd08762120e9a Mon Sep 17 00:00:00 2001 From: Sandro Date: Tue, 19 Jul 2022 13:52:26 +0000 Subject: [PATCH] Lexicographically sort perms in rules output of searchpolicy.py Bug: 238394904 Test: atest seamendc-test && atest CtsSecurityHostTestCases Change-Id: I841e7d5cf3616d692dcd5b749544268bcbab76c2 --- tests/searchpolicy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/searchpolicy.py b/tests/searchpolicy.py index 9d2c63664..79efecf84 100644 --- a/tests/searchpolicy.py +++ b/tests/searchpolicy.py @@ -78,10 +78,10 @@ rules = [] for r in TERules: if len(r.perms) > 1: rules.append("allow " + r.sctx + " " + r.tctx + ":" + r.tclass + " { " + - " ".join(r.perms) + " };") + " ".join(sorted(r.perms)) + " };") else: rules.append("allow " + r.sctx + " " + r.tctx + ":" + r.tclass + " " + - " ".join(r.perms) + ";") + " ".join(sorted(r.perms)) + ";") for r in sorted(rules): print(r)