[06/10] tests: remove redundant sed filtering

Message ID 1525235166-6448-7-git-send-email-adilger@dilger.ca
State Accepted, archived
Headers show
Series
  • test cleanups and minor improvements
Related show

Commit Message

Andreas Dilger May 2, 2018, 4:26 a.m.
Now that the majority of device name filtering is in filter.sed,
it does not need to be specified explicitly for every test.

Fix the error message printed in debugfs when opening the device
to match that used in other tools.  This simplifies the filtering,
and will be helpful if debugfs messages are internationalized.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
---
 debugfs/debugfs.c                                  |  3 ++-
 lib/support/plausible.c                            |  4 ++--
 tests/d_dumpe2fs_group_only/script                 |  2 +-
 tests/d_fallocate/script                           |  4 ++--
 tests/d_fallocate_bigalloc/script                  |  4 ++--
 tests/d_fallocate_blkmap/script                    |  4 ++--
 tests/d_punch/script                               |  4 ++--
 tests/d_punch_bigalloc/script                      |  4 ++--
 tests/f_collapse_extent_tree/script                |  4 ++--
 tests/f_compress_extent_tree_level/script          |  4 ++--
 tests/f_convert_bmap/script                        |  4 ++--
 tests/f_convert_bmap_and_extent/script             |  4 ++--
 tests/f_convert_bmap_sparse/script                 |  4 ++--
 tests/f_create_symlinks/script                     |  6 +++---
 tests/f_detect_junk/expect                         |  2 +-
 tests/f_detect_junk/script                         |  2 +-
 tests/f_detect_xfs/expect                          |  2 +-
 tests/f_detect_xfs/script                          |  2 +-
 tests/f_extent_too_deep/script                     |  4 ++--
 tests/f_opt_extent/script                          |  2 +-
 tests/f_opt_extent_ext3/script                     |  2 +-
 tests/f_readonly_fsck/script                       |  2 +-
 tests/f_resize_inode/script                        |  4 ++--
 tests/filter.sed                                   | 10 ++++++++++
 tests/j_short_trans/script                         |  4 ++--
 tests/j_short_trans_64bit/script                   |  4 ++--
 tests/j_short_trans_mcsum_64bit/script             |  4 ++--
 tests/j_short_trans_old_csum/script                |  4 ++--
 tests/j_short_trans_open_recover/script            |  4 ++--
 tests/j_short_trans_recover/script                 |  4 ++--
 tests/j_short_uncommitted_trans/script             |  4 ++--
 tests/j_short_uncommitted_trans_mcsum_64bit/script |  4 ++--
 tests/m_devdir/script                              |  2 +-
 tests/m_hugefile/script                            |  2 +-
 tests/r_inline_xattr/script                        |  2 +-
 tests/r_min_itable/script                          |  2 +-
 tests/r_move_itable/script                         | 19 +++++++++----------
 tests/r_move_itable_nostride/script                |  6 +++---
 tests/r_move_itable_realloc/script                 |  6 +++---
 tests/r_resize_inode/script                        | 19 ++++++++-----------
 tests/run_e2fsck                                   |  4 ++--
 tests/run_mke2fs                                   |  4 ++--
 tests/t_dangerous/script                           |  2 +-
 tests/t_iexpand_full/script                        |  2 +-
 tests/t_iexpand_mcsum/script                       |  2 +-
 tests/t_replay_and_set/script                      |  4 ++--
 tests/t_uninit_bg_rm/script                        |  2 +-
 tests/test_one.in                                  |  2 +-
 48 files changed, 103 insertions(+), 96 deletions(-)

Comments

Theodore Y. Ts'o June 22, 2018, 6:06 p.m. | #1
On Tue, May 01, 2018 at 10:26:02PM -0600, Andreas Dilger wrote:
> Now that the majority of device name filtering is in filter.sed,
> it does not need to be specified explicitly for every test.
> 
> Fix the error message printed in debugfs when opening the device
> to match that used in other tools.  This simplifies the filtering,
> and will be helpful if debugfs messages are internationalized.
> 
> Signed-off-by: Andreas Dilger <adilger@dilger.ca>

Thanks, applied with some minor fixups to address test failures in
m_hugefile and t_uninit_bg_rm.

					- Ted
