]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - tests/f_mmp_garbage/script
6d451a676c1073c2fc83827e29a9fdf2320fd2b7
[thirdparty/e2fsprogs.git] / tests / f_mmp_garbage / script
1 FSCK_OPT=-yf
2
3 # use current directory instead of /tmp becase tmpfs doesn't support DIO
4 rm -f $TMPFILE
5 TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
6
7 stat -f $TMPFILE | grep -q "Type: tmpfs"
8 if [ $? = 0 ] ; then
9 rm -f $TMPFILE
10 echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
11 return 0
12 fi
13
14 echo "make the test image ..." > $test_name.log
15 $MKE2FS -q -F -o Linux -b 4096 -O mmp -E mmp_update_interval=1 $TMPFILE 100 >> $test_name.log 2>&1
16 status=$?
17 if [ "$status" != 0 ] ; then
18 echo "mke2fs -O mmp failed" > $test_name.failed
19 echo "$test_name: $test_description: failed"
20 return $status
21 fi
22
23 # create a corrupted image
24 echo "modify the mmp sequence ..." >> $test_name.log
25 $DEBUGFS -w -R "set_mmp_value magic 0x12345678" $TMPFILE >> $test_name.log 2>&1
26
27 SKIP_GUNZIP=true
28 . $cmd_dir/run_e2fsck