Skip to content

Commit

Permalink
tests: implement TODO in main/writable-areas from 2016
Browse files Browse the repository at this point in the history
Apparently we never enabled the code to check if we can write to
SNAP_USER_COMMON. Better late than never.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
  • Loading branch information
zyga committed Apr 24, 2024
1 parent 8a0b9b2 commit 28aed3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions tests/main/writable-areas/data-writer/bin/write-data
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ echo "hello common" > "$SNAP_COMMON/$1"
echo "Writing to SNAP_DATA"
echo "hello data" > "$SNAP_DATA/$1"

# TODO: As soon as `snap run` is used (which creates this directory), uncomment
# the following lines:
# echo "Writing to SNAP_USER_COMMON"
# echo "hello user common" > $SNAP_USER_COMMON/$1
echo "Writing to SNAP_USER_COMMON"
echo "hello user common" > $SNAP_USER_COMMON/$1

echo "Writing to SNAP_USER_DATA"
echo "hello user data" > "$SNAP_USER_DATA/$1"
8 changes: 2 additions & 6 deletions tests/main/writable-areas/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ execute: |
[ -f /var/snap/data-writer/x1/from-app ]
[ -f /var/snap/data-writer/common/from-app ]
[ -f /root/snap/data-writer/x1/from-app ]
# TODO: As soon as `snap run` is used (which creates this directory),
# uncomment the following line:
#[ -f /root/snap/data-writer/common/from-app ]
[ -f /root/snap/data-writer/common/from-app ]
echo "Waiting for data writer service to finish..."
retry -n 20 --wait 1 sh -c 'test -f /root/snap/data-writer/x1/from-service'
echo "Services can write to writable areas"
[ -f /var/snap/data-writer/x1/from-service ]
[ -f /var/snap/data-writer/common/from-service ]
# TODO: As soon as `snap run` is used (which creates this directory),
# uncomment the following line:
#[ -f /root/snap/data-writer/common/from-service ]
[ -f /root/snap/data-writer/common/from-service ]

0 comments on commit 28aed3a

Please sign in to comment.