summaryrefslogtreecommitdiff
path: root/tests/f_resize_inode/script
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@dilger.ca>2013-06-15 18:44:09 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-06-15 18:44:09 -0400
commitf9fd342e568dbadaadbb0b242f14271cb384c38b (patch)
tree5496324d1de0858250481a5ce81946e2052487a1 /tests/f_resize_inode/script
parent4718395120454ad7c193c76258ef5359f2ab3f2f (diff)
downloade2fsprogs-f9fd342e568dbadaadbb0b242f14271cb384c38b.tar.gz
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>
Diffstat (limited to 'tests/f_resize_inode/script')
-rw-r--r--tests/f_resize_inode/script36
1 files changed, 17 insertions, 19 deletions
diff --git a/tests/f_resize_inode/script b/tests/f_resize_inode/script
index 840432da..190871b4 100644
--- a/tests/f_resize_inode/script
+++ b/tests/f_resize_inode/script
@@ -15,15 +15,13 @@ cp /dev/null $OUT
dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT
-$MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 \
- | sed -e '1d' | grep -v "automatically checked" |
- grep -v 'Discarding device blocks' |
- grep -v "whichever comes first" >> $OUT
+$MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 2>&1 |
+ sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
@@ -33,18 +31,18 @@ echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" > $OUT.new
$DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
@@ -54,18 +52,18 @@ echo "debugfs -R ''clri <7>'' -w test.img" > $OUT.new
$DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
@@ -75,18 +73,18 @@ echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" > $OUT.new
$DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
@@ -96,12 +94,12 @@ echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" > $O
$DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
echo ----------------------------------------------- >> $OUT
@@ -111,18 +109,18 @@ echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" > $OUT.
$DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '2d' $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
-sed -e '1d' $OUT.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
rm -f $OUT.new