From: Theodore Ts'o Date: Mon, 7 Mar 2016 02:44:43 +0000 (-0500) Subject: tests: fix missing cleanup of temporary files X-Git-Tag: v1.43-WIP-2016-03-15~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96fae8869cfe393ce680369154a7847247e354ea;p=thirdparty%2Fe2fsprogs.git tests: fix missing cleanup of temporary files A number of tests weren't properly cleaning their temp files. Signed-off-by: Theodore Ts'o --- diff --git a/tests/f_uninit_cat/script b/tests/f_uninit_cat/script index 1655bb071..887756602 100755 --- a/tests/f_uninit_cat/script +++ b/tests/f_uninit_cat/script @@ -21,7 +21,7 @@ echo "cat /a" >> $TMPFILE.cmd $DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 echo >> $OUT.new sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT -rm -rf $OUT.new $TMPFILE +rm -rf $OUT.new $TMPFILE $TMPFILE.cmd # Figure out what happened if cmp -s $EXP $OUT; then diff --git a/tests/j_short_trans_mcsum_64bit/script b/tests/j_short_trans_mcsum_64bit/script index 024346aa9..034b23701 100644 --- a/tests/j_short_trans_mcsum_64bit/script +++ b/tests/j_short_trans_mcsum_64bit/script @@ -44,7 +44,7 @@ echo Exit status is $status >> $OUT.new sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT rm -f $OUT.new -rm -f $TMPFILE +rm -f $TMPFILE $TMPFILE.cmd cmp -s $OUT $EXP status=$? diff --git a/tests/j_short_trans_open_recover/script b/tests/j_short_trans_open_recover/script index 2a016dfae..67136fe61 100644 --- a/tests/j_short_trans_open_recover/script +++ b/tests/j_short_trans_open_recover/script @@ -48,7 +48,7 @@ echo Exit status is $status >> $OUT.new sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT rm -f $OUT.new -rm -f $TMPFILE +rm -f $TMPFILE $TMPFILE.cmd cmp -s $OUT $EXP status=$? diff --git a/tests/j_short_trans_recover/script b/tests/j_short_trans_recover/script index 33d234559..e7b49437f 100644 --- a/tests/j_short_trans_recover/script +++ b/tests/j_short_trans_recover/script @@ -49,7 +49,7 @@ echo Exit status is $status >> $OUT.new sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT rm -f $OUT.new -rm -f $TMPFILE +rm -f $TMPFILE $TMPFILE.cmd cmp -s $OUT $EXP status=$? diff --git a/tests/j_short_trans_recover_mcsum_64bit/script b/tests/j_short_trans_recover_mcsum_64bit/script index b6c8c49fe..2c56e0ff1 100644 --- a/tests/j_short_trans_recover_mcsum_64bit/script +++ b/tests/j_short_trans_recover_mcsum_64bit/script @@ -53,7 +53,7 @@ echo Exit status is $status >> $OUT.new sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT rm -f $OUT.new -rm -f $TMPFILE +rm -f $TMPFILE $TMPFILE.cmd cmp -s $OUT $EXP status=$? diff --git a/tests/scripts/resize_test b/tests/scripts/resize_test index dfd45ac8e..3c5e260bf 100755 --- a/tests/scripts/resize_test +++ b/tests/scripts/resize_test @@ -161,12 +161,13 @@ echo Checksum is $CSUM_2 >> $LOG rm $OUT_TMP unset OUT_TMP +rm -f $TMPFILE + if test "$CSUM_1" != "$CSUM_2" then return 1 fi -rm $TMPFILE return 0 } diff --git a/tests/t_replay_and_set/script b/tests/t_replay_and_set/script index 125309992..0be10ea80 100644 --- a/tests/t_replay_and_set/script +++ b/tests/t_replay_and_set/script @@ -39,7 +39,7 @@ echo Exit status is $status >> $OUT.new sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT rm -f $OUT.new -rm -f $TMPFILE +rm -f $TMPFILE $TMPFILE.cmd cmp -s $OUT $EXP status=$?