Skip to content

Commit bcf60fb

Browse files
committed
fixup! tests: fix pattern uniqueness checks in prompting integration tests
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
1 parent cb6279e commit bcf60fb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/main/apparmor-prompting-integration-tests/download_file_defaults.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if [ "$CLIENT_OUTPUT" != "success" ] ; then
4949
fi
5050
# Furthermore, rules with identical path patterns are merged, so we don't
5151
# expect any rules with duplicate path patterns.
52-
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1'
52+
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1[[:space:]]'
5353
! snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep -q '^[[:space:]]*[^1[[:space:]]]'
5454

5555
TEST_OUTPUT="$(cat "${TEST_DIR}/Downloads/test.txt")"

tests/main/apparmor-prompting-integration-tests/download_file_safer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fi
4848

4949
# Rules with identical path patterns are merged, so we don't expect any rules
5050
# with duplicate path patterns.
51-
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1'
51+
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1[[:space:]]'
5252
! snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep -q '^[[:space:]]*[^1[[:space:]]]'
5353

5454
TEST_OUTPUT="$(cat "${TEST_DIR}/Downloads/test.txt")"

0 commit comments

Comments
 (0)