From 3819bff4cfceed456b2581228e66458cf800adf5 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 22 Jun 2018 11:43:54 -0400 Subject: [PATCH] tests: clean up $DEBUGFS_EXE usage in scripts Instead of putting the entire test script under an implicit "if test -x $DEBUGFS_EXE" conditional (sometimes indenting the code, and sometimes not), rather check for the reverse and exit the test script early if $DEBUGFS_EXE is missing. In some places, tests were running $DEBUGFS_EXE directly, when they should be running $DEBUGFS (which will run with Fortify, or other options). [ Fixed up missing exit statement in f_detect_junk. --tytso ] Signed-off-by: Andreas Dilger Signed-off-by: Theodore Ts'o --- tests/d_dumpe2fs_group_only/script | 9 ++- tests/d_fallocate/script | 13 ++-- tests/d_fallocate_bigalloc/script | 13 ++-- tests/d_fallocate_blkmap/script | 13 ++-- tests/d_inline_dump/script | 59 ++++++++++--------- tests/d_loaddump/script | 15 +++-- tests/d_punch/script | 13 ++-- tests/d_punch_bigalloc/script | 13 ++-- tests/d_special_files/script | 9 ++- tests/d_xattr_edits/script | 9 ++- tests/d_xattr_sorting/script | 9 ++- tests/f_badcluster/script | 47 +++++++-------- tests/f_bigalloc_badinode/script | 9 ++- tests/f_bigalloc_orphan_list/script | 9 ++- tests/f_create_symlinks/script | 9 ++- tests/f_desc_size_bad/script | 2 +- tests/f_detect_junk/script | 11 ++-- tests/f_detect_xfs/script | 2 +- tests/f_dup4/script | 9 ++- tests/f_dup_de/script | 9 ++- tests/f_dup_resize/script | 9 ++- tests/f_extent_oobounds/script | 9 ++- tests/f_imagic_fs/script | 9 ++- tests/f_resize_inode/script | 11 ++-- tests/f_uninit_cat/script | 10 ++-- tests/f_uninit_last_uninit/script | 9 ++- tests/j_corrupt_commit_csum/script | 11 ++-- tests/j_corrupt_commit_tid/script | 11 ++-- tests/j_corrupt_descr_csum/script | 11 ++-- tests/j_corrupt_descr_tid/script | 11 ++-- tests/j_corrupt_journal_block/script | 11 ++-- tests/j_corrupt_revoke_block/script | 11 ++-- tests/j_corrupt_revoke_csum/script | 11 ++-- tests/j_corrupt_sb_csum/script | 11 ++-- tests/j_corrupt_sb_magic/script | 11 ++-- tests/j_ext_long_revoke_trans/script | 13 ++-- tests/j_ext_long_trans/script | 13 ++-- tests/j_long_revoke_trans/script | 13 ++-- tests/j_long_revoke_trans_mcsum_32bit/script | 15 +++-- tests/j_long_revoke_trans_mcsum_64bit/script | 15 +++-- tests/j_long_trans/script | 13 ++-- tests/j_long_trans_mcsum_32bit/script | 13 ++-- tests/j_long_trans_mcsum_64bit/script | 13 ++-- tests/j_short_revoke_trans/script | 13 ++-- tests/j_short_revoke_trans_mcsum_64bit/script | 13 ++-- tests/j_short_trans/script | 13 ++-- tests/j_short_trans_64bit/script | 13 ++-- tests/j_short_trans_mcsum_64bit/script | 13 ++-- tests/j_short_trans_old_csum/script | 13 ++-- tests/j_short_trans_open_recover/script | 15 +++-- tests/j_short_trans_recover/script | 15 +++-- .../j_short_trans_recover_mcsum_64bit/script | 15 +++-- tests/j_short_uncommitted_trans/script | 13 ++-- .../script | 13 ++-- tests/m_devdir/script | 11 ++-- tests/m_minrootdir/script | 11 ++-- tests/m_rootdir/script | 11 ++-- tests/r_1024_small_bg/script | 11 ++-- tests/r_32to64bit/script | 10 ++-- tests/r_32to64bit_expand_full/script | 10 ++-- tests/r_32to64bit_meta/script | 10 ++-- tests/r_32to64bit_move_itable/script | 10 ++-- tests/r_64bit_big_expand/script | 12 ++-- tests/r_64to32bit/script | 10 ++-- tests/r_64to32bit_meta/script | 10 ++-- tests/r_bigalloc_big_expand/script | 12 ++-- tests/r_expand_full/script | 10 ++-- tests/r_ext4_big_expand/script | 12 ++-- tests/r_ext4_small_bg/script | 12 ++-- tests/r_fixup_lastbg/script | 9 ++- tests/r_fixup_lastbg_big/script | 9 ++- tests/r_inline_xattr/script | 10 ++-- tests/r_meta_bg_shrink/script | 12 ++-- tests/r_min_itable/script | 10 ++-- tests/r_move_itable/script | 9 ++- tests/r_move_itable_nostride/script | 9 ++- tests/r_move_itable_realloc/script | 9 ++- tests/run_mke2fs | 2 +- tests/t_iexpand_full/script | 10 ++-- tests/t_iexpand_mcsum/script | 11 ++-- tests/t_replay_and_set/script | 11 ++-- tests/u_debugfs_opt/script | 6 +- 82 files changed, 446 insertions(+), 528 deletions(-) diff --git a/tests/d_dumpe2fs_group_only/script b/tests/d_dumpe2fs_group_only/script index 50481f027..c3ab7e2bc 100644 --- a/tests/d_dumpe2fs_group_only/script +++ b/tests/d_dumpe2fs_group_only/script @@ -4,7 +4,10 @@ if [ $(uname -s) = "Darwin" ]; then return 0 fi -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -43,7 +46,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_fallocate/script b/tests/d_fallocate/script index b3982a3d8..b41eaafe7 100644 --- a/tests/d_fallocate/script +++ b/tests/d_fallocate/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -143,8 +146,8 @@ sif /k size 9216000 ENDL echo "ex /k" >> $TMPFILE.cmd2 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 -$DEBUGFS_EXE -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2 @@ -169,7 +172,3 @@ fi rm -f $EXP unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_fallocate_bigalloc/script b/tests/d_fallocate_bigalloc/script index 9022a2ba1..9c8fde89a 100644 --- a/tests/d_fallocate_bigalloc/script +++ b/tests/d_fallocate_bigalloc/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -144,8 +147,8 @@ sif /k size 9216000 ENDL echo "ex /k" >> $TMPFILE.cmd2 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 -$DEBUGFS_EXE -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2 @@ -170,7 +173,3 @@ fi rm -f $EXP unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_fallocate_blkmap/script b/tests/d_fallocate_blkmap/script index 9c48cbc90..86d1deee3 100644 --- a/tests/d_fallocate_blkmap/script +++ b/tests/d_fallocate_blkmap/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -53,8 +56,8 @@ ENDL echo "stat /a" >> $TMPFILE.cmd2 echo "stat /b" >> $TMPFILE.cmd2 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 -$DEBUGFS_EXE -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 sed -f $cmd_dir/filter.sed -e '/^.*time:.*$/d' < $OUT.new >> $OUT rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2 @@ -79,7 +82,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_inline_dump/script b/tests/d_inline_dump/script index 6df34b62b..3193f78f1 100644 --- a/tests/d_inline_dump/script +++ b/tests/d_inline_dump/script @@ -1,42 +1,43 @@ if ! test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -else - OUT=$test_name.log - EXP=$test_dir/expect - VERIFY_FSCK_OPT=-yf + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +EXP=$test_dir/expect +VERIFY_FSCK_OPT=-yf - ZIMAGE=$test_dir/image.gz - gzip -d < $ZIMAGE > $TMPFILE +ZIMAGE=$test_dir/image.gz +gzip -d < $ZIMAGE > $TMPFILE - echo "*** long file" > $OUT - $DEBUGFS -R 'stat /file' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 - echo "*** short file" >> $OUT - $DEBUGFS -R 'stat /shortfile' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 - echo >> $OUT +echo "*** long file" > $OUT +$DEBUGFS -R 'stat /file' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** short file" >> $OUT +$DEBUGFS -R 'stat /shortfile' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo >> $OUT - echo "*** long dir" >> $OUT - $DEBUGFS -R 'stat /dir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 - echo "*** short dir" >> $OUT - $DEBUGFS -R 'stat /shortdir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 - echo >> $OUT +echo "*** long dir" >> $OUT +$DEBUGFS -R 'stat /dir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** short dir" >> $OUT +$DEBUGFS -R 'stat /shortdir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo >> $OUT - echo "*** long link" >> $OUT - $DEBUGFS -R 'stat /link' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 - echo "*** short link" >> $OUT - $DEBUGFS -R 'stat /shortlink' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** long link" >> $OUT +$DEBUGFS -R 'stat /link' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** short link" >> $OUT +$DEBUGFS -R 'stat /shortlink' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 - echo "*** end test" >> $OUT +echo "*** end test" >> $OUT - cmp -s $OUT $EXP - status=$? +cmp -s $OUT $EXP +status=$? - if [ "$status" = 0 ] ; then +if [ "$status" = 0 ] ; then echo "$test_name: $test_description: ok" touch $test_name.ok - else +else echo "$test_name: $test_description: failed" diff $DIFF_OPTS $EXP $OUT > $test_name.failed - fi - - unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA ZIMAGE fi + +unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA ZIMAGE diff --git a/tests/d_loaddump/script b/tests/d_loaddump/script index 04723f723..c91a6e94c 100644 --- a/tests/d_loaddump/script +++ b/tests/d_loaddump/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi OUT=$test_name.log EXP=$test_dir/expect @@ -47,7 +50,11 @@ echo Exit status is $status >> $OUT # Do the verification # -rm -f $VERIFY_DATA $TEST_DATA $TMPFILE $OUT.new +if [ "$SKIP_UNLINK" != "true" ]; then + rm -f $VERIFY_DATA $TEST_DATA $TMPFILE $OUT.new +else + echo "TMPFILE=$TMPFILE" +fi cmp -s $OUT $EXP status=$? @@ -60,7 +67,3 @@ else fi unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_punch/script b/tests/d_punch/script index 7a77c69ca..5bb51cd60 100644 --- a/tests/d_punch/script +++ b/tests/d_punch/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -97,8 +100,8 @@ punch /f 1 8998 ENDL echo "ex /f" >> $TMPFILE.cmd2 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 -$DEBUGFS_EXE -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2 @@ -123,7 +126,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_punch_bigalloc/script b/tests/d_punch_bigalloc/script index 6eb057119..7d0c7fe74 100644 --- a/tests/d_punch_bigalloc/script +++ b/tests/d_punch_bigalloc/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -98,8 +101,8 @@ punch /f 1 8998 ENDL echo "ex /f" >> $TMPFILE.cmd2 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 -$DEBUGFS_EXE -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2 @@ -124,7 +127,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_special_files/script b/tests/d_special_files/script index a8c28582e..746d724b6 100644 --- a/tests/d_special_files/script +++ b/tests/d_special_files/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi OUT=$test_name.log EXP=$test_dir/expect @@ -88,7 +91,3 @@ else fi unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_xattr_edits/script b/tests/d_xattr_edits/script index b6451ee77..13550a17d 100644 --- a/tests/d_xattr_edits/script +++ b/tests/d_xattr_edits/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi OUT=$test_name.log EXP=$test_dir/expect @@ -135,7 +138,3 @@ else fi unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script index 9e6e362dd..a599f3c4d 100644 --- a/tests/d_xattr_sorting/script +++ b/tests/d_xattr_sorting/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi OUT=$test_name.log EXP=$test_dir/expect @@ -89,7 +92,3 @@ else fi unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_badcluster/script b/tests/f_badcluster/script index ea9e4889c..0012594ac 100644 --- a/tests/f_badcluster/script +++ b/tests/f_badcluster/script @@ -1,27 +1,28 @@ -if test -x $DEBUGFS_EXE; then - IMAGE=$test_dir/../f_badcluster/image.gz - OUT=$test_name.log - EXP=$test_dir/expect - gzip -d < $IMAGE > $TMPFILE - $FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $OUT - $FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT - $FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT - for i in a b c d e f g; do echo "stat /$i"; done > $TMPFILE.tmp - echo "quit" >> $TMPFILE.tmp - $DEBUGFS_EXE -f $TMPFILE.tmp $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT - rm -f $TMPFILE.tmp +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/../f_badcluster/image.gz +OUT=$test_name.log +EXP=$test_dir/expect +gzip -d < $IMAGE > $TMPFILE +$FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $OUT +$FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +for i in a b c d e f g; do echo "stat /$i"; done > $TMPFILE.tmp +echo "quit" >> $TMPFILE.tmp +$DEBUGFS -f $TMPFILE.tmp $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +rm -f $TMPFILE.tmp - cmp -s $OUT $EXP - status=$? +cmp -s $OUT $EXP +status=$? - if [ "$status" = 0 ]; then - echo "$test_name: $test_description: ok" - touch $test_name.ok - else - echo "$test_name: $test_description: failed" - diff $DIFF_OPTS $EXP $OUT > $test_name.failed - rm -f $test_name.tmp - fi +if [ "$status" = 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok else - echo "$test_name: skipped" + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp fi diff --git a/tests/f_bigalloc_badinode/script b/tests/f_bigalloc_badinode/script index e58910f29..c1dd45461 100644 --- a/tests/f_bigalloc_badinode/script +++ b/tests/f_bigalloc_badinode/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi SKIP_GUNZIP="true" TEST_DATA="$test_name.tmp" @@ -18,7 +21,3 @@ EOF rm -f $TEST_DATA unset E2FSCK_TIME TEST_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_bigalloc_orphan_list/script b/tests/f_bigalloc_orphan_list/script index af9d75302..63a0350f0 100644 --- a/tests/f_bigalloc_orphan_list/script +++ b/tests/f_bigalloc_orphan_list/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi SKIP_GUNZIP="true" TEST_DATA="$test_name.tmp" @@ -22,7 +25,3 @@ EOF rm -f $TEST_DATA unset E2FSCK_TIME TEST_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_create_symlinks/script b/tests/f_create_symlinks/script index 1a97216aa..7d712f5dc 100644 --- a/tests/f_create_symlinks/script +++ b/tests/f_create_symlinks/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-yf OUT=$test_name.log @@ -56,7 +59,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_desc_size_bad/script b/tests/f_desc_size_bad/script index 544032860..ae2962770 100644 --- a/tests/f_desc_size_bad/script +++ b/tests/f_desc_size_bad/script @@ -1,5 +1,5 @@ if ! test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" + echo "$test_name: $test_description: skipped (no debugfs)" return 0 fi diff --git a/tests/f_detect_junk/script b/tests/f_detect_junk/script index 429ff00e4..12cfdfdff 100644 --- a/tests/f_detect_junk/script +++ b/tests/f_detect_junk/script @@ -1,6 +1,9 @@ #!/bin/bash -if [ "$(grep -c 'define HAVE_MAGIC_H' ../lib/config.h)" -gt 0 ]; then +if [ "$(grep -c 'define HAVE_MAGIC_H' ../lib/config.h)" -eq 0 ]; then + echo "$test_name: skipped (no magic)" + exit 0 +fi FSCK_OPT=-fn IMAGE=$test_dir/image.bz2 @@ -20,7 +23,7 @@ rm -rf $test_name.failed $test_name.ok echo "*** e2fsck" > $OUT $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 echo "*** debugfs" >> $OUT -test -x $DEBUGFS_EXE && $DEBUGFS_EXE -R 'quit' $TMPFILE >> $OUT 2>&1 +test -x $DEBUGFS_EXE && $DEBUGFS -R 'quit' $TMPFILE >> $OUT 2>&1 echo "*** tune2fs" >> $OUT $TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1 echo "*** mke2fs" >> $OUT @@ -38,7 +41,3 @@ else diff -u $EXP $OUT >> $test_name.failed fi unset EXP OUT FSCK_OPT IMAGE - -else #if HAVE_MAGIC_H - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_detect_xfs/script b/tests/f_detect_xfs/script index c80f0f7ec..4da1cd9d7 100644 --- a/tests/f_detect_xfs/script +++ b/tests/f_detect_xfs/script @@ -17,7 +17,7 @@ rm -rf $test_name.failed $test_name.ok echo "*** e2fsck" > $OUT $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 echo "*** debugfs" >> $OUT -test -x $DEBUGFS_EXE && $DEBUGFS_EXE -R 'quit' $TMPFILE >> $OUT 2>&1 +test -x $DEBUGFS_EXE && $DEBUGFS -R 'quit' $TMPFILE >> $OUT 2>&1 echo "*** tune2fs" >> $OUT $TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1 echo "*** mke2fs" >> $OUT diff --git a/tests/f_dup4/script b/tests/f_dup4/script index 498f5259c..aec862d1f 100644 --- a/tests/f_dup4/script +++ b/tests/f_dup4/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi SKIP_GUNZIP="true" TEST_DATA="$test_name.tmp" @@ -50,7 +53,3 @@ export E2FSCK_TIME rm -f $TEST_DATA unset E2FSCK_TIME TEST_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_dup_de/script b/tests/f_dup_de/script index 60378cdc9..dcda9d805 100644 --- a/tests/f_dup_de/script +++ b/tests/f_dup_de/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi if test "$HTREE"x = x ; then gunzip < $test_dir/image.gz > $TMPFILE @@ -10,7 +13,3 @@ if test "$HTREE"x = x ; then fi . $cmd_dir/run_e2fsck rm -f "$TMPFILE".gz - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_dup_resize/script b/tests/f_dup_resize/script index 19fa120fc..52a1aed7e 100644 --- a/tests/f_dup_resize/script +++ b/tests/f_dup_resize/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi SKIP_GUNZIP="true" TEST_DATA="$test_name.tmp" @@ -24,7 +27,3 @@ export E2FSCK_TIME rm -f $TEST_DATA unset E2FSCK_TIME TEST_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_extent_oobounds/script b/tests/f_extent_oobounds/script index 54674cae2..9c6117c08 100644 --- a/tests/f_extent_oobounds/script +++ b/tests/f_extent_oobounds/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi SKIP_GUNZIP="true" TEST_DATA="$test_name.tmp" @@ -36,7 +39,3 @@ EOF rm -f $TEST_DATA unset E2FSCK_TIME TEST_DATA - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_imagic_fs/script b/tests/f_imagic_fs/script index 1060f04d1..511dcc769 100644 --- a/tests/f_imagic_fs/script +++ b/tests/f_imagic_fs/script @@ -1,9 +1,8 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/../f_imagic/image.gz PREP_CMD='$DEBUGFS -w -R "feature imagic_inodes" $TMPFILE > /dev/null 2>&1' . $cmd_dir/run_e2fsck - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_resize_inode/script b/tests/f_resize_inode/script index 190871b47..0243bdac3 100644 --- a/tests/f_resize_inode/script +++ b/tests/f_resize_inode/script @@ -1,6 +1,9 @@ -if test -x $DEBUGFS_EXE; then - test_description="e2fsck with resize_inode" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + FSCK_OPT=-yf OUT=$test_name.log if [ -f $test_dir/expect.gz ]; then @@ -137,7 +140,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_uninit_cat/script b/tests/f_uninit_cat/script index 887756602..8d56e8496 100755 --- a/tests/f_uninit_cat/script +++ b/tests/f_uninit_cat/script @@ -1,6 +1,9 @@ #!/bin/bash -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy IMAGE=$test_dir/image.gz @@ -18,7 +21,7 @@ echo "Exit status is $?" >> $OUT echo "debugfs cat uninit file" >> $OUT echo "ex /a" > $TMPFILE.cmd echo "cat /a" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 echo >> $OUT.new sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new $TMPFILE $TMPFILE.cmd @@ -32,6 +35,3 @@ else diff -u $EXP $OUT >> $test_name.failed fi unset EXP OUT FSCK_OPT IMAGE -else #if test -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/f_uninit_last_uninit/script b/tests/f_uninit_last_uninit/script index 376c97823..53105a417 100644 --- a/tests/f_uninit_last_uninit/script +++ b/tests/f_uninit_last_uninit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi SKIP_GUNZIP="true" @@ -20,7 +23,3 @@ export E2FSCK_TIME . $cmd_dir/run_e2fsck unset E2FSCK_TIME - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_commit_csum/script b/tests/j_corrupt_commit_csum/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_commit_csum/script +++ b/tests/j_corrupt_commit_csum/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_commit_tid/script b/tests/j_corrupt_commit_tid/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_commit_tid/script +++ b/tests/j_corrupt_commit_tid/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_descr_csum/script b/tests/j_corrupt_descr_csum/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_descr_csum/script +++ b/tests/j_corrupt_descr_csum/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_descr_tid/script b/tests/j_corrupt_descr_tid/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_descr_tid/script +++ b/tests/j_corrupt_descr_tid/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_journal_block/script b/tests/j_corrupt_journal_block/script index 2bce9733d..a881bd1c9 100644 --- a/tests/j_corrupt_journal_block/script +++ b/tests/j_corrupt_journal_block/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT echo >> $OUT rm -f $TMPFILE.cmd @@ -47,7 +50,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_revoke_block/script b/tests/j_corrupt_revoke_block/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_revoke_block/script +++ b/tests/j_corrupt_revoke_block/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_revoke_csum/script b/tests/j_corrupt_revoke_csum/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_revoke_csum/script +++ b/tests/j_corrupt_revoke_csum/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_sb_csum/script b/tests/j_corrupt_sb_csum/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_sb_csum/script +++ b/tests/j_corrupt_sb_csum/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_corrupt_sb_magic/script b/tests/j_corrupt_sb_magic/script index 9c169752d..57fc8fb56 100644 --- a/tests/j_corrupt_sb_magic/script +++ b/tests/j_corrupt_sb_magic/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-fy @@ -28,7 +31,7 @@ rm -f $OUT.new echo "cat /a" > $TMPFILE.cmd echo >> $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -f $TMPFILE.cmd rm -f $TMPFILE @@ -46,7 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_ext_long_revoke_trans/script b/tests/j_ext_long_revoke_trans/script index fe45c72ee..21518edc4 100644 --- a/tests/j_ext_long_revoke_trans/script +++ b/tests/j_ext_long_revoke_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -39,14 +42,14 @@ echo "jc" >> $TMPFILE.cmd echo "jo -f $JNLFILE" >> $TMPFILE.cmd echo "jw -r 259-4356 /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$JNLFILE" "$JOURNAL_DUMP_DIR/$test_name.img.jnl" echo "logdump -c -f $JNLFILE" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' >> $OUT rm -rf $TMPFILE.cmd echo "debugfs fsck" >> $OUT @@ -71,7 +74,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP JNLFILE - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_ext_long_trans/script b/tests/j_ext_long_trans/script index f71e5a469..5f7fa5358 100644 --- a/tests/j_ext_long_trans/script +++ b/tests/j_ext_long_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -36,14 +39,14 @@ echo "debugfs write journal" >> $OUT echo "jo -f $JNLFILE" > $TMPFILE.cmd echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$JNLFILE" "$JOURNAL_DUMP_DIR/$test_name.img.jnl" echo "logdump -c -f $JNLFILE" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' >> $OUT rm -rf $TMPFILE.cmd echo "debugfs fsck" >> $OUT @@ -68,7 +71,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP JNLFILE - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_long_revoke_trans/script b/tests/j_long_revoke_trans/script index 4a0c5d1fb..bc330259a 100644 --- a/tests/j_long_revoke_trans/script +++ b/tests/j_long_revoke_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -26,13 +29,13 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r 259-4356" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -56,7 +59,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_long_revoke_trans_mcsum_32bit/script b/tests/j_long_revoke_trans_mcsum_32bit/script index fc0d0ad95..3e838ac91 100644 --- a/tests/j_long_revoke_trans_mcsum_32bit/script +++ b/tests/j_long_revoke_trans_mcsum_32bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -28,8 +31,8 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r 260-4356" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -#$DEBUGFS_EXE -w $TMPFILE -f $TMPFILE.cmd >> $OUT 2>&1 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +#$DEBUGFS -w $TMPFILE -f $TMPFILE.cmd >> $OUT 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -37,7 +40,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -61,7 +64,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_long_revoke_trans_mcsum_64bit/script b/tests/j_long_revoke_trans_mcsum_64bit/script index e206f88d1..eef9f0208 100644 --- a/tests/j_long_revoke_trans_mcsum_64bit/script +++ b/tests/j_long_revoke_trans_mcsum_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -28,8 +31,8 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r 262-4358" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -#$DEBUGFS_EXE -w $TMPFILE -f $TMPFILE.cmd >> $OUT 2>&1 -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +#$DEBUGFS -w $TMPFILE -f $TMPFILE.cmd >> $OUT 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -37,7 +40,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -61,7 +64,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_long_trans/script b/tests/j_long_trans/script index 68172c42f..425bf991c 100644 --- a/tests/j_long_trans/script +++ b/tests/j_long_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -23,13 +26,13 @@ echo "debugfs write journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -53,7 +56,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_long_trans_mcsum_32bit/script b/tests/j_long_trans_mcsum_32bit/script index 4722242f8..f0297a479 100644 --- a/tests/j_long_trans_mcsum_32bit/script +++ b/tests/j_long_trans_mcsum_32bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -25,7 +28,7 @@ echo "debugfs write journal" >> $OUT echo "jo -c" > $TMPFILE.cmd echo "jw -b 260-4356 /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -33,7 +36,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -57,7 +60,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_long_trans_mcsum_64bit/script b/tests/j_long_trans_mcsum_64bit/script index 65ca1b7e6..a72f6f1b9 100644 --- a/tests/j_long_trans_mcsum_64bit/script +++ b/tests/j_long_trans_mcsum_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -25,7 +28,7 @@ echo "debugfs write journal" >> $OUT echo "jo -c" > $TMPFILE.cmd echo "jw -b 262-4358 /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -33,7 +36,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -57,7 +60,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_revoke_trans/script b/tests/j_short_revoke_trans/script index 4eec4362f..9d3ee0567 100644 --- a/tests/j_short_revoke_trans/script +++ b/tests/j_short_revoke_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -28,13 +31,13 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r $bitmaps" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -58,7 +61,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_revoke_trans_mcsum_64bit/script b/tests/j_short_revoke_trans_mcsum_64bit/script index c943efa69..c9cc7cd8e 100644 --- a/tests/j_short_revoke_trans_mcsum_64bit/script +++ b/tests/j_short_revoke_trans_mcsum_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -30,7 +33,7 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r $bitmaps" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -38,7 +41,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -62,7 +65,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans/script b/tests/j_short_trans/script index 852e7a517..8108ba850 100644 --- a/tests/j_short_trans/script +++ b/tests/j_short_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -25,13 +28,13 @@ echo "debugfs write journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -55,7 +58,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans_64bit/script b/tests/j_short_trans_64bit/script index 994fa213c..70649c238 100644 --- a/tests/j_short_trans_64bit/script +++ b/tests/j_short_trans_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -27,7 +30,7 @@ echo "debugfs write journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -35,7 +38,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -59,7 +62,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans_mcsum_64bit/script b/tests/j_short_trans_mcsum_64bit/script index 034b23701..ad736eb94 100644 --- a/tests/j_short_trans_mcsum_64bit/script +++ b/tests/j_short_trans_mcsum_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -27,7 +30,7 @@ echo "debugfs write journal" >> $OUT echo "jo -c" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -35,7 +38,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -59,7 +62,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans_old_csum/script b/tests/j_short_trans_old_csum/script index 56f8bcbb6..cb13acbb5 100644 --- a/tests/j_short_trans_old_csum/script +++ b/tests/j_short_trans_old_csum/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -27,7 +30,7 @@ echo "debugfs write journal" >> $OUT echo "jo -c" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -35,7 +38,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -59,7 +62,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans_open_recover/script b/tests/j_short_trans_open_recover/script index 67136fe61..fe1d9e8e1 100644 --- a/tests/j_short_trans_open_recover/script +++ b/tests/j_short_trans_open_recover/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -25,20 +28,20 @@ echo "debugfs write journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd echo "debugfs can't recover open journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jr" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE > $OUT.new 2>&1 +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > $OUT.new 2>&1 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -63,7 +66,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans_recover/script b/tests/j_short_trans_recover/script index e7b49437f..a44111b7b 100644 --- a/tests/j_short_trans_recover/script +++ b/tests/j_short_trans_recover/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -28,18 +31,18 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r 333" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd echo "debugfs recover journal" >> $OUT echo "jr" > $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -64,7 +67,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_trans_recover_mcsum_64bit/script b/tests/j_short_trans_recover_mcsum_64bit/script index 2c56e0ff1..9671b8cd2 100644 --- a/tests/j_short_trans_recover_mcsum_64bit/script +++ b/tests/j_short_trans_recover_mcsum_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -30,7 +33,7 @@ echo "jc" >> $TMPFILE.cmd echo "jo" >> $TMPFILE.cmd echo "jw -r 333" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -38,12 +41,12 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd echo "debugfs recover journal" >> $OUT echo "jr" > $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -68,7 +71,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_uncommitted_trans/script b/tests/j_short_uncommitted_trans/script index a1fc3b445..ef0548ba1 100644 --- a/tests/j_short_uncommitted_trans/script +++ b/tests/j_short_uncommitted_trans/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -25,13 +28,13 @@ echo "debugfs write journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jw -b $bitmaps -c /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -55,7 +58,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/j_short_uncommitted_trans_mcsum_64bit/script b/tests/j_short_uncommitted_trans_mcsum_64bit/script index a0b8c7f5c..68965a9d1 100644 --- a/tests/j_short_uncommitted_trans_mcsum_64bit/script +++ b/tests/j_short_uncommitted_trans_mcsum_64bit/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -27,7 +30,7 @@ echo "debugfs write journal" >> $OUT echo "jo -c" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero -c" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -35,7 +38,7 @@ $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" echo "logdump -c" > $TMPFILE.cmd -$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT rm -rf $TMPFILE.cmd $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 @@ -59,7 +62,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/m_devdir/script b/tests/m_devdir/script index 5f2669972..3b1ef10bd 100644 --- a/tests/m_devdir/script +++ b/tests/m_devdir/script @@ -1,6 +1,9 @@ -if test -x $DEBUGFS_EXE; then - test_description="create fs image from /dev" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + MKFS_DIR=/dev OUT=$test_name.log @@ -27,7 +30,3 @@ fi rm -rf $TMPFILE.cmd $OUT.sed unset MKFS_DIR OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/m_minrootdir/script b/tests/m_minrootdir/script index 662e76f49..365599384 100644 --- a/tests/m_minrootdir/script +++ b/tests/m_minrootdir/script @@ -1,6 +1,9 @@ -if test -x $DEBUGFS_EXE -a -x $RESIZE2FS_EXE; then - test_description="create fs image from dir, then minimize it" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + MKFS_DIR=$TMPFILE.dir OUT=$test_name.log EXP=$test_dir/expect @@ -75,7 +78,3 @@ fi rm -rf $TMPFILE.cmd $MKFS_DIR $OUT.sed unset MKFS_DIR OUT EXP - -else #if test -x $DEBUGFS_EXE -a -x RESIZE2FS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/m_rootdir/script b/tests/m_rootdir/script index fbe1b31ea..86a0b101a 100644 --- a/tests/m_rootdir/script +++ b/tests/m_rootdir/script @@ -1,6 +1,9 @@ -if test -x $DEBUGFS_EXE; then - test_description="create fs image from dir" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + MKFS_DIR=$TMPFILE.dir OUT=$test_name.log EXP=$test_dir/expect @@ -65,7 +68,3 @@ fi rm -rf $TMPFILE.cmd $MKFS_DIR $OUT.sed unset MKFS_DIR OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/r_1024_small_bg/script b/tests/r_1024_small_bg/script index 2038cb96d..65276ab79 100644 --- a/tests/r_1024_small_bg/script +++ b/tests/r_1024_small_bg/script @@ -1,6 +1,9 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - test_description="ext2 1024 blocksize with small block groups" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + FEATURES="-t ext2 -O ^resize_inode -b 1024 -g 1024" SIZE_1=64M SIZE_2=2G @@ -25,7 +28,3 @@ fi unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_32to64bit/script b/tests/r_32to64bit/script index de08bfb64..6ecdf9068 100644 --- a/tests/r_32to64bit/script +++ b/tests/r_32to64bit/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -67,8 +70,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_32to64bit_expand_full/script b/tests/r_32to64bit_expand_full/script index 7a570841a..ee888fe0f 100644 --- a/tests/r_32to64bit_expand_full/script +++ b/tests/r_32to64bit_expand_full/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -76,8 +79,3 @@ fi rm $OUT.before $OUT.after unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_32to64bit_meta/script b/tests/r_32to64bit_meta/script index 25872c4d4..9711af0fa 100644 --- a/tests/r_32to64bit_meta/script +++ b/tests/r_32to64bit_meta/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -67,8 +70,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_32to64bit_move_itable/script b/tests/r_32to64bit_move_itable/script index c188acdc3..6b339af23 100644 --- a/tests/r_32to64bit_move_itable/script +++ b/tests/r_32to64bit_move_itable/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -67,8 +70,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_64bit_big_expand/script b/tests/r_64bit_big_expand/script index 0319f0e0c..f514d501e 100644 --- a/tests/r_64bit_big_expand/script +++ b/tests/r_64bit_big_expand/script @@ -1,6 +1,9 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - test_description="very large fs growth using ext4 w/64bit" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + FEATURES="-t ext4 -O 64bit" SIZE_1=512M SIZE_2=2T @@ -29,8 +32,3 @@ else fi unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_64to32bit/script b/tests/r_64to32bit/script index 5d959f03a..02718bdb9 100644 --- a/tests/r_64to32bit/script +++ b/tests/r_64to32bit/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -69,8 +72,3 @@ fi rm $OUT.before $OUT.after unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_64to32bit_meta/script b/tests/r_64to32bit_meta/script index 5a02e2664..69b33cc3a 100644 --- a/tests/r_64to32bit_meta/script +++ b/tests/r_64to32bit_meta/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -69,8 +72,3 @@ fi rm $OUT.before $OUT.after unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_bigalloc_big_expand/script b/tests/r_bigalloc_big_expand/script index d939aea28..0c9986bb4 100644 --- a/tests/r_bigalloc_big_expand/script +++ b/tests/r_bigalloc_big_expand/script @@ -1,6 +1,9 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - test_description="ext4 with bigalloc" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + FEATURES="-t ext4 -O bigalloc" SIZE_1=512M SIZE_2=2T @@ -30,8 +33,3 @@ else fi unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_expand_full/script b/tests/r_expand_full/script index 672829fe9..4a751f73e 100644 --- a/tests/r_expand_full/script +++ b/tests/r_expand_full/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-fn OUT=$test_name.log @@ -78,8 +81,3 @@ fi rm $OUT.before $OUT.after unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_ext4_big_expand/script b/tests/r_ext4_big_expand/script index 1b8c823ec..266c9039c 100644 --- a/tests/r_ext4_big_expand/script +++ b/tests/r_ext4_big_expand/script @@ -1,6 +1,9 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - test_description="very large fs growth using ext4" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + FEATURES="-t ext4" SIZE_1=512M SIZE_2=2T @@ -29,8 +32,3 @@ else fi unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_ext4_small_bg/script b/tests/r_ext4_small_bg/script index cdc6e4a3e..87f5084da 100644 --- a/tests/r_ext4_small_bg/script +++ b/tests/r_ext4_small_bg/script @@ -1,6 +1,9 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - test_description="ext4 1024 blocksize with small block groups" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + FEATURES="-t ext4 -O ^resize_inode -b 1024 -g 512" SIZE_1=64M SIZE_2=2G @@ -24,8 +27,3 @@ else fi unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_fixup_lastbg/script b/tests/r_fixup_lastbg/script index 6a5c5af63..04514210d 100755 --- a/tests/r_fixup_lastbg/script +++ b/tests/r_fixup_lastbg/script @@ -1,5 +1,8 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then test_description="fix up last bg when expanding within the last bg" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi EXP=$test_dir/expect OUT=$test_name.out @@ -31,7 +34,3 @@ else fi unset EXP LOG OUT E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/r_fixup_lastbg_big/script b/tests/r_fixup_lastbg_big/script index 97d9fd4af..a12fb1674 100755 --- a/tests/r_fixup_lastbg_big/script +++ b/tests/r_fixup_lastbg_big/script @@ -1,5 +1,8 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then test_description="fix up last bg when expanding beyond the last bg" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi EXP=$test_dir/expect OUT=$test_name.out @@ -31,7 +34,3 @@ else fi unset EXP LOG OUT E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/r_inline_xattr/script b/tests/r_inline_xattr/script index eb2085d87..04baac859 100644 --- a/tests/r_inline_xattr/script +++ b/tests/r_inline_xattr/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-yf @@ -46,8 +49,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_meta_bg_shrink/script b/tests/r_meta_bg_shrink/script index de7777758..c47d4ff88 100644 --- a/tests/r_meta_bg_shrink/script +++ b/tests/r_meta_bg_shrink/script @@ -1,6 +1,9 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - test_description="meta_bg shrink" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + FEATURES="-t ext4 -O 64bit,meta_bg,^resize_inode -b 1024" SIZE_1=1G SIZE_2=48M @@ -27,8 +30,3 @@ else fi unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_min_itable/script b/tests/r_min_itable/script index beb6cf9c9..e7787360e 100644 --- a/tests/r_min_itable/script +++ b/tests/r_min_itable/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi IMAGE=$test_dir/image.gz FSCK_OPT=-yf @@ -38,8 +41,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/r_move_itable/script b/tests/r_move_itable/script index 3f02a799f..6109f35f1 100644 --- a/tests/r_move_itable/script +++ b/tests/r_move_itable/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-yf OUT=$test_name.log @@ -110,7 +113,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/r_move_itable_nostride/script b/tests/r_move_itable_nostride/script index 261ef5390..d3b95b12e 100644 --- a/tests/r_move_itable_nostride/script +++ b/tests/r_move_itable_nostride/script @@ -10,7 +10,10 @@ if [ $(uname -s) = "Darwin" ]; then return 0 fi -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-yf OUT=$test_name.log @@ -63,7 +66,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/r_move_itable_realloc/script b/tests/r_move_itable_realloc/script index c42ec0453..7005bf805 100644 --- a/tests/r_move_itable_realloc/script +++ b/tests/r_move_itable_realloc/script @@ -10,7 +10,10 @@ if [ $(uname -s) = "Darwin" ]; then return 0 fi -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi FSCK_OPT=-yf OUT=$test_name.log @@ -63,7 +66,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/run_mke2fs b/tests/run_mke2fs index 82eca41ae..2a784fe61 100644 --- a/tests/run_mke2fs +++ b/tests/run_mke2fs @@ -20,7 +20,7 @@ AFTER_CMD='$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT1' else #if test -x $DEBUGFS_EXE; then rm -f $test_name.ok $test_name.failed - echo "skipped" + echo "skipped (no debugfs)" fi unset DESCRIPTION FS_SIZE MKE2FS_OPTS MKE2FS_SKIP_PROGRESS \ diff --git a/tests/t_iexpand_full/script b/tests/t_iexpand_full/script index f8565a740..875c70e85 100644 --- a/tests/t_iexpand_full/script +++ b/tests/t_iexpand_full/script @@ -1,4 +1,7 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi if [ $(uname -s) = "Darwin" ]; then # creates a 3GB filesystem @@ -78,8 +81,3 @@ fi rm $OUT.before $OUT.after unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/t_iexpand_mcsum/script b/tests/t_iexpand_mcsum/script index 4b584d377..116cad902 100644 --- a/tests/t_iexpand_mcsum/script +++ b/tests/t_iexpand_mcsum/script @@ -1,4 +1,8 @@ -if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + if [ $(uname -s) = "Darwin" ]; then # creates a 3GB filesystem echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)" @@ -78,8 +82,3 @@ fi rm $OUT.before $OUT.after unset IMAGE FSCK_OPT OUT EXP CONF - -else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi - diff --git a/tests/t_replay_and_set/script b/tests/t_replay_and_set/script index 36411fcfe..bec9108a7 100644 --- a/tests/t_replay_and_set/script +++ b/tests/t_replay_and_set/script @@ -1,4 +1,7 @@ -if test -x $DEBUGFS_EXE; then +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi FSCK_OPT=-fy OUT=$test_name.log @@ -25,7 +28,7 @@ echo "debugfs write journal" >> $OUT echo "jo" > $TMPFILE.cmd echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd echo "jc" >> $TMPFILE.cmd -$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT rm -rf $OUT.new @@ -54,7 +57,3 @@ else fi unset IMAGE FSCK_OPT OUT EXP - -else #if test -x $DEBUGFS_EXE; then - echo "$test_name: $test_description: skipped" -fi diff --git a/tests/u_debugfs_opt/script b/tests/u_debugfs_opt/script index bb93917e7..b5a65ec2a 100644 --- a/tests/u_debugfs_opt/script +++ b/tests/u_debugfs_opt/script @@ -1,5 +1,8 @@ test_description="e2undo with debugfs -z" -if test -x $E2UNDO_EXE -a -x $DEBUGFS_EXE; then +if ! test -x $E2UNDO_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/e2undo)" + return 0 +fi TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo OUT=$test_name.log @@ -29,4 +32,3 @@ else echo "$test_name: $test_description: failed" fi rm -f $TDB_FILE $TMPFILE -fi -- 2.39.5