diff options
author | Andreas Dilger <adilger@dilger.ca> | 2018-06-22 11:43:54 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-06-22 12:31:42 -0400 |
commit | 3819bff4cfceed456b2581228e66458cf800adf5 (patch) | |
tree | 8091ff8b525146546648e46dca8dd7a5ee4dce17 /tests/j_long_revoke_trans_mcsum_64bit | |
parent | 0647f84998bc7eebdde19ae38bb22156b2a0b34e (diff) | |
download | e2fsprogs-3819bff4cfceed456b2581228e66458cf800adf5.tar.gz |
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 <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tests/j_long_revoke_trans_mcsum_64bit')
-rw-r--r-- | tests/j_long_revoke_trans_mcsum_64bit/script | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/j_long_revoke_trans_mcsum_64bit/script b/tests/j_long_revoke_trans_mcsum_64bit/script index e206f88d..eef9f020 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 |