Added new permanent permissions tests.

This commit is contained in:
BritishTeapot 2025-03-30 19:07:32 +02:00
parent 7e111b16b7
commit 608943d685
2 changed files with 15 additions and 2 deletions

View File

@ -20,4 +20,4 @@ else
fi fi
fi fi
exit -1 # TODO: call actual zenity here exit 255 # TODO: call actual zenity here

View File

@ -2,6 +2,7 @@
# clean what was left from previous tests # clean what was left from previous tests
rm -f ./.pt.db
rm -rf ./protected rm -rf ./protected
mkdir protected mkdir protected
touch ./protected/do-not-remove ./protected/should-be-removed ./protected/truth ./protected/perm000 ./protected/perm777 ./protected/should-be-renamed ./protected/do-not-rename touch ./protected/do-not-remove ./protected/should-be-removed ./protected/truth ./protected/perm000 ./protected/perm777 ./protected/should-be-renamed ./protected/do-not-rename
@ -17,7 +18,7 @@ PATH="$(realpath ./mock/):$PATH"
echo "Run $(date -u +%Y-%m-%dT%H:%M:%S) " echo "Run $(date -u +%Y-%m-%dT%H:%M:%S) "
valgrind -s ../build/icfs -o default_permissions ./protected & valgrind -s ../build/icfs -o default_permissions ./protected &
sleep 1 sleep 5
# create files # create files
@ -89,6 +90,18 @@ chmod 000 ./protected/perm000 2>/dev/null &&
echo "[ICFS-TEST]: OK" || echo "[ICFS-TEST]: OK" ||
echo "[ICFS-TEST]: chmod cannot change permissions of protected/perm000 despite access being permitted!" # OK echo "[ICFS-TEST]: chmod cannot change permissions of protected/perm000 despite access being permitted!" # OK
# create files with permanent permissions
zenity --set-fake-response yes
touch ./protected/friendly 2>/dev/null &&
echo "[ICFS-TEST]: OK" ||
echo "[ICFS-TEST]: touch cannot create protected/friendly despite access being permitted!" # OK
zenity --set-fake-response no # this should be ignored
touch ./protected/friendly-again 2>/dev/null &&
echo "[ICFS-TEST]: OK" ||
echo "[ICFS-TEST]: touch cannot create protected/friendly-again despite access being permitted!" # OK
# unmount # unmount
sleep 0.5 sleep 0.5