fstests: cleanup $TEST_DIR/$seq* files
PATCH 1/1 fstests: cleanup $TEST_DIR/$seq* files
Test generic/007 was failing after running test overlay/007, because the latter left behind a directory named 007 in test dir and the former failed to mkdir a directory with the same name.
Greping the tests for the pattern $TEST_DIR/$seq* found some more files/dirs of this sort that were not being cleaned up.
Clean those files/dir on _cleanup trap to fix the 007 tests collision and avoid similar collisions in future tests.
Left the directories $TEST_DIR/$seq.mnt in tact, because they are always empty and created with mkdir -p.
There are more files left behind as can be seen in any aged test dir.
--- tests/generic/012 | 2 +- tests/generic/016 | 2 +- tests/generic/021 | 2 +- tests/generic/022 | 2 +- tests/generic/058 | 2 +- tests/generic/060 | 2 +- tests/generic/061 | 2 +- tests/generic/063 | 2 +- tests/generic/310 | 2 +- tests/generic/314 | 1 + tests/generic/316 | 2 +- tests/generic/355 | 2 +- tests/generic/360 | 2 +- tests/generic/394 | 1 + tests/overlay/007 | 1 + tests/xfs/077 | 2 +- tests/xfs/078 | 1 + tests/xfs/191-input-validation | 2 +- 18 files changed, 18 insertions(+), 14 deletions(-)
tests/generic/012 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/016 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/021 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/022 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/058 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/060 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/061 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/063 +1 -1
@@ -36,7 +36,7 @@ status=1 # failure is the default! _cleanup() { - rm -f $tmp.* + rm -f $tmp.* $testfile } trap "_cleanup ; exit \$status" 0 1 2 3 15
tests/generic/310 +1 -1
@@ -46,7 +46,7 @@ status=1 # failure is the default! _cleanup() { - rm -rf $TEST_DIR/tmp + rm -rf $TEST_DIR/tmp $SEQ_DIR } trap "_cleanup; exit \$status" 0 1 2 3 15
tests/generic/314 +1 -0
@@ -34,6 +34,7 @@ _cleanup() { cd / rm -f $tmp.* + rm -rf $TEST_DIR/$seq-dir } # get standard environment, filters and checks
tests/generic/316 +1 -1
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* $testfile } # get standard environment, filters and checks
tests/generic/355 +1 -1
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* $testfile } # get standard environment, filters and checks
tests/generic/360 +1 -1
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* $linkfile } # get standard environment, filters and checks
tests/generic/394 +1 -0
@@ -35,6 +35,7 @@ _cleanup() cd / ulimit -f unlimited rm -f $tmp.* + rm -f $TEST_DIR/$seq.$$* } # get standard environment, filters and checks
tests/overlay/007 +1 -0
@@ -37,6 +37,7 @@ _cleanup() { cd / rm -f $tmp.* + rm -rf $TEST_DIR/$seq } # get standard environment, filters and checks
tests/xfs/077 +1 -1
@@ -39,7 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* $IMGFILE } # get standard environment, filters and checks
tests/xfs/078 +1 -0
@@ -38,6 +38,7 @@ _cleanup() rm -f $tmp.* umount $LOOP_MNT 2>/dev/null [ -n "$LOOP_DEV" ] && losetup -d $LOOP_DEV + rm -f $LOOP_IMG rmdir $LOOP_MNT }
tests/xfs/191-input-validation +1 -1
@@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - rm -f $tmp.* + rm -f $tmp.* $fsimg } # get standard environment, filters and checks
Signature · 1 line
2.7.4
Quoted 7 lines · Amir Goldstein
Test generic/007 was failing after running test overlay/007, because the latter left behind a directory named 007 in test dir and the former failed to mkdir a directory with the same name.
Greping the tests for the pattern $TEST_DIR/$seq* found some more files/dirs of this sort that were not being cleaned up.
Quoted 7 lines
Clean those files/dir on
_cleanuptrap to fix the 007 tests collision and avoid similar collisions in future tests.Left the directories $TEST_DIR/$seq.mnt in tact, because they are always empty and created with mkdir -p.
There are more files left behind as can be seen in any aged test dir.
TEST_DIR is supposed to be aged over multiple runs, so leaving test files in it should be just fine, unless these files are consuming a lot of free space and would block subsequent tests.
For tests that need an empty dir or a newly created file in TEST_DIR, they could just remove the dir or file in test setup phase before doing any actual setups.
So I think adding "-p" to mkdir command in generic/007 looks sufficient.
Thanks,
Eryu
Quoted 11 lines · Eryu Guan
Quoted 10 lines · Amir Goldstein
Test generic/007 was failing after running test overlay/007, because the latter left behind a directory named 007 in test dir and the former failed to mkdir a directory with the same name.
Greping the tests for the pattern $TEST_DIR/$seq* found some more files/dirs of this sort that were not being cleaned up.
Clean those files/dir on
_cleanuptrap to fix the 007 tests collision and avoid similar collisions in future tests.
Quoted 9 lines
Quoted 4 lines
Left the directories $TEST_DIR/$seq.mnt in tact, because they are always empty and created with mkdir -p.
There are more files left behind as can be seen in any aged test dir.
TEST_DIRis supposed to be aged over multiple runs, so leaving test files in it should be just fine, unless these files are consuming a lot of free space and would block subsequent tests.
Good point, but aging doesn't mean that the files need to stay there create + delete is perfectly good aging.
As a matter of fact, all these test take care of removing the test files *before* running the test, so why not cleanup *after* the test as well? I can understand why it makes sense to leave behind $seq.$$ files to fill up TEST_DIR with junk over time, but I cannot understand the reasoning to leave behind $seq.<const> files, which are going to be removed before next run anyway.
Quoted 6 lines
For tests that need an empty dir or a newly created file in
TEST_DIR, they could just remove the dir or file in test setup phase before doing any actual setups.So I think adding "-p" to mkdir command in generic/007 looks sufficient.
Fair enough, but please give this cleanup issue a second thought.
Quoted 2 lines
Thanks,
Eryu
Quoted 22 lines · Amir Goldstein
Quoted 11 lines · Eryu Guan
Quoted 10 lines · Amir Goldstein
Test generic/007 was failing after running test overlay/007, because the latter left behind a directory named 007 in test dir and the former failed to mkdir a directory with the same name.
Greping the tests for the pattern $TEST_DIR/$seq* found some more files/dirs of this sort that were not being cleaned up.
Clean those files/dir on
_cleanuptrap to fix the 007 tests collision and avoid similar collisions in future tests.Quoted 9 lines
Quoted 4 lines
Left the directories $TEST_DIR/$seq.mnt in tact, because they are always empty and created with mkdir -p.
There are more files left behind as can be seen in any aged test dir.
TEST_DIRis supposed to be aged over multiple runs, so leaving test files in it should be just fine, unless these files are consuming a lot of free space and would block subsequent tests.
Quoted 8 lines
Good point, but aging doesn't mean that the files need to stay there create + delete is perfectly good aging.
As a matter of fact, all these test take care of removing the test files *before* running the test, so why not cleanup *after* the test as well? I can understand why it makes sense to leave behind $seq.$$ files to fill upTEST_DIRwith junk over time, but I cannot understand the reasoning to leave behind $seq.<const> files, which are going to be removed before next run anyway.
Looks reasonable to me, I'll take your v2 patch, thanks!
Eryu