From 96fae8869cfe393ce680369154a7847247e354ea Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 6 Mar 2016 21:44:43 -0500 Subject: [PATCH] tests: fix missing cleanup of temporary files A number of tests weren't properly cleaning their temp files. Signed-off-by: Theodore Ts'o --- tests/f_uninit_cat/script | 2 +- tests/j_short_trans_mcsum_64bit/script | 2 +- tests/j_short_trans_open_recover/script | 2 +- tests/j_short_trans_recover/script | 2 +- tests/j_short_trans_recover_mcsum_64bit/script | 2 +- tests/scripts/resize_test | 3 ++- tests/t_replay_and_set/script | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/f_uninit_cat/script b/tests/f_uninit_cat/script index 1655bb07..88775660 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 024346aa..034b2370 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 2a016dfa..67136fe6 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 33d23455..e7b49437 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 b6c8c49f..2c56e0ff 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 dfd45ac8..3c5e260b 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 12530999..0be10ea8 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=$?