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