summaryrefslogtreecommitdiff
path: root/tests/j_corrupt_journal_block
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@dilger.ca>2018-06-22 11:43:54 -0400
committerTheodore Ts'o <tytso@mit.edu>2018-06-22 12:31:42 -0400
commit3819bff4cfceed456b2581228e66458cf800adf5 (patch)
tree8091ff8b525146546648e46dca8dd7a5ee4dce17 /tests/j_corrupt_journal_block
parent0647f84998bc7eebdde19ae38bb22156b2a0b34e (diff)
downloade2fsprogs-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_corrupt_journal_block')
-rw-r--r--tests/j_corrupt_journal_block/script11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/j_corrupt_journal_block/script b/tests/j_corrupt_journal_block/script
index 2bce9733..a881bd1c 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