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