script revision e0ed7404719a9ddd2ba427a80db5365c8bad18c0
1if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
2
3IMAGE=$test_dir/image.gz
4FSCK_OPT=-yf
5OUT=$test_name.log
6EXP=$test_dir/expect
7
8gunzip < $IMAGE > $TMPFILE
9
10echo "resize2fs test" > $OUT
11
12# Look at existing inline extended attribute
13echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
14$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
15status=$?
16echo Exit status is $status >> $OUT
17
18# resize it
19echo "resize2fs test.img 5M" >> $OUT
20$RESIZE2FS $TMPFILE 5M 2>&1 >> $OUT.new 2>&1
21status=$?
22echo Exit status is $status >> $OUT.new
23sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
24
25# Look at inline extended attribute in resized fs
26echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''" >> $OUT
27$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|name = " >> $OUT
28status=$?
29echo Exit status is $status >> $OUT
30
31rm $TMPFILE $OUT.new
32
33#
34# Do the verification
35#
36
37cmp -s $OUT $EXP
38status=$?
39
40if [ "$status" = 0 ] ; then
41	echo "$test_name: $test_description: ok"
42	touch $test_name.ok
43else
44	echo "$test_name: $test_description: failed"
45	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
46fi
47
48unset IMAGE FSCK_OPT OUT EXP
49
50else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
51	echo "$test_name: $test_description: skipped"
52fi
53
54