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 <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10098
This commit is contained in:
Brian Behlendorf 2020-03-04 15:12:12 -08:00 committed by GitHub
parent fa23c5be88
commit 5a1abc4b5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -47,11 +47,8 @@ verify_runnable "both"
function cleanup function cleanup
{ {
for file in `find $TESTDIR -type f`; do destroy_dataset $TESTPOOL/$TESTFS
cat /dev/null > $file zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
done
log_must sync
log_must rm -rf $TESTDIR/*
} }
typeset -i retval=0 typeset -i retval=0

View File

@ -47,11 +47,8 @@ verify_runnable "both"
function cleanup function cleanup
{ {
for file in `find $TESTDIR -type f`; do destroy_dataset $TESTPOOL/$TESTFS
cat /dev/null > $file zfs create -o mountpoint=$TESTDIR $TESTPOOL/$TESTFS
done
log_must sync
log_must rm -rf $TESTDIR/*
} }
typeset -i retval=0 typeset -i retval=0