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)
|
|
|
|
|
|
|
|
ffs "$MNT" ../json/obj_rename.json &
|
|
|
|
PID=$!
|
|
|
|
sleep 1
|
|
|
|
cd "$MNT"
|
|
|
|
case $(ls) in
|
|
|
|
(dot*dot_*dotdot*dotdot_) ;;
|
|
|
|
(*) fail ls;;
|
|
|
|
esac
|
|
|
|
[ "$(cat dot)" = "first" ] || fail dot
|
2021-06-09 04:44:24 +03:00
|
|
|
[ "$(cat dotdot)" = "second" ] || fail dotdot
|
2021-06-09 03:46:44 +03:00
|
|
|
[ "$(cat dot_)" = "third" ] || fail dot_
|
|
|
|
[ "$(cat dotdot_)" = "fourth" ] || fail dotdot_
|
|
|
|
cd - >/dev/null 2>&1
|
|
|
|
umount "$MNT" || fail unmount
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
kill -0 $PID >/dev/null 2>&1 && fail process
|
|
|
|
|
|
|
|
rmdir "$MNT" || fail mount
|