1
1
mirror of https://github.com/mgree/ffs.git synced 2024-07-14 23:00:24 +03:00

added test for empty log to see if quiet was successful and rm all tmp files (#64)

This commit is contained in:
Dan Liu 2023-07-21 21:41:34 -04:00 committed by GitHub
parent 2dee504113
commit aa6c2307ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,16 +7,18 @@ fail() {
cd
umount "$MNT"
rmdir "$MNT"
rm "$JSON" "$LOG"
fi
exit 1
}
MNT=$(mktemp -d)
JSON=$(mktemp)
LOG=$(mktemp)
cp ../json/object.json "$JSON"
ffs -qi -m "$MNT" "$JSON" &
ffs -qi -m "$MNT" "$JSON" >"$LOG" 2>&1 &
PID=$!
sleep 2
echo hi >"$MNT"/greeting
@ -26,6 +28,7 @@ sleep 1
kill -0 $PID >/dev/null 2>&1 && fail process1
diff ../json/object.json "$JSON" >/dev/null && fail same
[ "$(cat $LOG )" = "" ] || fail quiet
ffs --readonly -m "$MNT" "$JSON" &
PID=$!