Skip to content

Commit c571f5d

Browse files
committed
Added unit test for FATSTAT.LUA
1 parent c54b643 commit c571f5d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/FATSTAT/test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
3+
INTERP=${INTERP:-lua}
4+
TEST="FATSTAT"
5+
SCRIPT="FATSTAT.LUA"
6+
7+
mformat -i test.ima -C -f 160
8+
CHASH=$(sha256sum test.ima)
9+
# Insert junk data to wipe
10+
dd if=/dev/random of=test.ima bs=512 count=2 seek=300 status=none
11+
RHASH=$(sha256sum test.ima)
12+
if [ "$CHASH" = "$RHASH" ]; then die; fi
13+
$INTERP $SCRIPT -z test.ima
14+
ZHASH=$(sha256sum test.ima)
15+
rm test.ima
16+
if [ "$CHASH" = "$ZHASH" ]; then echo "$TEST: PASS"; else echo "$TEST: FAIL"; fi

0 commit comments

Comments
 (0)