From 1cccb93faac6cab2720a0c731c35a57d12d39c06 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Tue, 16 Aug 2022 19:25:49 +0000 Subject: [PATCH] Merge Set (instead of compare) exresult Interestingly this accidentally worked because `if exresult` is true for both a non-empty string ("PASS") as well as a real `True` value. Found by Mark Grassi as part of https://gitlab.com/apparmor/apparmor/-/merge_requests/906 I propose this patch for all branches. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/907 Approved-by: Jon Tourville Merged-by: Christian Boltz (cherry picked from commit c06ea77445683898df690f09ea6277240b1a33bb) 5a2fb856 Set (instead of compare) exresult --- utils/test/test-parser-simple-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/test/test-parser-simple-tests.py b/utils/test/test-parser-simple-tests.py index 0d57552b3..c9c2b8a07 100644 --- a/utils/test/test-parser-simple-tests.py +++ b/utils/test/test-parser-simple-tests.py @@ -427,7 +427,7 @@ def parse_test_profiles(file_with_path): if line.startswith('#=EXRESULT '): exresult = line.split()[1] if exresult == 'PASS': - exresult == True + exresult = True exresult_found = True elif exresult == 'FAIL': exresult = False