mirror of
https://github.com/mgree/ffs.git
synced 2024-08-16 23:00:48 +03:00
added test for empty log to see if quiet was successful and rm all tmp files (#64)
This commit is contained in:
parent
2dee504113
commit
aa6c2307ee
@ -7,16 +7,18 @@ fail() {
|
|||||||
cd
|
cd
|
||||||
umount "$MNT"
|
umount "$MNT"
|
||||||
rmdir "$MNT"
|
rmdir "$MNT"
|
||||||
|
rm "$JSON" "$LOG"
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
MNT=$(mktemp -d)
|
MNT=$(mktemp -d)
|
||||||
JSON=$(mktemp)
|
JSON=$(mktemp)
|
||||||
|
LOG=$(mktemp)
|
||||||
|
|
||||||
cp ../json/object.json "$JSON"
|
cp ../json/object.json "$JSON"
|
||||||
|
|
||||||
ffs -qi -m "$MNT" "$JSON" &
|
ffs -qi -m "$MNT" "$JSON" >"$LOG" 2>&1 &
|
||||||
PID=$!
|
PID=$!
|
||||||
sleep 2
|
sleep 2
|
||||||
echo hi >"$MNT"/greeting
|
echo hi >"$MNT"/greeting
|
||||||
@ -26,6 +28,7 @@ sleep 1
|
|||||||
kill -0 $PID >/dev/null 2>&1 && fail process1
|
kill -0 $PID >/dev/null 2>&1 && fail process1
|
||||||
|
|
||||||
diff ../json/object.json "$JSON" >/dev/null && fail same
|
diff ../json/object.json "$JSON" >/dev/null && fail same
|
||||||
|
[ "$(cat $LOG )" = "" ] || fail quiet
|
||||||
|
|
||||||
ffs --readonly -m "$MNT" "$JSON" &
|
ffs --readonly -m "$MNT" "$JSON" &
|
||||||
PID=$!
|
PID=$!
|
||||||
|
Loading…
Reference in New Issue
Block a user