Whamcloud - gitweb
Merge tag 'v1.43.9' into next
[tools/e2fsprogs.git] / tests / j_recover_csum3_64bit / script
1 #!/bin/bash
2
3 FSCK_OPT=-fy
4 IMAGE=$test_dir/image.bz2
5
6 bzip2 -d < $IMAGE > $TMPFILE
7
8 # Run fsck to fix things?
9 EXP1=$test_dir/expect.1
10 OUT1=$test_name.1.log
11 rm -rf $test_name.failed $test_name.ok
12
13 $FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1
14 echo "Exit status is $?" >> $OUT1
15
16 # Run a second time
17 EXP2=$test_dir/expect.2
18 OUT2=$test_name.2.log
19
20 $FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2
21 echo "Exit status is $?" >> $OUT2
22
23 # Figure out what happened
24 if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
25         echo "$test_name: $test_description: ok"
26         touch $test_name.ok
27 else
28         echo "$test_name: $test_description: failed"
29         diff -u $EXP1 $OUT1 >> $test_name.failed
30         diff -u $EXP2 $OUT2 >> $test_name.failed
31 fi