summaryrefslogtreecommitdiffstats
path: root/tests/f_boundscheck/script
blob: 7a07265e038bfeebb7afbfadb544b691a04f9539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

FSCK_OPT=-fy
IMAGE=$test_dir/image.bz2

bzip2 -d < $IMAGE > $TMPFILE
#e2label $TMPFILE test_filesys

# Run fsck to fix things?
EXP1=$test_dir/expect.1
OUT1=$test_name.1.log

$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1
echo "Exit status is $?" >> $OUT1

# Run a second time
EXP2=$test_dir/expect.2
OUT2=$test_name.2.log

$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2
echo "Exit status is $?" >> $OUT2

# Figure out what happened
if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
	echo "$test_name: $test_description: ok"
	touch $test_name.ok
else
	echo "$test_name: $test_description: failed"
	diff -u $EXP1 $OUT1 >> $test_name.failed
	diff -u $EXP2 $OUT2 >> $test_name.failed
fi