]>
Commit | Line | Data |
---|---|---|
1862ef72 | 1 | test_description="fix up last bg when expanding within the last bg" |
3819bff4 AD |
2 | if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then |
3 | echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" | |
4 | return 0 | |
5 | fi | |
1862ef72 DW |
6 | |
7 | EXP=$test_dir/expect | |
8 | OUT=$test_name.out | |
9 | LOG=$test_name.log | |
10 | E2FSCK=../e2fsck/e2fsck | |
11 | ||
12 | $MKE2FS -T ext4 -b 1024 -F -U 56d3ee50-8532-4f29-8181-d7c6ea4a94a6 $TMPFILE 20000 > $OUT 2>&1 | |
13 | $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT | |
14 | $DEBUGFS -R "set_bg 2 itable_unused 0" -w $TMPFILE > /dev/null 2>&1 | |
15 | $DEBUGFS -R "set_bg 2 flags 0" -w $TMPFILE > /dev/null 2>&1 | |
16 | $DEBUGFS -R "set_bg 2 checksum 0xd318" -w $TMPFILE > /dev/null 2>&1 | |
17 | $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT | |
18 | #dd if=/dev/zero of=$TMPFILE bs=1 count=1 seek=$((1024 * 20004)) conv=notrunc >> $OUT 2> /dev/null | |
19 | $RESIZE2FS_EXE -f -p $TMPFILE 20004 >> $OUT 2>&1 | |
20 | $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT | |
21 | $E2FSCK -fy $TMPFILE >> $OUT 2>&1 | |
22 | ||
23 | sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" < $OUT > $LOG | |
24 | rm -rf $OUT | |
25 | ||
26 | cmp -s $LOG $EXP | |
27 | RC=$? | |
28 | if [ $RC -eq 0 ]; then | |
29 | echo "$test_name: $test_description: ok" | |
30 | touch $test_name.ok | |
31 | else | |
32 | echo "$test_name: $test_description: failed" | |
33 | diff -u $EXP $LOG > $test_name.failed | |
34 | fi | |
35 | ||
36 | unset EXP LOG OUT E2FSCK |