2021-06-09 03:46:44 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
fail() {
|
|
|
|
echo FAILED: $1
|
|
|
|
if [ "$MNT" ]
|
|
|
|
then
|
2021-06-13 22:09:39 +03:00
|
|
|
cd
|
2021-06-09 04:44:24 +03:00
|
|
|
umount "$MNT"
|
2021-06-09 03:46:44 +03:00
|
|
|
rmdir "$MNT"
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
MNT=$(mktemp -d)
|
|
|
|
|
2021-06-24 17:06:38 +03:00
|
|
|
ffs -m "$MNT" ../json/obj_rename.json &
|
2021-06-09 03:46:44 +03:00
|
|
|
PID=$!
|
2021-06-14 18:38:51 +03:00
|
|
|
sleep 2
|
2021-07-08 18:55:44 +03:00
|
|
|
case $(ls "$MNT") in
|
|
|
|
(_.*_..*dot*dotdot) ;;
|
2021-06-09 03:46:44 +03:00
|
|
|
(*) fail ls;;
|
|
|
|
esac
|
2021-07-08 18:55:44 +03:00
|
|
|
[ "$(cat $MNT/_.)" = "first" ] || fail .
|
|
|
|
[ "$(cat $MNT/_..)" = "second" ] || fail ..
|
|
|
|
[ "$(cat $MNT/dot)" = "third" ] || fail dot
|
|
|
|
[ "$(cat $MNT/dotdot)" = "fourth" ] || fail dotdot
|
2021-06-09 03:46:44 +03:00
|
|
|
umount "$MNT" || fail unmount
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
kill -0 $PID >/dev/null 2>&1 && fail process
|
|
|
|
|
|
|
|
rmdir "$MNT" || fail mount
|