]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
cleanup: remove left files after test finishes
authorPavel Reichl <preichl@redhat.com>
Thu, 22 Sep 2022 18:55:01 +0000 (20:55 +0200)
committerZorro Lang <zlang@kernel.org>
Sat, 8 Oct 2022 11:19:18 +0000 (19:19 +0800)
Fix file leak in _get_max_file_size - This is obviously mostly
problematic for FS lacking support for sparse files.

There seems to be some seek_sanity_testfile files that are not
cleaned up and take up space:

-rwxr-xr-x. 1 root root 8.0G Sep 22 13:39 seek_sanity_testfile10

g/394: Clean up test files taking space:

-rwxr-xr-x. 1 root root 1.0G Sep 22 14:58 394.1183899
-rwxr-xr-x. 1 root root 1.0G Sep 22 14:58 394.1183899-1
-rwxr-xr-x. 1 root root    0 sep 22 14:58 394.1183899+1

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/generic/285
tests/generic/394
tests/generic/436
tests/generic/445
tests/generic/448

index d1f3d56bf82627166e7a15c6f5a97c413db004cd..d877ac77a0b5767bfc6dc1bcbf70a6dd7b5ffe73 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -4637,6 +4637,7 @@ _get_max_file_size()
                        l=$m
                fi
        done
+       rm -f $testfile
        echo $l
 }
 
index 6c755b5f79b802e90308194d45ecc1c219e30aae..d18500212fbf191114439d9863928f4a61cf6246 100755 (executable)
@@ -28,7 +28,7 @@ _require_test_program "seek_sanity_test"
 # Override the default cleanup function.
 _cleanup()
 {
-       eval "rm -f $BASE_TEST_FILE.*"
+       rm -f $BASE_TEST_FILE*
 }
 
 _run_seek_sanity_test $BASE_TEST_FILE > $seqres.full 2>&1 ||
index fc03e2f32a781363d6a5871d59eecb033f181f85..cbc2ce130713f92699f199d8d59a36bdd917de31 100755 (executable)
@@ -14,7 +14,7 @@ _cleanup()
 {
        cd /
        ulimit -f unlimited
-       rm -f $tmp.*
+       rm -f $tmp.* $TEST_DIR/$seq.*
 }
 
 # Import common functions.
index 7fb24b41c0f3713f376d033e2b57a13067cfa4e9..d54af436ebd4cf0f60852c11cedf4c8db8792bb4 100755 (executable)
@@ -16,7 +16,7 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
 # Override the default cleanup function.
 _cleanup()
 {
-       rm -f $tmp.* $BASE_TEST_FILE.*
+       rm -f $tmp.* $BASE_TEST_FILE*
 }
 
 # Import common functions.
index 05d1c5b344da3de731a283205e590742f188bbcf..d9e9f84b07fa79b9452c3a9272828c28194167c7 100755 (executable)
@@ -16,7 +16,7 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
 # Override the default cleanup function.
 _cleanup()
 {
-       rm -f $tmp.* $BASE_TEST_FILE.*
+       rm -f $tmp.* $BASE_TEST_FILE*
 }
 
 # Import common functions.
index d66967bc60dc0339be5b6c399a465f25dfdb88ec..11945549b8268de56864967c1752718163beb9dd 100755 (executable)
@@ -15,7 +15,7 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile_$seq
 _cleanup()
 {
        cd /
-       rm -f $tmp.* $BASE_TEST_FILE
+       rm -f $tmp.* $BASE_TEST_FILE*
 }
 
 # Import common functions.