1
1
mirror of https://github.com/mgree/ffs.git synced 2024-10-26 20:09:03 +03:00
ffs/tests/toml_to_json.sh

30 lines
452 B
Bash
Raw Normal View History

#!/bin/sh
fail() {
echo FAILED: $1
if [ "$MNT" ]
then
cd
umount "$MNT"
rmdir "$MNT"
rm "$TGT"
fi
exit 1
}
MNT=$(mktemp -d)
TGT=$(mktemp)
ffs --source toml --target json -o "$TGT" "$MNT" ../toml/single.toml &
PID=$!
sleep 2
umount "$MNT" || fail unmount1
sleep 1
kill -0 $PID >/dev/null 2>&1 && fail process1
diff "$TGT" ../json/single.json || fail diff
rmdir "$MNT" || fail mount
rm "$TGT"