Whamcloud - gitweb
e2fsck: handle preallocation for large PAGE_SIZE
[tools/e2fsprogs.git] / tests / r_inline_xattr / script
1 if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then
2         echo "$test_name: $test_description: skipped (no debugfs/resize2fs)"
3         return 0
4 fi
5
6 IMAGE=$test_dir/image.gz
7 FSCK_OPT=-yf
8 OUT=$test_name.log
9 EXP=$test_dir/expect
10
11 gunzip < $IMAGE > $TMPFILE
12
13 echo "resize2fs test" > $OUT.new
14
15 # Look at existing inline extended attribute
16 echo "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
18 status=$?
19 echo Exit status is $status >> $OUT.new
20
21 # resize it
22 echo "resize2fs test.img 5M" >> $OUT.new
23 $RESIZE2FS $TMPFILE 5M >> $OUT.new 2>&1
24 status=$?
25 echo Exit status is $status >> $OUT.new
26
27 # Look at inline extended attribute in resized fs
28 echo "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
30 status=$?
31 echo Exit status is $status >> $OUT.new
32
33 sed -f $cmd_dir/filter.sed < $OUT.new > $OUT
34 rm $TMPFILE $OUT.new
35
36 #
37 # Do the verification
38 #
39
40 cmp -s $OUT $EXP
41 status=$?
42
43 if [ "$status" = 0 ] ; then
44         echo "$test_name: $test_description: ok"
45         touch $test_name.ok
46 else
47         echo "$test_name: $test_description: failed"
48         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
49 fi
50
51 unset IMAGE FSCK_OPT OUT EXP