aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2020-03-04 15:12:12 -0800
committerGitHub <[email protected]>2020-03-04 15:12:12 -0800
commit5a1abc4b5b4267ad8b03d14ba3b20df3d459202f (patch)
treeb336e6f2eba3dd3b28b3b66cb028edb23f869451 /tests
parentfa23c5be88e79d2da3d3482221e2e24d0d72de68 (diff)
ZTS: Speed up write_dirs cleanup
The write_dirs tests fill a filesystem with a bunch of files until it is full. In cleanup the files are truncated and removed individually. These tests already take a while to run. It is quicker and easier to destroy the whole dataset and create a new one to replace it in the cleanup functions. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10098
Diffstat (limited to 'tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh7
-rwxr-xr-xtests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh7
2 files changed, 4 insertions, 10 deletions
diff --git a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
index 60da382ca..d8c82f722 100755
--- a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_001_pos.ksh
@@ -47,11 +47,8 @@ verify_runnable "both"
function cleanup
{
- for file in `find $TESTDIR -type f`; do
- cat /dev/null > $file
- done
- log_must sync
- log_must rm -rf $TESTDIR/*
+ destroy_dataset $TESTPOOL/$TESTFS
+ zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
}
typeset -i retval=0
diff --git a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
index dcb793e1f..29ef9eadf 100755
--- a/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/write_dirs/write_dirs_002_pos.ksh
@@ -47,11 +47,8 @@ verify_runnable "both"
function cleanup
{
- for file in `find $TESTDIR -type f`; do
- cat /dev/null > $file
- done
- log_must sync
- log_must rm -rf $TESTDIR/*
+ destroy_dataset $TESTPOOL/$TESTFS
+ zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
}
typeset -i retval=0