fstests: cleanup tmp files in tests
PATCH 1/1 fstests: cleanup tmp files in tests
$tmp.* files should be removed in _cleanup() even if the test is not using any $tmp.* file explicitly, because common helper functions may take use of them too.
So cleanup tmp files properly in tests, and add a _cleanup() function and trap it on exit if the test doesn't do so, to make all tests consistent on the way they do cleanup.
Also remove other tmp files used by the tests and the harness so that we leave no new tmp files in /tmp dir after a full test run.
--- common/rc | 1 + tests/btrfs/011 | 2 +- tests/btrfs/014 | 8 ++++++++ tests/btrfs/025 | 3 ++- tests/btrfs/030 | 3 ++- tests/btrfs/034 | 3 ++- tests/btrfs/037 | 4 ++-- tests/btrfs/038 | 3 ++- tests/btrfs/039 | 3 ++- tests/btrfs/040 | 3 ++- tests/btrfs/041 | 2 +- tests/btrfs/043 | 3 ++- tests/btrfs/044 | 3 ++- tests/btrfs/045 | 3 ++- tests/btrfs/046 | 4 ++-- tests/btrfs/048 | 4 ++-- tests/btrfs/049 | 2 +- tests/btrfs/050 | 4 ++-- tests/btrfs/051 | 4 ++-- tests/btrfs/052 | 2 +- tests/btrfs/053 | 4 ++-- tests/btrfs/054 | 4 ++-- tests/btrfs/055 | 2 +- tests/btrfs/056 | 2 +- tests/btrfs/058 | 2 +- tests/btrfs/059 | 2 +- tests/btrfs/076 | 2 +- tests/btrfs/077 | 6 +++--- tests/btrfs/078 | 4 ++-- tests/ext4/003 | 4 +++- tests/ext4/305 | 6 ++++-- tests/ext4/306 | 4 +++- tests/generic/004 | 5 +++-- tests/generic/005 | 7 ++++--- tests/generic/008 | 9 ++++++++- tests/generic/013 | 19 ++++++++++--------- tests/generic/015 | 1 + tests/generic/034 | 2 ++ tests/generic/038 | 2 +- tests/generic/039 | 1 + tests/generic/040 | 1 + tests/generic/041 | 1 + tests/generic/043 | 8 +++++++- tests/generic/044 | 7 ++++++- tests/generic/045 | 7 ++++++- tests/generic/046 | 7 ++++++- tests/generic/047 | 7 ++++++- tests/generic/048 | 7 ++++++- tests/generic/049 | 7 ++++++- tests/generic/050 | 1 + tests/generic/068 | 8 +++----- tests/generic/079 | 9 +++++---- tests/generic/087 | 3 ++- tests/generic/093 | 3 ++- tests/generic/100 | 2 +- tests/generic/102 | 7 ++++++- tests/generic/105 | 3 ++- tests/generic/113 | 5 +++-- tests/generic/114 | 5 +++-- tests/generic/123 | 7 ++++--- tests/generic/124 | 3 ++- tests/generic/125 | 7 ++++++- tests/generic/126 | 3 ++- tests/generic/127 | 3 ++- tests/generic/128 | 7 ++++++- tests/generic/129 | 7 ++++++- tests/generic/130 | 7 ++++++- tests/generic/131 | 5 +++-- tests/generic/132 | 7 ++++++- tests/generic/133 | 7 ++++++- tests/generic/135 | 7 ++++++- tests/generic/141 | 7 ++++++- tests/generic/192 | 1 + tests/generic/193 | 8 +++++++- tests/generic/215 | 1 + tests/generic/221 | 6 ++++++ tests/generic/236 | 2 ++ tests/generic/239 | 5 +++-- tests/generic/245 | 1 + tests/generic/246 | 1 + tests/generic/251 | 1 + tests/generic/257 | 1 + tests/generic/260 | 9 +++++++-- tests/generic/275 | 1 + tests/generic/277 | 4 +++- tests/generic/285 | 2 ++ tests/generic/286 | 2 ++ tests/generic/288 | 8 +++++++- tests/generic/307 | 2 ++ tests/generic/308 | 2 ++ tests/generic/309 | 8 +++++--- tests/generic/310 | 2 ++ tests/generic/311 | 2 ++ tests/generic/313 | 6 ++++-- tests/generic/317 | 5 +++-- tests/generic/318 | 5 +++-- tests/generic/321 | 2 ++ tests/generic/322 | 2 ++ tests/generic/325 | 2 ++ tests/shared/298 | 1 + tests/xfs/009 | 5 +++-- tests/xfs/142 | 7 ++++++- tests/xfs/143 | 7 ++++++- tests/xfs/144 | 7 ++++++- tests/xfs/145 | 7 ++++++- tests/xfs/146 | 7 ++++++- tests/xfs/147 | 7 ++++++- tests/xfs/150 | 7 ++++++- tests/xfs/151 | 7 ++++++- tests/xfs/152 | 7 ++++++- tests/xfs/153 | 7 ++++++- tests/xfs/154 | 7 ++++++- tests/xfs/155 | 7 ++++++- tests/xfs/156 | 7 ++++++- tests/xfs/157 | 7 ++++++- tests/xfs/158 | 7 ++++++- tests/xfs/159 | 7 ++++++- tests/xfs/160 | 7 ++++++- tests/xfs/161 | 7 ++++++- tests/xfs/162 | 7 ++++++- tests/xfs/163 | 7 ++++++- tests/xfs/166 | 7 ++++++- tests/xfs/167 | 1 + tests/xfs/168 | 7 ++++++- tests/xfs/175 | 2 +- tests/xfs/176 | 2 +- tests/xfs/185 | 7 ++++++- tests/xfs/190 | 7 +++++++ tests/xfs/195 | 1 + tests/xfs/197 | 1 + tests/xfs/199 | 1 + tests/xfs/201 | 1 + tests/xfs/202 | 6 ++++++ tests/xfs/203 | 1 + tests/xfs/205 | 6 ++++++ tests/xfs/206 | 9 +++++---- tests/xfs/220 | 1 + tests/xfs/229 | 3 ++- tests/xfs/250 | 1 + tests/xfs/259 | 4 +++- tests/xfs/261 | 4 ++-- tests/xfs/290 | 7 ++++++- 142 files changed, 493 insertions(+), 150 deletions(-)
common/rc +1 -0
@@ -566,6 +566,7 @@ _scratch_mkfs_ext4() # output mkfs stdout and stderr cat $tmp.mkfsstd cat $tmp.mkfserr >&2 + rm -f $tmp* return $mkfs_status }
tests/btrfs/011 +1 -1
@@ -50,7 +50,7 @@ _cleanup() kill -TERM $noise_pid fi wait - rm -f $tmp.tmp + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/btrfs/014 +8 -0
@@ -29,6 +29,14 @@ here="`pwd`" tmp=/tmp/$$ status=1 # failure is the default! +_cleanup() +{ + cd / + rm -f $tmp.* +} + +trap "_cleanup ; exit \$status" 0 1 2 3 15 + _create_snapshot() { for i in $(seq 20)
tests/btrfs/025 +2 -1
@@ -36,7 +36,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/030 +2 -1
@@ -42,7 +42,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/034 +2 -1
@@ -33,7 +33,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/037 +2 -2
@@ -33,14 +33,14 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -tmp=`mktemp -d` +tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/038 +2 -1
@@ -38,7 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/039 +2 -1
@@ -41,7 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/040 +2 -1
@@ -41,7 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/041 +1 -1
@@ -40,7 +40,7 @@ restore_dir=$TEST_DIR/btrfs-test-$seq _cleanup() { - rm -fr $tmp + rm -f $tmp.* rm -fr $restore_dir }
tests/btrfs/043 +2 -1
@@ -37,7 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/044 +2 -1
@@ -42,7 +42,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/045 +2 -1
@@ -58,7 +58,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/046 +2 -2
@@ -32,7 +32,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -tmp=`mktemp -d` +tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -41,7 +41,7 @@ send_files_dir=$TEST_DIR/btrfs-test-$seq _cleanup() { rm -fr $send_files_dir - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/048 +2 -2
@@ -34,8 +34,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $send_files_dir - rm -fr $tmp + rm -fr $send_files_dir + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/049 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { _cleanup_flakey - rm -rf $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/050 +2 -2
@@ -40,8 +40,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $send_files_dir - rm -fr $tmp + rm -fr $send_files_dir + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/051 +2 -2
@@ -37,8 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $send_files_dir - rm -fr $tmp + rm -fr $send_files_dir + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/052 +1 -1
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/053 +2 -2
@@ -38,8 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $send_files_dir - rm -fr $tmp + rm -fr $send_files_dir + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/054 +2 -2
@@ -46,8 +46,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $send_files_dir - rm -fr $tmp + rm -fr $send_files_dir + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/055 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/056 +1 -1
@@ -40,7 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { _cleanup_flakey - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/058 +1 -1
@@ -42,7 +42,7 @@ _cleanup() if [ ! -z $XFS_IO_PID ]; then kill $XFS_IO_PID > /dev/null 2>&1 fi - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/059 +1 -1
@@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/076 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/077 +3 -3
@@ -39,14 +39,14 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -tmp=`mktemp -d` +tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $send_files_dir - rm -fr $tmp + rm -fr $send_files_dir + rm -f $tmp.* } # get standard environment, filters and checks
tests/btrfs/078 +2 -2
@@ -34,13 +34,13 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -tmp=`mktemp -d` +tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/ext4/003 +3 -1
@@ -20,13 +20,15 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - _scratch_unmount + _scratch_unmount + rm $tmp.* } # get standard environment, filters and checks
tests/ext4/305 +4 -2
@@ -24,6 +24,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" PIDS=""
@@ -32,8 +33,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - kill $PIDS >/dev/null 2>&1 + cd / + kill $PIDS >/dev/null 2>&1 + rm -f $tmp.* } # get standard environment, filters and checks
tests/ext4/306 +3 -1
@@ -24,6 +24,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" PIDS=""
@@ -32,7 +33,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - _scratch_unmount + _scratch_unmount + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/004 +3 -2
@@ -32,8 +32,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -f ${testfile} + cd / + rm -f ${testfile} + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/005 +4 -3
@@ -43,9 +43,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd $TEST_DIR - rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file - cd / + cd $TEST_DIR + rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file + cd / + rm -f $tmp.* } _touch()
tests/generic/008 +8 -1
@@ -31,7 +31,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/013 +10 -9
@@ -33,15 +33,16 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - # we might get here with a RO FS - _test_cycle_mount - # now remove fsstress directory. - # N.B. rm(1) on IRIX can find problems when building up a long pathname - # such that what it has is greater the 1024 chars and will - # stop and complain - so get rid of complaint - # Ref. pv#935754 - rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long' + cd / + # we might get here with a RO FS + _test_cycle_mount + # now remove fsstress directory. + # N.B. rm(1) on IRIX can find problems when building up a long pathname + # such that what it has is greater the 1024 chars and will + # stop and complain - so get rid of complaint + # Ref. pv#935754 + rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long' + rm -f $tmp.* } _filesize()
tests/generic/015 +1 -0
@@ -37,6 +37,7 @@ status=1 # success is the default! _cleanup() { _scratch_unmount + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/034 +2 -0
@@ -31,6 +31,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -39,6 +40,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/038 +1 -1
@@ -57,7 +57,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -fr $tmp + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/039 +1 -0
@@ -43,6 +43,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/040 +1 -0
@@ -48,6 +48,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/041 +1 -0
@@ -52,6 +52,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/043 +7 -1
@@ -29,7 +29,13 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/044 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/045 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/046 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/047 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/048 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/049 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/050 +1 -0
@@ -33,6 +33,7 @@ _cleanup() { cd / blockdev --setrw $SCRATCH_DEV + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/068 +3 -5
@@ -35,13 +35,11 @@ ITERATIONS=10 _cleanup() { - cd / - - trap 0 1 2 3 15 - exit $status + cd / + rm -f $tmp.* } -trap "_cleanup" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/079 +5 -4
@@ -34,10 +34,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - echo "*** cleaning up" - $timmutable -r $SCRATCH_MNT/$seq - _scratch_unmount + cd / + echo "*** cleaning up" + $timmutable -r $SCRATCH_MNT/$seq + _scratch_unmount + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/087 +2 -1
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / + cd / + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/093 +2 -1
@@ -40,7 +40,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - [ -n "$TEST_DIR" ] && rm -f $file + [ -n "$TEST_DIR" ] && rm -f $file + rm -f $tmp.* } _testfilter()
tests/generic/100 +1 -1
@@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -f $tmp.* $testfile + rm -f $tmp.* $TEMP_DIR/$TAR_FILE } # real QA test starts here
tests/generic/102 +6 -1
@@ -34,7 +34,12 @@ echo "QA output created by $seq" tmp=/tmp/$$ status=1 -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/105 +2 -1
@@ -36,7 +36,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / + cd / + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/113 +3 -2
@@ -33,8 +33,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -f $TEST_DIR/aio-stress.$$.* + cd / + rm -f $TEST_DIR/aio-stress.$$.* + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/114 +3 -2
@@ -32,8 +32,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -f $TEST_DIR/tst-aio-dio-eof-race + cd / + rm -f $TEST_DIR/tst-aio-dio-eof-race + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/123 +4 -3
@@ -35,9 +35,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd $TEST_DIR - rm -rf $my_test_subdir - cd / + cd $TEST_DIR + rm -rf $my_test_subdir + cd / + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/124 +2 -1
@@ -37,7 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / + cd / + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/125 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/126 +2 -1
@@ -33,7 +33,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / + cd / + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/127 +2 -1
@@ -37,7 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -f $tmp.output + rm -f $tmp.output + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/128 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/129 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/130 +6 -1
@@ -38,7 +38,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/131 +3 -2
@@ -33,8 +33,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - kill $locktest_pid2 > /dev/null 2>&1 - kill $locktest_pid1 > /dev/null 2>&1 + kill $locktest_pid2 > /dev/null 2>&1 + kill $locktest_pid1 > /dev/null 2>&1 + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/132 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/133 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/135 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/141 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/192 +1 -0
@@ -36,6 +36,7 @@ trap "exit \$status" 0 1 2 3 15 _access_time() { stat -c %X $1 + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/193 +7 -1
@@ -28,7 +28,13 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "_cleanup_files; exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + _cleanup_files + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 tag="added by qa $seq" #
tests/generic/215 +1 -0
@@ -31,6 +31,7 @@ _cleanup() { cd / rm -f $testfile + rm -f $tmp.* } here=`pwd`
tests/generic/221 +6 -0
@@ -32,6 +32,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/236 +2 -0
@@ -25,11 +25,13 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" _cleanup() { rm -f $TEST_DIR/ouch* + rm -f $tmp.* } here=`pwd`
tests/generic/239 +3 -2
@@ -33,8 +33,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -f $TEST_DIR/tst-aio-dio-sparse-unwritten + cd / + rm -f $TEST_DIR/tst-aio-dio-sparse-unwritten + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/245 +1 -0
@@ -46,6 +46,7 @@ dir=$TEST_DIR/test-mv _cleanup() { rm -rf $dir + rm -f $tmp.* } # According to the rename(2) manpage you can get either EEXIST or ENOTEMPTY as an
tests/generic/246 +1 -0
@@ -48,6 +48,7 @@ _cleanup() { rm -rf $file rm -rf $file.NEW + rm -f $tmp.* } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/251 +1 -0
@@ -50,6 +50,7 @@ _require_batched_discard $SCRATCH_MNT _cleanup() { rm -rf $tmp + rm -f $tmp.* } _destroy()
tests/generic/257 +1 -0
@@ -32,6 +32,7 @@ status=1 # failure is the default! _cleanup() { rm -rf $TEST_DIR/ttt + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/260 +7 -2
@@ -26,9 +26,14 @@ seqres=$RESULT_DIR/$seq echo "QA output created by $seq" here=`pwd` -tmp=`mktemp -d` +tmp=/tmp/$$ +_cleanup() +{ + cd / + rm -f $tmp.* +} status=0 -trap "exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 chpid=0 mypid=$$
tests/generic/275 +1 -0
@@ -37,6 +37,7 @@ _cleanup() { cd / _scratch_unmount + rm -f $tmp.* } . ./common/rc
tests/generic/277 +3 -1
@@ -24,13 +24,15 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" status=1 # failure is the default! _cleanup() { - rm -f $SCRATCH_MNT/tmp* + rm -f $SCRATCH_MNT/tmp* + rm -f $tmp.* } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/285 +2 -0
@@ -27,6 +27,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -56,6 +57,7 @@ fi _cleanup() { eval "rm -f $BASE_TEST_FILE.*" + rm -f $tmp.* } $here/src/seek_sanity_test $BASE_TEST_FILE > $seqres.full 2>&1 ||
tests/generic/286 +2 -0
@@ -24,6 +24,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -49,6 +50,7 @@ _require_test_program "seek_copy_test" _cleanup() { rm -f $src $dest + rm -f $tmp.* } # seek_copy_test_01: tests file with holes and written data extents.
tests/generic/288 +7 -1
@@ -23,10 +23,16 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ +_cleanup() +{ + cd / + rm -f $tmp.* +} echo "QA output created by $seq" status=0 -trap "exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/generic/307 +2 -0
@@ -30,6 +30,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" status=1 # failure is the default!
@@ -39,6 +40,7 @@ _cleanup() { cd / rm -f $testfile + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/308 +2 -0
@@ -24,6 +24,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" status=1 # failure is the default!
@@ -33,6 +34,7 @@ _cleanup() { cd / rm -f $testfile + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/309 +5 -3
@@ -27,6 +27,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" status=0 # success is the default!
@@ -34,9 +35,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -rf $TEST_DIR/testdir_$seq - rm -f $TEST_DIR/testfile.$seq + cd / + rm -rf $TEST_DIR/testdir_$seq + rm -f $TEST_DIR/testfile.$seq + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/310 +2 -0
@@ -40,6 +40,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" status=1 # failure is the default!
@@ -47,6 +48,7 @@ status=1 # failure is the default! _cleanup() { rm -rf $TEST_DIR/tmp + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/311 +2 -0
@@ -34,6 +34,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -42,6 +43,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/313 +4 -2
@@ -26,6 +26,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -34,8 +35,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -f $testfile + cd / + rm -f $testfile + rm -f $tmp.* } # get standard environment, filters and checks
tests/generic/317 +3 -2
@@ -36,8 +36,9 @@ status=1 # failure is the default! _cleanup() { - cd / - _scratch_unmount >/dev/null 2>&1 + cd / + _scratch_unmount >/dev/null 2>&1 + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/318 +3 -2
@@ -37,8 +37,9 @@ status=1 # failure is the default! _cleanup() { - cd / - _scratch_unmount >/dev/null 2>&1 + cd / + _scratch_unmount >/dev/null 2>&1 + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/321 +2 -0
@@ -23,6 +23,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -31,6 +32,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/322 +2 -0
@@ -23,6 +23,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -31,6 +32,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/325 +2 -0
@@ -33,6 +33,7 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" here=`pwd`
@@ -41,6 +42,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_flakey + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/shared/298 +1 -0
@@ -47,6 +47,7 @@ _cleanup() rm -rf $tmp rm $img_file fi + rm -f $tmp.* } get_holes()
tests/xfs/009 +3 -2
@@ -36,8 +36,9 @@ bsize=4096 _cleanup() { - echo "*** unmount" - _scratch_unmount + echo "*** unmount" + _scratch_unmount + rm -f $tmp.* } _block_filter()
tests/xfs/142 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/143 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/144 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/145 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/146 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 _report_filter () { $PERL_PROG -ne "s/Report: \"0x[0-f]+\" was written and \"0x[0-f]+\" was read at/Report: \"HEX\" was written and \"HEX\" was read at/g ;
tests/xfs/147 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/150 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 _filter_fs_handle() {
tests/xfs/151 +6 -1
@@ -31,7 +31,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 _dm_create_session() {
tests/xfs/152 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 _filter_handles() {
tests/xfs/153 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/154 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/155 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/156 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/157 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/158 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/159 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/160 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/161 +6 -1
@@ -30,7 +30,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 _filter_get_allocinfo() {
tests/xfs/162 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/163 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 _filter_paths() {
tests/xfs/166 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 rm -f $seqres.full # get standard environment, filters and checks
tests/xfs/167 +1 -0
@@ -36,6 +36,7 @@ _cleanup() { $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null wait # ensures all fsstress processes died + rm -f $tmp.* } workout()
tests/xfs/168 +6 -1
@@ -29,9 +29,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ +_cleanup() +{ + cd / + rm -f $tmp.* +} rm -f $seqres.full status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 _filter_dmapi_print_event() { $PERL_PROG -ne '
tests/xfs/175 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -f $tmp/* + rm -f $tmp.* } # get standard environment, filters and checks
tests/xfs/176 +1 -1
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - rm -f $tmp/* + rm -f $tmp.* } # get standard environment, filters and checks
tests/xfs/185 +6 -1
@@ -29,7 +29,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/190 +7 -0
@@ -41,6 +41,13 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + rm -f $seqres.full # get standard environment, filters and checks
tests/xfs/195 +1 -0
@@ -35,6 +35,7 @@ _cleanup() { rm -rf $TEST_DIR/d rm -f $TEST_DIR/dumpfile + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/xfs/197 +1 -0
@@ -38,6 +38,7 @@ status=1 # failure is the default! _cleanup() { rm -rf $TEST_DIR/ttt + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/xfs/199 +1 -0
@@ -36,6 +36,7 @@ _cleanup() { cd / _scratch_unmount >/dev/null 2>&1 + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/xfs/201 +1 -0
@@ -35,6 +35,7 @@ status=1 # failure is the default! _cleanup() { _scratch_unmount + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/xfs/202 +6 -0
@@ -28,6 +28,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/203 +1 -0
@@ -59,6 +59,7 @@ _filter_bmap() _cleanup() { rm -f $SCRATCH_MNT/r?? + rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/xfs/205 +6 -0
@@ -28,6 +28,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
tests/xfs/206 +5 -4
@@ -38,10 +38,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - umount $tmpdir - rmdir $tmpdir - rm -f $tmp - rm -f $tmpfile + umount $tmpdir + rmdir $tmpdir + rm -f $tmp + rm -f $tmpfile + rm -f $tmp.* } # get standard environment, filters and checks
tests/xfs/220 +1 -0
@@ -36,6 +36,7 @@ status=1 # failure is the default! _cleanup() { cd / + rm -f $tmp.* _scratch_unmount >/dev/null 2>&1 } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/xfs/229 +2 -1
@@ -38,7 +38,8 @@ status=1 # failure is the default! _cleanup() { - rm -rf ${TDIR} + rm -rf ${TDIR} + rm -f $tmp.* } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/xfs/250 +1 -0
@@ -36,6 +36,7 @@ _cleanup() umount $LOOP_MNT 2>/dev/null rm -f $LOOP_DEV rmdir $LOOP_MNT + rm -f $tmp.* } # get standard environment, filters and checks
tests/xfs/259 +3 -1
@@ -24,13 +24,15 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq +tmp=/tmp/$$ echo "QA output created by $seq" status=1 # failure is the default! _cleanup() { - rm -f "$testfile" + rm -f "$testfile" + rm -f $tmp.* } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/xfs/261 +2 -2
@@ -41,8 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / - rm -f ${tmp}.* + cd / + rm -f ${tmp}.* } # get standard environment, filters and checks
tests/xfs/290 +6 -1
@@ -33,7 +33,12 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +_cleanup() +{ + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common/rc
Signature · 1 line
2.9.3
Hi Eryu,
Quoted 11 lines · Eryu Guan
$tmp.* files should be removed in
_cleanup()even if the test is not using any $tmp.* file explicitly, because common helper functions may take use of them too.So cleanup tmp files properly in tests, and add a
_cleanup()function and trap it on exit if the test doesn't do so, to make all tests consistent on the way they do cleanup.Also remove other tmp files used by the tests and the harness so that we leave no new tmp files in /tmp dir after a full test run.
Why exactly can't the boilerplate go in a preamble file which is sourced by all the tests? For example common/preamble containing something like:
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
_cleanup()
{
cd /
rm -f $tmp.*
}
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
. ./common/rcTests that need to do more cleanup could override the default trap.
Eric
Hi Eric and Amir,
Quoted 11 lines · Eric Biggers
Hi Eryu,
Quoted 8 lines · Eryu Guan
$tmp.* files should be removed in
_cleanup()even if the test is not using any $tmp.* file explicitly, because common helper functions may take use of them too.So cleanup tmp files properly in tests, and add a
_cleanup()function and trap it on exit if the test doesn't do so, to make all tests consistent on the way they do cleanup.
Quoted 6 lines
Quoted 3 lines
Also remove other tmp files used by the tests and the harness so that we leave no new tmp files in /tmp dir after a full test run.
Why exactly can't the boilerplate go in a preamble file which is sourced by all the tests? For example common/preamble containing something like:
Thanks for your review! As you two are basically suggesting the same solution, so I reply to you together.
I agree that we can do a common/preamble for all tests to source, but I don't think we need to do that and it's not worth the effort.
IMO, we define and setup the tests in the tests themselves, not in a common/preamble file, which makes the tests clear and easy to read. We don't want to "hide" any setups in a common file and to be a "surprise" to the reader, we don't have to look around for a certain setup.
Also, all the common setup code are all in "new" script, the template is created automatically, and I fixed all other problematic tests once in this patch, we don't have any extra maintain burden, as long as all new tests are created by "new" script.
And fstests has been this way for a very long time if not from the beginning. All the "old" users are familiar with this code style. Converting to preamble file doesn't seem gain us more, it doesn't seem worth the effort converting all existing 900+ tests to new style. And if we only source common/preamble in new tests, we result in inconsistency across tests.
But I'd like to see what other fstests users think on this.
Thanks,
Eryu
Quoted 25 lines
seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" _cleanup() { cd / rm -f $tmp.* } here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common/rcTests that need to do more cleanup could override the default trap.
Eric
--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 24 lines · Eryu Guan
Hi Eric and Amir,
Quoted 11 lines · Eric Biggers
Hi Eryu,
Quoted 8 lines · Eryu Guan
$tmp.* files should be removed in
_cleanup()even if the test is not using any $tmp.* file explicitly, because common helper functions may take use of them too.So cleanup tmp files properly in tests, and add a
_cleanup()function and trap it on exit if the test doesn't do so, to make all tests consistent on the way they do cleanup.Quoted 6 lines
Quoted 3 lines
Also remove other tmp files used by the tests and the harness so that we leave no new tmp files in /tmp dir after a full test run.
Why exactly can't the boilerplate go in a preamble file which is sourced by all the tests? For example common/preamble containing something like:
Thanks for your review! As you two are basically suggesting the same solution, so I reply to you together.
Quoted 8 lines
I agree that we can do a common/preamble for all tests to source, but I don't think we need to do that and it's not worth the effort.
IMO, we define and setup the tests in the tests themselves, not in a common/preamble file, which makes the tests clear and easy to read. We don't want to "hide" any setups in a common file and to be a "surprise" to the reader, we don't have to look around for a certain setup.
The motivation for your work is the fact that tmp files are being created in a way that is "hidden" from the test author and therefore, IMO, the cleanup of those temp files should also be in a common function that is "hidden" from the test author.
Quoted 7 lines
Also, all the common setup code are all in "new" script, the template is created automatically, and I fixed all other problematic tests once in this patch, we don't have any extra maintain burden, as long as all new tests are created by "new" script.
And fstests has been this way for a very long time if not from the beginning. All the "old" users are familiar with this code style.
I relate to this argument very much and if something works and doesn't both anyone, I believe we should let it be.
OTOH, this is the second tests wide change to _cleanup() that I remember from recent times, the first having to do with cd /. So IMO, _cleanup() should be made a generic function in common/cleanup and those test that wish to override it should use the syntax:
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/cleanup
my_cleanup()
{
# do my cleanup... and call generic cleanup
generic_cleanup
}
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "my_cleanup; exit \$status" 0 1 2 3 15
. ./common/rcYou don't even have to go over all the old tests and change them, but at least for the test for which you need to add rm -f $tmp.* just add a common _cleanup function and call it instead. The end result would be much nicer, IMO.
Quoted 35 lines
Converting to preamble file doesn't seem gain us more, it doesn't seem worth the effort converting all existing 900+ tests to new style. And if we only source common/preamble in new tests, we result in inconsistency across tests.
But I'd like to see what other fstests users think on this.
Thanks,
EryuQuoted 25 lines
seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" _cleanup() { cd / rm -f $tmp.* } here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common/rcTests that need to do more cleanup could override the default trap.
Eric
--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 34 lines · Amir Goldstein
Quoted 24 lines · Eryu Guan
Hi Eric and Amir,
Quoted 11 lines · Eric Biggers
Hi Eryu,
Quoted 8 lines · Eryu Guan
$tmp.* files should be removed in
_cleanup()even if the test is not using any $tmp.* file explicitly, because common helper functions may take use of them too.So cleanup tmp files properly in tests, and add a
_cleanup()function and trap it on exit if the test doesn't do so, to make all tests consistent on the way they do cleanup.Quoted 6 lines
Quoted 3 lines
Also remove other tmp files used by the tests and the harness so that we leave no new tmp files in /tmp dir after a full test run.
Why exactly can't the boilerplate go in a preamble file which is sourced by all the tests? For example common/preamble containing something like:
Thanks for your review! As you two are basically suggesting the same solution, so I reply to you together.
Quoted 8 lines
I agree that we can do a common/preamble for all tests to source, but I don't think we need to do that and it's not worth the effort.
IMO, we define and setup the tests in the tests themselves, not in a common/preamble file, which makes the tests clear and easy to read. We don't want to "hide" any setups in a common file and to be a "surprise" to the reader, we don't have to look around for a certain setup.
Quoted 4 lines
The motivation for your work is the fact that tmp files are being created in a way that is "hidden" from the test author and therefore, IMO, the cleanup of those temp files should also be in a common function that is "hidden" from the test author.
[Sorry, I got back to this late.]
That's a good point, so I think what should be done is let common functions clean up their tmp files, so there's no hidden usage of $tmp and tests only need to remove $tmp.* used explicitly in the tests.
I checked all the common functions, there're only two that are not cleaning up their tmp files properly, _do() and run_fsx().
I'll send v2 patch for review, which will be a much simpler patch.
Thanks,
Eryu
Quoted 8 lines · Eryu Guan
$tmp.* files should be removed in
_cleanup()even if the test is not using any $tmp.* file explicitly, because common helper functions may take use of them too.So cleanup tmp files properly in tests, and add a
_cleanup()function and trap it on exit if the test doesn't do so, to make all tests consistent on the way they do cleanup.
Quoted 5 lines
Also remove other tmp files used by the tests and the harness so that we leave no new tmp files in /tmp dir after a full test run.
Signed-off-by Eryu Guan <[email protected]>---
So much duplicated code!!
Did you consider consolidating all those lines that MUST start every test with:
# Always start a test with this line
. ./common/prologue
# This is the standatd cleanup trigger - remove to implement a private cleanup trigger
. ./common/cleanup
And while at it, why not put exit \$status inside the generic _cleanup()?
non generic cleanup implementations could looks like this:
trap "my_cleanup" 0 1 2 3 15
my_cleanup()
{
# my cleanup stuff...
# generic cleanup and exit $status
_cleanup
}