e2fsprogs/tests/run_mke2fs
Andreas Dilger f9fd342e56 tests: clean up sed filtering of test output
The sed filters for test outputs that are used to remove build and
test specific information (such as version strings, dates, times,
UUIDs) were unconditionally deleting the first line of output.  This
would normally contain the tool version string, but in some cases
contained other information that was being lost.  This can lead to
difficulty debugging test failures.

The sed filtering has been changed to only remove the actual version
strings.  As well, similar filter strings were duplicated throughout
many scripts, and "sed" and "tr" were often called multiple times in
a pipeline.  These have been consolidated into a single filter.sed
file to avoid having to maintain these filters in multiple places.

In a few cases, accidentally deleted messages have been restored to
the expect output for the tests.  In other cases, trivial whitespace
has been changed in the expect files.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-06-15 18:44:09 -04:00

28 lines
782 B
Plaintext

if test -x $DEBUGFS_EXE; then
if [ "$FS_SIZE"x = x ]; then
FS_SIZE=1024
fi
OUT1=$test_name.1.log
OUT2=$test_name.2.log
SKIP_GUNZIP=true
ONE_PASS_ONLY=true
MKE2FS_SKIP_PROGRESS=true
MKE2FS_SKIP_CHECK_MSG=true
export MKE2FS_SKIP_PROGRESS MKE2FS_SKIP_CHECK_MSG
> $TMPFILE
PREP_CMD='$MKE2FS -F -o Linux $MKE2FS_OPTS $TMPFILE $FS_SIZE 2>&1 |
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" > $OUT1;
$DEBUGFS -R features $TMPFILE 2>&1 |
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT1'
AFTER_CMD='$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT1'
. $cmd_dir/run_e2fsck
else #if test -x $DEBUGFS_EXE; then
rm -f $test_name.ok $test_name.failed
echo "skipped"
fi
unset DESCRIPTION FS_SIZE MKE2FS_OPTS MKE2FS_SKIP_PROGRESS \
MKE2FS_DEVICE_SECTSIZE