clean-up; Remove left files after test finishes
PATCH v2 1/2 clean-up; Remove left files after test finishes
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
--- common/rc | 1 + tests/generic/285 | 2 +- tests/generic/394 | 2 +- tests/generic/436 | 2 +- tests/generic/445 | 2 +- tests/generic/448 | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-)
common/rc +1 -0
@@ -4637,6 +4637,7 @@ _get_max_file_size() l=$m fi done + rm -f $testfile echo $l }
tests/generic/285 +1 -1
@@ -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 ||
tests/generic/394 +1 -1
@@ -14,7 +14,7 @@ _cleanup() { cd / ulimit -f unlimited - rm -f $tmp.* + rm -f $tmp.* $TEST_DIR/$seq.* } # Import common functions.
tests/generic/436 +1 -1
@@ -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.
tests/generic/445 +1 -1
@@ -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.
tests/generic/448 +1 -1
@@ -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.
Signature · 1 line
2.37.3
PATCH v2 2/2 g/299: skip test early if falloc is not supported
Move the _require_xfs_io_command "falloc" above the potencially 'expensive' function _get_max_file_size
--- tests/generic/299 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/299 +1 -1
@@ -24,6 +24,7 @@ _require_scratch _require_odirect _require_aio _require_block_device $SCRATCH_DEV +_require_xfs_io_command "falloc" NUM_JOBS=$((4*LOAD_FACTOR)) BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
@@ -96,7 +97,6 @@ filename=buffered-aio-verifier EOF _require_fio $fio_config -_require_xfs_io_command "falloc" _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount
Signature · 1 line
2.37.3
Re: [PATCH v2 2/2] g/299: skip test early if falloc is not supported
Quoted 5 lines · Pavel Reichl
Move the
_require_xfs_io_command"falloc" above the potencially 'expensive' function_get_max_file_sizeSigned-off-by Pavel Reichl <[email protected]>---
Hmm... looks like the _require_xfs_io_command "falloc" helps to save a helper "_require_falloc" which detects if fs (kernel part) supports fallocate, although it trys to make sure xfs_io supports falloc command.
Thanks,
Zorro
Quoted 26 lines
tests/generic/299 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/generic/299 +1
-1@@ -24,6 +24,7 @@ _require_scratch _require_odirect _require_aio _require_block_device $SCRATCH_DEV +_require_xfs_io_command "falloc" NUM_JOBS=$((4*LOAD_FACTOR)) BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`@@ -96,7 +97,6 @@ filename=buffered-aio-verifier EOF _require_fio $fio_config -_require_xfs_io_command "falloc" _scratch_mkfs >> $seqres.full 2>&1 _scratch_mountSignature · 1 line
2.37.3
Quoted 14 lines · Pavel Reichl
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_testfilefiles that are not cleaned up and take up space:-rwxr-xr-x. 1 root root 8.0G Sep 22 13:39
seek_sanity_testfile10g/394: Clean up test files taking space:
(quoted diff) +0
-3-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
Quoted 2 lines
Signed-off-by Pavel Reichl <[email protected]>---
This patch looks good to me, although I doubt _get_max_file_size() really can give you a proper max file size for your exfat testing. I even doubt if those cases test max file size are suit for exfat which doesn't support sparse file and fallocate. Anyway, you can deal with that problem later, this patch can be merged at first. Thanks.
Quoted 88 lines
common/rc | 1 + tests/generic/285 | 2 +- tests/generic/394 | 2 +- tests/generic/436 | 2 +- tests/generic/445 | 2 +- tests/generic/448 | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-)common/rc +1
-0@@ -4637,6 +4637,7 @@ _get_max_file_size() l=$m fi done + rm -f $testfile echo $l }tests/generic/285 +1
-1@@ -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 ||tests/generic/394 +1
-1@@ -14,7 +14,7 @@ _cleanup() { cd / ulimit -f unlimited - rm -f $tmp.* + rm -f $tmp.* $TEST_DIR/$seq.* } # Import common functions.tests/generic/436 +1
-1@@ -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.tests/generic/445 +1
-1@@ -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.tests/generic/448 +1
-1@@ -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.Signature · 1 line
2.37.3