2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

parser: add test for when slash should not be filtered

According to commit cce5bd6e95, the
apparmor_parser does not collapse consecutive / characters in the
beginning of paths, since it indicates posix namespaces. Add a
equality test to make sure we maintain this behavior.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia
2025-06-23 14:04:45 -03:00
parent 0f76632aec
commit 0ea74cd19d

View File

@@ -1220,6 +1220,22 @@ run_tests()
"@{BAR}=bin/ \#value
/t { /@{BAR} r, }"
# // at the beginning of the variable contents should not be filtered
verify_binary_equality "// in the beginning of variable content" \
"/t //bin/foo { }" \
"/t //bin//foo { }" \
"@{BAR}=/bin/
/t /@{BAR}/foo { }" \
"@{FOO}=/foo
/t //bin/@{FOO} { }" \
"@{BAR}=/bin/
@{FOO}=/foo
/t /@{BAR}/@{FOO} { }" \
"@{BAR}=/bin/
@{FOO}=/foo
@{ROOT}=/
/t @{ROOT}@{BAR}/@{FOO} { }"
test_parser_variables
# verify combinations of different priority levels