Skip to content

Commit 9d51f3d

Browse files
committed
tests: make all prompting integration test variants use prompt-requester
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
1 parent d875236 commit 9d51f3d

51 files changed

Lines changed: 102 additions & 102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/lib/snaps/prompt-requester/meta/snap.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ apps:
77
plugs:
88
- home
99
- camera
10+
home:
11+
command: bin/cat
12+
plugs:
13+
- home
1014
wait-for:
1115
command: bin/wait-for
1216
plugs:

tests/main/apparmor-prompting-integration-tests/create_multiple_actioned_by_other_pid_always_allow.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 1,
33
"prompt-filter": {
4-
"snap": "prompting-client",
4+
"snap": "prompt-requester",
55
"interface": "home",
66
"constraints": {
77
"path": "$BASE_PATH/.*"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ if [ -z "$TIMEOUT" ] ; then
1616
TIMEOUT=10
1717
fi
1818

19-
WRITABLE="$(snap run --shell prompting-client.scripted -c 'cd ~; pwd')/$(basename "$TEST_DIR")"
20-
snap run --shell prompting-client.scripted -c "mkdir -p $WRITABLE"
19+
WRITABLE="$(snap run --shell prompt-requester.home -c 'cd ~; pwd')/$(basename "$TEST_DIR")"
20+
snap run --shell prompt-requester.home -c "mkdir -p $WRITABLE"
2121

2222
for dir in test1 test2 test3 ; do
2323
mkdir -p "${TEST_DIR}/${dir}"
2424
name="${dir}/file.txt"
2525
echo "Attempt to create $name in the background"
26-
snap run --shell prompting-client.scripted -c "touch ${WRITABLE}/${dir}-started; echo $name is written > ${TEST_DIR}/${name}; touch ${WRITABLE}/${dir}-finished" &
26+
snap run --shell prompt-requester.home -c "touch ${WRITABLE}/${dir}-started; echo $name is written > ${TEST_DIR}/${name}; touch ${WRITABLE}/${dir}-finished" &
2727
if ! timeout --verbose "$TIMEOUT" sh -c "while ! [ -f '${WRITABLE}/${dir}-started' ] ; do sleep 0.1 ; done" ; then
2828
echo "failed to start create of $name within timeout period"
2929
exit 1
@@ -41,7 +41,7 @@ done
4141

4242
echo "Attempt to create test4/file.txt (for which client will reply)"
4343
mkdir -p "${TEST_DIR}/test4"
44-
snap run --shell prompting-client.scripted -c "echo test4/file.txt is written > ${TEST_DIR}/test4/file.txt"
44+
snap run --shell prompt-requester.home -c "echo test4/file.txt is written > ${TEST_DIR}/test4/file.txt"
4545

4646
# Wait for the client to write its result and exit
4747
for i in $(seq "$TIMEOUT") ; do

tests/main/apparmor-prompting-integration-tests/create_multiple_actioned_by_other_pid_always_deny.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 1,
33
"prompt-filter": {
4-
"snap": "prompting-client",
4+
"snap": "prompt-requester",
55
"interface": "home",
66
"constraints": {
77
"path": "$BASE_PATH/.*"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ if [ -z "$TIMEOUT" ] ; then
1616
TIMEOUT=10
1717
fi
1818

19-
WRITABLE="$(snap run --shell prompting-client.scripted -c 'cd ~; pwd')/$(basename "$TEST_DIR")"
20-
snap run --shell prompting-client.scripted -c "mkdir -p $WRITABLE"
19+
WRITABLE="$(snap run --shell prompt-requester.home -c 'cd ~; pwd')/$(basename "$TEST_DIR")"
20+
snap run --shell prompt-requester.home -c "mkdir -p $WRITABLE"
2121

2222
for dir in test1 test2 test3 ; do
2323
mkdir -p "${TEST_DIR}/${dir}"
2424
name="${dir}/file.txt"
2525
echo "Attempt to create $name in the background"
26-
snap run --shell prompting-client.scripted -c "touch ${WRITABLE}/${dir}-started; echo $name is written > ${TEST_DIR}/${name}; touch ${WRITABLE}/${dir}-finished" &
26+
snap run --shell prompt-requester.home -c "touch ${WRITABLE}/${dir}-started; echo $name is written > ${TEST_DIR}/${name}; touch ${WRITABLE}/${dir}-finished" &
2727
if ! timeout --verbose "$TIMEOUT" sh -c "while ! [ -f '${WRITABLE}/${dir}-started' ] ; do sleep 0.1 ; done" ; then
2828
echo "failed to start create of $name within timeout period"
2929
exit 1
@@ -41,7 +41,7 @@ done
4141

4242
echo "Attempt to create test4/file.txt (for which client will reply)"
4343
mkdir -p "${TEST_DIR}/test4"
44-
snap run --shell prompting-client.scripted -c "echo test4/file.txt is written > ${TEST_DIR}/test4/file.txt" || true
44+
snap run --shell prompt-requester.home -c "echo test4/file.txt is written > ${TEST_DIR}/test4/file.txt" || true
4545

4646
# Wait for the client to write its result and exit
4747
for i in $(seq "$TIMEOUT") ; do

tests/main/apparmor-prompting-integration-tests/create_multiple_allow.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 1,
33
"prompt-filter": {
4-
"snap": "prompting-client",
4+
"snap": "prompt-requester",
55
"interface": "home",
66
"constraints": {
77
"path": "$BASE_PATH/.*"

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

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

1212
for name in test1.txt test2.md fail.txt test3.pdf ; do
1313
echo "Attempt to write $name"
14-
snap run --shell prompting-client.scripted -c "echo $name is written > ${TEST_DIR}/${name}" || true
14+
snap run --shell prompt-requester.home -c "echo $name is written > ${TEST_DIR}/${name}" || true
1515
done
1616

1717
# Wait for the client to write its result and exit

tests/main/apparmor-prompting-integration-tests/create_multiple_deny-temporal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 1,
33
"prompt-filter": {
4-
"snap": "prompting-client",
4+
"snap": "prompt-requester",
55
"interface": "home",
66
"constraints": {
77
"path": "$BASE_PATH/.*"

tests/main/apparmor-prompting-integration-tests/create_multiple_deny.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 1,
33
"prompt-filter": {
4-
"snap": "prompting-client",
4+
"snap": "prompt-requester",
55
"interface": "home",
66
"constraints": {
77
"path": "$BASE_PATH/.*"

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

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

1212
for name in test1.txt test2.md succeed.txt test3.pdf ; do
1313
echo "Attempt to write $name"
14-
snap run --shell prompting-client.scripted -c "echo $name is written > ${TEST_DIR}/${name}" || true
14+
snap run --shell prompt-requester.home -c "echo $name is written > ${TEST_DIR}/${name}" || true
1515
done
1616

1717
# Wait for the client to write its result and exit

0 commit comments

Comments
 (0)