]>
Commit | Line | Data |
---|---|---|
d9c60e04 AD |
1 | FSCK_OPT=-yf |
2 | ||
3 | TMPFILE=test.img | |
4 | rm -f $test_name.failed $test_name.ok | |
5 | > $TMPFILE | |
6 | ||
7 | stat -f $TMPFILE | grep -q "Type: tmpfs" | |
8 | if [ $? == 0 ] ; then | |
9 | rm -f $TMPFILE | |
10 | echo "skipped for tmpfs (no O_DIRECT support)" | |
11 | return 0 | |
12 | fi | |
13 | ||
14 | $MKE2FS -q -F -o Linux -b 1024 $TMPFILE 100 > $test_name.log 2>&1 | |
15 | status=$? | |
16 | if [ "$status" != 0 ] ; then | |
17 | echo "mke2fs failed" > $test_name.failed | |
18 | echo "failed" | |
19 | return $status | |
20 | fi | |
21 | ||
22 | $TUNE2FS -O mmp -E mmp_update_interval=1 $TMPFILE >> $test_name.log 2>&1 | |
23 | status=$? | |
24 | if [ "$status" != 0 ] ; then | |
25 | echo "tune2fs -O mmp failed with $status" > $test_name.failed | |
26 | echo "failed" | |
27 | return $status | |
28 | fi | |
29 | ||
30 | $FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 | |
31 | status=$? | |
32 | if [ "$status" = 0 ] ; then | |
33 | echo "ok" | |
34 | touch $test_name.ok | |
35 | else | |
36 | echo "e2fsck with MMP enabled failed with $status" > $test_name.failed | |
37 | echo "failed" | |
38 | return $status | |
39 | fi | |
40 | rm -f $TMPFILE |