diff --git a/parser/tst/equality.sh b/parser/tst/equality.sh index 5ee69b079..abce2e920 100755 --- a/parser/tst/equality.sh +++ b/parser/tst/equality.sh @@ -879,28 +879,6 @@ verify_binary_equality "'$p1'x'$p2' link rules slash filtering" \ @{BAR}=/mnt/ /t { $p2 link @{FOO}/foo -> @{BAR}/bar, }" -verify_binary_equality "'$p1'x'$p2' attachment slash filtering" \ - "/t /bin/foo { }" \ - "/t /bin//foo { }" \ - "@{BAR}=/bin/ - /t @{BAR}/foo { }" \ - "@{FOO}=/foo - /t /bin/@{FOO} { }" \ - "@{BAR}=/bin/ - @{FOO}=/foo - /t @{BAR}/@{FOO} { }" - -# verify comment at end of variable assignment is not treated as a value -verify_binary_equality "comment at end of set var" \ - "/t { /bin/ r, }" \ - "@{BAR}=/bin/ #a tail comment - /t { @{BAR} r, }" - -verify_binary_equality "value like comment at end of set var" \ - "/t { /{bin/,#value} r, }" \ - "@{BAR}=bin/ \#value - /t { /@{BAR} r, }" - # This can potentially fail as ideally it requires a better dfa comparison # routine as it can generates hormomorphic dfas. The enumeration of the @@ -912,12 +890,6 @@ verify_binary_equality "'$p1'x'$p2' mount specific deny doesn't affect non-overl "/t { $p2 audit deny mount /s/** -> /**, mount options=bind /e/ -> /**, }" -if [ $fails -ne 0 ] || [ $errors -ne 0 ] -then - printf "ERRORS: %d\nFAILS: %d\n" $errors $fails 1>&2 - exit $((fails + errors)) -fi - ## priority override equivalence tests ## compare single rule, to multi-rule profile where one rule overrides @@ -1082,6 +1054,29 @@ run_tests() "/t { /a r, }" \ "/t { priority=-1 audit deny /* rwxlk, /a r, }" + # Tests that do not use priority keywords at all + + verify_binary_equality "attachment slash filtering" \ + "/t /bin/foo { }" \ + "/t /bin//foo { }" \ + "@{BAR}=/bin/ + /t @{BAR}/foo { }" \ + "@{FOO}=/foo + /t /bin/@{FOO} { }" \ + "@{BAR}=/bin/ + @{FOO}=/foo + /t @{BAR}/@{FOO} { }" + # verify comment at end of variable assignment is not treated as a value + verify_binary_equality "comment at end of set var" \ + "/t { /bin/ r, }" \ + "@{BAR}=/bin/ #a tail comment + /t { @{BAR} r, }" + + verify_binary_equality "value like comment at end of set var" \ + "/t { /{bin/,#value} r, }" \ + "@{BAR}=bin/ \#value + /t { /@{BAR} r, }" + # verify combinations of different priority levels # for single rule comparisons, rules should keep same expected result # even when the priorities are different. @@ -1109,8 +1104,13 @@ run_tests() done [ -z "${verbose}" ] && printf "\n" - printf "PASS\n" - exit 0 + if [ $fails -ne 0 ] || [ $errors -ne 0 ]; then + printf "ERRORS: %d\nFAILS: %d\n" $errors $fails 1>&2 + exit $((fails + errors)) + else + printf "PASS\n" + exit 0 + fi }