diff options
author | Jan Kara <jack@suse.cz> | 2018-05-29 18:56:00 +0200 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2018-06-03 22:16:15 +0800 |
commit | 5a111436bb88de4186a4c20b9d03f921de6bcad6 (patch) | |
tree | 8d5724bdef970bfbabf83e0224c009e2f6506ace | |
parent | 042fcd24dbbe27ec235c03011e5b6538857e135e (diff) | |
download | xfstests-dev-5a111436bb88de4186a4c20b9d03f921de6bcad6.tar.gz |
ext4/010: Fixup resize2fs and dumpe2fs usage
Use $RESIZE2FS_PROG and $DUMPE2FS_PROG instead of names directly to
make progs be executed with full path. Also add proper feature test
macros.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-x | tests/ext4/010 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/ext4/010 b/tests/ext4/010 index c877bd7af4..37ba2aaa7c 100755 --- a/tests/ext4/010 +++ b/tests/ext4/010 @@ -47,8 +47,10 @@ _supported_fs ext4 _supported_os Linux _require_scratch +_require_dumpe2fs test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs +_require_command "$RESIZE2FS_PROG" resize2fs rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" @@ -56,9 +58,9 @@ TESTFILE="${TESTDIR}/testfile" echo "+ create scratch fs" _scratch_mkfs_ext4 > /dev/null 2>&1 -dumpe2fs -g "${SCRATCH_DEV}" > /dev/null 2>&1 || _notrun "dumpe2fs -g not supported" -resize2fs -M "${SCRATCH_DEV}" >> $seqres.full 2>&1 -nr_groups="$(dumpe2fs -g "${SCRATCH_DEV}" 2> /dev/null | tail -n 1 | cut -d : -f 1)" +$DUMPE2FS_PROG -g "${SCRATCH_DEV}" > /dev/null 2>&1 || _notrun "dumpe2fs -g not supported" +$RESIZE2FS_PROG -M "${SCRATCH_DEV}" >> $seqres.full 2>&1 +nr_groups="$($DUMPE2FS_PROG -g "${SCRATCH_DEV}" 2> /dev/null | tail -n 1 | cut -d : -f 1)" echo "+ mount fs image" _scratch_mount @@ -74,7 +76,7 @@ echo "+ check fs" e2fsck -fn "${SCRATCH_DEV}" >> $seqres.full 2>&1 || _fail "fsck should not fail" echo "+ corrupt image" -dumpe2fs -g "${SCRATCH_DEV}" 2>/dev/null | awk -F ':' '{if (int($6) > 0) {print $6}}' | while read blk; do +$DUMPE2FS_PROG -g "${SCRATCH_DEV}" 2>/dev/null | awk -F ':' '{if (int($6) > 0) {print $6}}' | while read blk; do debugfs -w -n -R "zap_block ${blk}" "${SCRATCH_DEV}" >> $seqres.full 2>&1 || _fail "inode bitmap fuzz failed" done |