Theodore Y. Ts'o June 22, 2018, 9:53 p.m. | #2
On Tue, May 01, 2018 at 10:26:03PM -0600, Andreas Dilger wrote:
> Don't call sed multiple times on the output, and avoid the use
> of temporary files, or if possible.  It would be convenient to
> use "sed -i" to only update the output file once, but this is
> not portable to all platforms.
> 
> Signed-off-by: Andreas Dilger <adilger@dilger.ca>

Thanks, applied.  I had to fix up a few test failures.

		    	       - Ted

Patch

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 905c8cd..8fc3b44 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -182,7 +182,8 @@  try_open_again:
 		goto try_open_again;
 	}
 	if (retval) {
-		com_err(device, retval, "while opening filesystem");
+		com_err(debug_prog_name, retval,
+			"while trying to open %s", device);
 		if (retval == EXT2_ET_BAD_MAGIC)
 			check_plausibility(device, CHECK_FS_EXIST, NULL);
 		current_fs = NULL;
diff --git a/lib/support/plausible.c b/lib/support/plausible.c
index 0636061..a726898 100644
--- a/lib/support/plausible.c
+++ b/lib/support/plausible.c
@@ -246,8 +246,8 @@  int check_plausibility(const char *device, int flags, int *ret_is_dev)
 
 	if (fs_type) {
 		if (fs_label)
-			printf(_("%s contains a %s file system "
-				 "labelled '%s'\n"), device, fs_type, fs_label);
+			printf(_("%s contains a %s file system labelled '%s'\n"),
+			       device, fs_type, fs_label);
 		else
 			printf(_("%s contains a %s file system\n"), device,
 			       fs_type);
diff --git a/tests/d_dumpe2fs_group_only/script b/tests/d_dumpe2fs_group_only/script
index c3ab7e2..f0ddcdb 100644
--- a/tests/d_dumpe2fs_group_only/script
+++ b/tests/d_dumpe2fs_group_only/script
@@ -25,7 +25,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 1048576 2>&1 | sed -
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo "dumpe2fs output" >> $OUT
diff --git a/tests/d_fallocate/script b/tests/d_fallocate/script
index b41eaaf..bb1ded2 100644
--- a/tests/d_fallocate/script
+++ b/tests/d_fallocate/script
@@ -29,7 +29,7 @@  rm -rf $TMPFILE.conf
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo "debugfs write files" >> $OUT
@@ -154,7 +154,7 @@  rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/d_fallocate_bigalloc/script b/tests/d_fallocate_bigalloc/script
index 9c8fde8..ec79cd8 100644
--- a/tests/d_fallocate_bigalloc/script
+++ b/tests/d_fallocate_bigalloc/script
@@ -30,7 +30,7 @@  rm -rf $TMPFILE.conf
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo "debugfs write files" >> $OUT
@@ -155,7 +155,7 @@  rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/d_fallocate_blkmap/script b/tests/d_fallocate_blkmap/script
index 86d1dee..fc262c6 100644
--- a/tests/d_fallocate_blkmap/script
+++ b/tests/d_fallocate_blkmap/script
@@ -29,7 +29,7 @@  rm -rf $TMPFILE.conf
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo "debugfs write files" >> $OUT
@@ -64,7 +64,7 @@  rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/d_punch/script b/tests/d_punch/script
index 5bb51cd..ba7270b 100644
--- a/tests/d_punch/script
+++ b/tests/d_punch/script
@@ -29,7 +29,7 @@  rm -rf $TMPFILE.conf
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo "debugfs write files" >> $OUT
@@ -108,7 +108,7 @@  rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/d_punch_bigalloc/script b/tests/d_punch_bigalloc/script
index 7d0c7fe..e184cd4 100644
--- a/tests/d_punch_bigalloc/script
+++ b/tests/d_punch_bigalloc/script
@@ -30,7 +30,7 @@  rm -rf $TMPFILE.conf
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo "debugfs write files" >> $OUT
@@ -109,7 +109,7 @@  rm -rf $OUT.new $TMPFILE.cmd $TMPFILE.cmd2
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/f_collapse_extent_tree/script b/tests/f_collapse_extent_tree/script
index ee18438..b489200 100644
--- a/tests/f_collapse_extent_tree/script
+++ b/tests/f_collapse_extent_tree/script
@@ -53,7 +53,7 @@  rm -rf $TMPFILE.cmd
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 if [ "$ONE_PASS_ONLY" != "true" ]; then
@@ -63,7 +63,7 @@  if [ "$ONE_PASS_ONLY" != "true" ]; then
 	echo 'ex /a' > $TMPFILE.cmd
 	$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
 	rm -rf $TMPFILE.cmd
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+	sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 	rm -f $OUT2.new
 fi
 
diff --git a/tests/f_compress_extent_tree_level/script b/tests/f_compress_extent_tree_level/script
index ee18438..b489200 100644
--- a/tests/f_compress_extent_tree_level/script
+++ b/tests/f_compress_extent_tree_level/script
@@ -53,7 +53,7 @@  rm -rf $TMPFILE.cmd
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 if [ "$ONE_PASS_ONLY" != "true" ]; then
@@ -63,7 +63,7 @@  if [ "$ONE_PASS_ONLY" != "true" ]; then
 	echo 'ex /a' > $TMPFILE.cmd
 	$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
 	rm -rf $TMPFILE.cmd
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+	sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 	rm -f $OUT2.new
 fi
 
diff --git a/tests/f_convert_bmap/script b/tests/f_convert_bmap/script
index f6b6f62..79dd79c 100644
--- a/tests/f_convert_bmap/script
+++ b/tests/f_convert_bmap/script
@@ -54,7 +54,7 @@  $TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1
 $FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 
@@ -63,7 +63,7 @@  echo Exit status is $status >> $OUT2.new
 echo 'ex /a' > $TMPFILE.cmd
 $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
 rm -rf $TMPFILE.cmd
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 rm -f $OUT2.new
 
 eval $AFTER_CMD
diff --git a/tests/f_convert_bmap_and_extent/script b/tests/f_convert_bmap_and_extent/script
index 203ab25..33f177a 100644
--- a/tests/f_convert_bmap_and_extent/script
+++ b/tests/f_convert_bmap_and_extent/script
@@ -55,7 +55,7 @@  $TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1
 $FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 
@@ -65,7 +65,7 @@  echo 'ex /a' > $TMPFILE.cmd
 echo 'ex /zero' >> $TMPFILE.cmd
 $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
 rm -rf $TMPFILE.cmd
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 rm -f $OUT2.new
 
 eval $AFTER_CMD
diff --git a/tests/f_convert_bmap_sparse/script b/tests/f_convert_bmap_sparse/script
index 89b7ed7..4315929 100644
--- a/tests/f_convert_bmap_sparse/script
+++ b/tests/f_convert_bmap_sparse/script
@@ -54,7 +54,7 @@  $TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1
 $FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 
@@ -63,7 +63,7 @@  echo Exit status is $status >> $OUT2.new
 echo 'ex /realmode.bin' > $TMPFILE.cmd
 $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
 rm -rf $TMPFILE.cmd
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 rm -f $OUT2.new
 
 eval $AFTER_CMD
diff --git a/tests/f_create_symlinks/script b/tests/f_create_symlinks/script
index b7c22d3..59424a5 100644
--- a/tests/f_create_symlinks/script
+++ b/tests/f_create_symlinks/script
@@ -18,12 +18,12 @@  dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
 
 echo mke2fs -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 test.img 1024 >> $OUT
 $MKE2FS -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 $TMPFILE 1024 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 B="xxxxxxx"; B+=$B; B+=$B; B+=$B; B+=$B; B+=$B; B+=$B; B+=$B; B+=$B
@@ -43,7 +43,7 @@  done
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/f_detect_junk/expect b/tests/f_detect_junk/expect
index 8febb84..59f34b8 100644
--- a/tests/f_detect_junk/expect
+++ b/tests/f_detect_junk/expect
@@ -12,7 +12,7 @@  is corrupt, and you might try running e2fsck with an alternate superblock:
     e2fsck -b 32768 <device>
 
 *** debugfs
-test.img: Bad magic number in super-block while opening filesystem
+debugfs: Bad magic number in super-block while trying to open test.img
 Checksum errors in superblock!  Retrying...
 *** tune2fs
 ../misc/tune2fs: Bad magic number in super-block while trying to open test.img
diff --git a/tests/f_detect_junk/script b/tests/f_detect_junk/script
index ab2a38c..73980d6 100644
--- a/tests/f_detect_junk/script
+++ b/tests/f_detect_junk/script
@@ -28,7 +28,7 @@  $TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1
 echo "*** mke2fs" >> $OUT
 $MKE2FS -n $TMPFILE >> $OUT 2>&1
 
-sed -f $cmd_dir/filter.sed -e "s|$TMPFILE|test.img|g" < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 # Figure out what happened
diff --git a/tests/f_detect_xfs/expect b/tests/f_detect_xfs/expect
index d0ece6a..fb510d9 100644
--- a/tests/f_detect_xfs/expect
+++ b/tests/f_detect_xfs/expect
@@ -13,7 +13,7 @@  is corrupt, and you might try running e2fsck with an alternate superblock:
 
 test.img contains a xfs file system labelled 'test_filsys'
 *** debugfs
-test.img: Bad magic number in super-block while opening filesystem
+debugfs: Bad magic number in super-block while trying to open test.img
 Checksum errors in superblock!  Retrying...
 test.img contains a xfs file system labelled 'test_filsys'
 *** tune2fs
diff --git a/tests/f_detect_xfs/script b/tests/f_detect_xfs/script
index 4da1cd9..abd5da8 100644
--- a/tests/f_detect_xfs/script
+++ b/tests/f_detect_xfs/script
@@ -23,7 +23,7 @@  $TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1
 echo "*** mke2fs" >> $OUT
 $MKE2FS -n -b 1024 $TMPFILE >> $OUT 2>&1
 
-sed -f $cmd_dir/filter.sed -e "s|$TMPFILE|test.img|g" < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 # Figure out what happened
diff --git a/tests/f_extent_too_deep/script b/tests/f_extent_too_deep/script
index ee18438..b489200 100644
--- a/tests/f_extent_too_deep/script
+++ b/tests/f_extent_too_deep/script
@@ -53,7 +53,7 @@  rm -rf $TMPFILE.cmd
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 if [ "$ONE_PASS_ONLY" != "true" ]; then
@@ -63,7 +63,7 @@  if [ "$ONE_PASS_ONLY" != "true" ]; then
 	echo 'ex /a' > $TMPFILE.cmd
 	$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
 	rm -rf $TMPFILE.cmd
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+	sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 	rm -f $OUT2.new
 fi
 
diff --git a/tests/f_opt_extent/script b/tests/f_opt_extent/script
index 2da5e91..f2228dc 100644
--- a/tests/f_opt_extent/script
+++ b/tests/f_opt_extent/script
@@ -47,7 +47,7 @@  rm $TMPFILE $OUT.before $OUT.after
 # Do the verification
 #
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 cmp -s $OUT $EXP
diff --git a/tests/f_opt_extent_ext3/script b/tests/f_opt_extent_ext3/script
index 931eae7..4dace4e 100644
--- a/tests/f_opt_extent_ext3/script
+++ b/tests/f_opt_extent_ext3/script
@@ -48,7 +48,7 @@  rm $TMPFILE $OUT.before $OUT.after
 # Do the verification
 #
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 cmp -s $OUT $EXP
diff --git a/tests/f_readonly_fsck/script b/tests/f_readonly_fsck/script
index d46c5a8..8e67e1f 100644
--- a/tests/f_readonly_fsck/script
+++ b/tests/f_readonly_fsck/script
@@ -18,7 +18,7 @@  old="$($CRCSUM < $TMPFILE)"
 $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 new="$($CRCSUM < $TMPFILE)"
diff --git a/tests/f_resize_inode/script b/tests/f_resize_inode/script
index 0243bda..a4f1949 100644
--- a/tests/f_resize_inode/script
+++ b/tests/f_resize_inode/script
@@ -19,12 +19,12 @@  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 -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 echo ----------------------------------------------- >> $OUT
diff --git a/tests/filter.sed b/tests/filter.sed
index 628309d..f37986c 100644
--- a/tests/filter.sed
+++ b/tests/filter.sed
@@ -27,3 +27,13 @@  s/\\015//g
 s/, csum 0x\([0-9a-f]*\)//g
 s/ csum 0x\([0-9a-f]*\)//g
 /^Checksum:/d
+s/while trying to open [^ ]*/while trying to open test.img/
+s/he filesystem on [^ ]* /he filesystem on test.img /
+s/^[^ ]* contains a \([a-z]*\) file system /test.img contains a \1 file system /
+s/MMP block [0-9]* from [^ ]*/MMP block from test.img/
+s/safe to mount '.*', MMP/safe to mount 'test.img', MMP/
+s/mmp_device_name: .*/mmp_device_name: test.img/
+s/mmp_node_name: .*/mmp_node_name: test_node/
+s/mmp_update_date: .*/mmp_update_date: test date/
+s/mmp_update_time: .*/mmp_update_time: test_time/
+s/MMP last updated by '.*' on .*/MMP last updated by 'test_node' on test date/
diff --git a/tests/j_short_trans/script b/tests/j_short_trans/script
index 8108ba8..ff2322c 100644
--- a/tests/j_short_trans/script
+++ b/tests/j_short_trans/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 2>&1 | sed -f
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -40,7 +40,7 @@  rm -rf $TMPFILE.cmd
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/j_short_trans_64bit/script b/tests/j_short_trans_64bit/script
index 70649c2..b7525fb 100644
--- a/tests/j_short_trans_64bit/script
+++ b/tests/j_short_trans_64bit/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal -T ext4 $TMPFILE 65536 2>&1 | s
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -44,7 +44,7 @@  rm -rf $TMPFILE.cmd
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/j_short_trans_mcsum_64bit/script b/tests/j_short_trans_mcsum_64bit/script
index ad736eb..a8f4e93 100644
--- a/tests/j_short_trans_mcsum_64bit/script
+++ b/tests/j_short_trans_mcsum_64bit/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -44,7 +44,7 @@  rm -rf $TMPFILE.cmd
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE $TMPFILE.cmd
diff --git a/tests/j_short_trans_old_csum/script b/tests/j_short_trans_old_csum/script
index cb13acb..46d0336 100644
--- a/tests/j_short_trans_old_csum/script
+++ b/tests/j_short_trans_old_csum/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 2>&1 | sed -f
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -44,7 +44,7 @@  rm -rf $TMPFILE.cmd
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/j_short_trans_open_recover/script b/tests/j_short_trans_open_recover/script
index fe1d9e8..b0cc790 100644
--- a/tests/j_short_trans_open_recover/script
+++ b/tests/j_short_trans_open_recover/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 2>&1 | sed -f
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -48,7 +48,7 @@  rm -rf $OUT.new
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE $TMPFILE.cmd
diff --git a/tests/j_short_trans_recover/script b/tests/j_short_trans_recover/script
index a44111b..ce82c87 100644
--- a/tests/j_short_trans_recover/script
+++ b/tests/j_short_trans_recover/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 2>&1 | sed -f
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -49,7 +49,7 @@  rm -rf $OUT.new
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE $TMPFILE.cmd
diff --git a/tests/j_short_uncommitted_trans/script b/tests/j_short_uncommitted_trans/script
index ef0548b..694d0c9 100644
--- a/tests/j_short_uncommitted_trans/script
+++ b/tests/j_short_uncommitted_trans/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 2>&1 | sed -f
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -40,7 +40,7 @@  rm -rf $TMPFILE.cmd
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/j_short_uncommitted_trans_mcsum_64bit/script b/tests/j_short_uncommitted_trans_mcsum_64bit/script
index 68965a9..87e4c27 100644
--- a/tests/j_short_uncommitted_trans_mcsum_64bit/script
+++ b/tests/j_short_uncommitted_trans_mcsum_64bit/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -44,7 +44,7 @@  rm -rf $TMPFILE.cmd
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE
diff --git a/tests/m_devdir/script b/tests/m_devdir/script
index 3b1ef10..ef365b3 100644
--- a/tests/m_devdir/script
+++ b/tests/m_devdir/script
@@ -16,7 +16,7 @@  $DEBUGFS -R 'ls /' $TMPFILE >> $OUT 2>&1
 $FSCK -f -n $TMPFILE >> $OUT 2>&1
 fsck_status=$?
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.tmp
+sed -f $cmd_dir/filter.sed < $OUT > $OUT.tmp
 mv $OUT.tmp $OUT
 
 if [ $mkfs_status -ne 0 ]; then
diff --git a/tests/m_hugefile/script b/tests/m_hugefile/script
index 68d26fb..846e4c6 100644
--- a/tests/m_hugefile/script
+++ b/tests/m_hugefile/script
@@ -102,7 +102,7 @@  rm $TMPFILE
 # Do the verification
 #
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 cmp -s $OUT $EXP
diff --git a/tests/r_inline_xattr/script b/tests/r_inline_xattr/script
index 04baac8..7f0fb23 100644
--- a/tests/r_inline_xattr/script
+++ b/tests/r_inline_xattr/script
@@ -23,7 +23,7 @@  echo "resize2fs test.img 5M" >> $OUT
 $RESIZE2FS $TMPFILE 5M 2>&1 >> $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 
 # Look at inline extended attribute in resized fs
 echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''" >> $OUT
diff --git a/tests/r_min_itable/script b/tests/r_min_itable/script
index e778736..b889adc 100644
--- a/tests/r_min_itable/script
+++ b/tests/r_min_itable/script
@@ -22,7 +22,7 @@  echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
 $FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 echo Exit status is $status >> $OUT.new
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm $TMPFILE $OUT.new
 
 #
diff --git a/tests/r_move_itable/script b/tests/r_move_itable/script
index 6109f35..c017efc 100644
--- a/tests/r_move_itable/script
+++ b/tests/r_move_itable/script
@@ -18,16 +18,15 @@  dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
 
 echo mke2fs -q -F -o Linux -b 1024 -g 256 test.img 1024 > $OUT
 $MKE2FS -q -F -o Linux -b 1024 -g 256 $TMPFILE 1024 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 echo resize2fs -p test.img 10000 >> $OUT
-$RESIZE2FS -p $TMPFILE 10000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+$RESIZE2FS -p $TMPFILE 10000 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
@@ -42,12 +41,12 @@  echo "--------------------------------" >> $OUT
 
 echo resize2fs -p test.img 20000 >> $OUT
 $RESIZE2FS -p $TMPFILE 20000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
@@ -62,12 +61,12 @@  echo "--------------------------------" >> $OUT
 
 echo resize2fs -p test.img 30000 >> $OUT
 $RESIZE2FS -p $TMPFILE 30000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
@@ -82,12 +81,12 @@  echo "--------------------------------" >> $OUT
 
 echo resize2fs -p test.img 40000 >> $OUT
 $RESIZE2FS -p $TMPFILE 40000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
diff --git a/tests/r_move_itable_nostride/script b/tests/r_move_itable_nostride/script
index d3b95b1..ec4665e 100644
--- a/tests/r_move_itable_nostride/script
+++ b/tests/r_move_itable_nostride/script
@@ -31,16 +31,16 @@  dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
 echo mke2fs -q -F -o Linux -b 1024 -i 1024 -E stride=8192 -t ext4 test.img 1024000 > $OUT
 $MKE2FS -q -F -o Linux -b 1024 -i 1024 -E stride=8192 -t ext4 \
 	$TMPFILE 1024000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 echo resize2fs -p test.img 10240000 >> $OUT
 $RESIZE2FS -p $TMPFILE 100000000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
diff --git a/tests/r_move_itable_realloc/script b/tests/r_move_itable_realloc/script
index 7005bf8..7d4b5ba 100644
--- a/tests/r_move_itable_realloc/script
+++ b/tests/r_move_itable_realloc/script
@@ -31,16 +31,16 @@  dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
 echo mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000 > $OUT
 $MKE2FS -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 \
 	$TMPFILE 1024000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 echo resize2fs -p test.img 10240000 >> $OUT
 $RESIZE2FS -p $TMPFILE 100000000 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
diff --git a/tests/r_resize_inode/script b/tests/r_resize_inode/script
index 4e3eb19..8b586d3 100644
--- a/tests/r_resize_inode/script
+++ b/tests/r_resize_inode/script
@@ -15,16 +15,15 @@  dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
 
 echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT
 $MKE2FS -q -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
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 echo resize2fs test.img 65536 >> $OUT
-$RESIZE2FS $TMPFILE 65536 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+$RESIZE2FS $TMPFILE 65536 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
@@ -41,16 +40,15 @@  dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
 
 echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 >> $OUT
 $MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 65536 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+	sed -f $cmd_dir/filter.sed >> $OUT
 
 echo resize2fs test.img 16384 >> $OUT
-$RESIZE2FS $TMPFILE 16384 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+$RESIZE2FS $TMPFILE 16384 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
@@ -64,13 +62,12 @@  $DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n
 echo "--------------------------------" >> $OUT
 
 echo resize2fs test.img 165536 >> $OUT
-$RESIZE2FS $TMPFILE 165536 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT
+$RESIZE2FS $TMPFILE 165536 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 $DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1
diff --git a/tests/run_e2fsck b/tests/run_e2fsck
index 5f28d92..f965179 100644
--- a/tests/run_e2fsck
+++ b/tests/run_e2fsck
@@ -50,14 +50,14 @@  eval $PREP_CMD
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT1.new >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 if [ "$ONE_PASS_ONLY" != "true" ]; then
 	$FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 
 	status=$?
 	echo Exit status is $status >> $OUT2.new
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT2.new > $OUT2
+	sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
 	rm -f $OUT2.new
 fi
 
diff --git a/tests/run_mke2fs b/tests/run_mke2fs
index 2a784fe..7a47f56 100644
--- a/tests/run_mke2fs
+++ b/tests/run_mke2fs
@@ -12,9 +12,9 @@  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;
+	sed -f $cmd_dir/filter.sed >> $OUT1;
 	$DEBUGFS -R features $TMPFILE 2>&1 |
-	sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" >> $OUT1'
+	sed -f $cmd_dir/filter.sed >> $OUT1'
 AFTER_CMD='$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT1'
 . $cmd_dir/run_e2fsck
 
diff --git a/tests/t_dangerous/script b/tests/t_dangerous/script
index dc70ad2..b714218 100644
--- a/tests/t_dangerous/script
+++ b/tests/t_dangerous/script
@@ -117,7 +117,7 @@  rm $TMPFILE $OUT.before $OUT.after $CONF
 # Do the verification
 #
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 cmp -s $OUT $EXP
diff --git a/tests/t_iexpand_full/script b/tests/t_iexpand_full/script
index 875c70e..63302c8 100644
--- a/tests/t_iexpand_full/script
+++ b/tests/t_iexpand_full/script
@@ -64,7 +64,7 @@  rm $TMPFILE
 # Do the verification
 #
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 cmp -s $OUT $EXP
diff --git a/tests/t_iexpand_mcsum/script b/tests/t_iexpand_mcsum/script
index 116cad9..d9cd28f 100644
--- a/tests/t_iexpand_mcsum/script
+++ b/tests/t_iexpand_mcsum/script
@@ -65,7 +65,7 @@  rm $TMPFILE
 # Do the verification
 #
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
+sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new
 mv $OUT.new $OUT
 
 cmp -s $OUT $EXP
diff --git a/tests/t_replay_and_set/script b/tests/t_replay_and_set/script
index bec9108..2663af2 100644
--- a/tests/t_replay_and_set/script
+++ b/tests/t_replay_and_set/script
@@ -19,7 +19,7 @@  $MKE2FS -F -o Linux -b 4096 -O has_journal,metadata_csum -T ext4 $TMPFILE 65536
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
@@ -39,7 +39,7 @@  echo "fsck the whole mess" >> $OUT
 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT.new
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
 rm -f $OUT.new
 
 rm -f $TMPFILE $TMPFILE.cmd
diff --git a/tests/t_uninit_bg_rm/script b/tests/t_uninit_bg_rm/script
index 308ef25..1bb0358 100644
--- a/tests/t_uninit_bg_rm/script
+++ b/tests/t_uninit_bg_rm/script
@@ -34,7 +34,7 @@  echo " " >> $OUT.new
 echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
 $FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 
-sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT
+sed -f $cmd_dir/filter.sed $OUT.new > $OUT
 
 rm -f $OUT.new $TMPFILE
 
diff --git a/tests/test_one.in b/tests/test_one.in
index 664cf86..7c5f464 100644
--- a/tests/test_one.in
+++ b/tests/test_one.in
@@ -57,7 +57,7 @@  if [ -n "$SKIP_SLOW_TESTS" -a -f $test_dir/is_slow_test ]; then
     exit 0
 fi
 
-rm -f $test_name.ok $test_name.failed
+rm -f $test_name.ok $test_name.failed $test_name.log $test_name.slow
 #echo -e -n "$test_name: $test_description:\r"
 
 TMPFILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-tmp-$test_name.XXXXXX)