]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - tests/r_move_itable_realloc/script
tests: clean up $DEBUGFS_EXE usage in scripts
[thirdparty/e2fsprogs.git] / tests / r_move_itable_realloc / script
CommitLineData
2b50c18a
TT
1if [ $(uname -s) = "FreeBSD" ]; then
2 # creates a 96GB filesystem
3 echo "$test_name: $DESCRIPTION: skipped for FreeBSD (no sparse files)"
4 return 0
5fi
6
7if [ $(uname -s) = "Darwin" ]; then
8 # creates a 96GB filesystem
9 echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)"
10 return 0
11fi
12
3819bff4
AD
13if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then
14 echo "$test_name: $test_description: skipped (no debugfs/resize2fs)"
15 return 0
16fi
2b50c18a
TT
17
18FSCK_OPT=-yf
19OUT=$test_name.log
20if [ -f $test_dir/expect.gz ]; then
21 EXP=$test_name.tmp
22 gunzip < $test_dir/expect.gz > $EXP1
23else
24 EXP=$test_dir/expect
25fi
26
27cp /dev/null $OUT
28
29dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
30
31echo mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000 > $OUT
32$MKE2FS -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 \
33 $TMPFILE 1024000 2>&1 |
34 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
35
36echo resize2fs -p test.img 10240000 >> $OUT
37$RESIZE2FS -p $TMPFILE 100000000 2>&1 |
38 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
39
40$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
41status=$?
42echo Exit status is $status >> $OUT.new
43sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
44rm -f $OUT.new
45
46$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
47$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1
48$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1
49$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1
50
51echo dumpe2fs -h test.img >> $OUT
52$DUMPE2FS -h $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' >> $OUT
53
54rm -f $TMPFILE
55
56cmp -s $OUT $EXP
57status=$?
58
59if [ "$status" = 0 ] ; then
60 echo "$test_name: $test_description: ok"
61 touch $test_name.ok
62else
63 echo "$test_name: $test_description: failed"
64 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
65 rm -f $test_name.tmp
66fi
67
68unset IMAGE FSCK_OPT OUT EXP