From 37506e7524b16ce65986824de3c2f214334f3931 Mon Sep 17 00:00:00 2001 From: Oliver Calder Date: Fri, 11 Oct 2024 20:31:50 -0500 Subject: [PATCH] tests: fix prompting tests which queue up creates and reply single Signed-off-by: Oliver Calder --- ...reate_multiple_not_actioned_by_other_pid_single_allow.sh | 1 + ...create_multiple_not_actioned_by_other_pid_single_deny.sh | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_allow.sh b/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_allow.sh index 7472c9ea2559..95b60c4d73a4 100644 --- a/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_allow.sh +++ b/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_allow.sh @@ -42,6 +42,7 @@ snap run --shell prompting-client.scripted -c "echo test4/file.txt is written > for dir in test1 test2 test3 ; do name="${dir}/file.txt" echo "Check that create for $name was not actioned by reply for test4/file.txt" + # NOTE: if one checks [ -f "${TEST_DIR}/${name}" ], it may kill the blocked create if [ -f "${WRITABLE}/${dir}-finished" ] ; then echo "create of $name finished before create for test5/file.txt started" exit 1 diff --git a/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_deny.sh b/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_deny.sh index 72f5b292b63d..72672a94a523 100644 --- a/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_deny.sh +++ b/tests/main/apparmor-prompting-integration-tests/create_multiple_not_actioned_by_other_pid_single_deny.sh @@ -39,14 +39,10 @@ echo "Attempt to create test4/file.txt (for which client will reply deny single) mkdir -p "${TEST_DIR}/test4" snap run --shell prompting-client.scripted -c "echo test4/file.txt is written > ${TEST_DIR}/test4/file.txt" -echo "Check that original files have not yet been created" for dir in test1 test2 test3 ; do name="${dir}/file.txt" - if [ -f "${TEST_DIR}/${name}" ] ; then - echo "file creation unexpectedly succeeded early for $name" - exit 1 - fi echo "Check that create for $name was not actioned by reply for test4/file.txt" + # NOTE: if one checks [ -f "${TEST_DIR}/${name}" ], it may kill the blocked create if [ -f "${WRITABLE}/${dir}-finished" ] ; then echo "create of $name finished before create for test5/file.txt started" exit 1