2021-06-21 04:20:06 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
fail() {
|
|
|
|
echo FAILED: $1
|
|
|
|
if [ "$MNT" ]
|
|
|
|
then
|
|
|
|
cd
|
|
|
|
umount "$MNT"
|
|
|
|
rmdir "$MNT"
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
MNT=$(mktemp -d)
|
|
|
|
|
2021-06-24 17:06:38 +03:00
|
|
|
cat ../json/object.json | ffs -m "$MNT" &
|
2021-06-21 04:20:06 +03:00
|
|
|
PID=$!
|
|
|
|
sleep 2
|
|
|
|
cd "$MNT"
|
|
|
|
case $(ls) in
|
|
|
|
(eyes*fingernails*human*name) ;;
|
|
|
|
(*) fail ls;;
|
|
|
|
esac
|
|
|
|
[ "$(cat name)" = "Michael Greenberg" ] || fail name
|
|
|
|
[ "$(cat eyes)" -eq 2 ] || fail eyes
|
|
|
|
[ "$(cat fingernails)" -eq 10 ] || fail fingernails
|
|
|
|
[ "$(cat human)" = "true" ] || fail human
|
|
|
|
cd - >/dev/null 2>&1
|
|
|
|
umount "$MNT" || fail unmount
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
kill -0 $PID >/dev/null 2>&1 && fail process
|
|
|
|
|
|
|
|
rmdir "$MNT" || fail mount
|