aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-03-26 13:48:19 -0400
committerGitHub <[email protected]>2020-03-26 10:48:19 -0700
commitef3331e703a8fa988bc09129f6f8d8f7c4c4082f (patch)
treeac94fde9cca0a94d589bdd6b87208219221bbbaf
parent112c1bff9422739b0bfa8156c44f6da63ae30fd0 (diff)
ZTS: Wait for free space between quota tests
And in removal tests, sync the specific pool we are waiting on. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10146
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_001_pos.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_002_pos.ksh3
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_003_pos.ksh11
-rwxr-xr-xtests/zfs-tests/tests/functional/quota/quota_004_pos.ksh3
-rw-r--r--tests/zfs-tests/tests/functional/removal/removal.kshlib2
5 files changed, 15 insertions, 7 deletions
diff --git a/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
index 9364a9f60..d6783e9a4 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
@@ -62,7 +62,8 @@ function cleanup
# pool, otherwise next test will fail trying to set a
# quota which is less than the space used.
#
- sleep 5
+ wait_freeing $TESTPOOL
+ sync_pool $TESTPOOL
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
index c54968bbc..2f34072dd 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
@@ -61,6 +61,9 @@ function cleanup
[[ -e $TESTDIR/$TESTFILE2 ]] && \
log_must rm $TESTDIR/$TESTFILE2
+
+ wait_freeing $TESTPOOL
+ sync_pool $TESTPOOL
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
index bec2243f9..6ab25cf2d 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
@@ -61,11 +61,12 @@ function cleanup
log_must rm $TESTDIR1/$TESTFILE1
#
- # Need to allow time for space to be released back to
- # pool, otherwise next test will fail trying to set a
- # quota which is less than the space used.
- #
- sleep 5
+ # Need to allow time for space to be released back to
+ # pool, otherwise next test will fail trying to set a
+ # quota which is less than the space used.
+ #
+ wait_freeing $TESTPOOL
+ sync_pool $TESTPOOL
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
index cc62d8fa9..373354438 100755
--- a/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
@@ -62,6 +62,9 @@ function cleanup
[[ -e $TESTDIR1/$TESTFILE2 ]] && \
log_must rm $TESTDIR1/$TESTFILE2
+
+ wait_freeing $TESTPOOL
+ sync_pool $TESTPOOL
}
log_onexit cleanup
diff --git a/tests/zfs-tests/tests/functional/removal/removal.kshlib b/tests/zfs-tests/tests/functional/removal/removal.kshlib
index 231991e82..140ac38ad 100644
--- a/tests/zfs-tests/tests/functional/removal/removal.kshlib
+++ b/tests/zfs-tests/tests/functional/removal/removal.kshlib
@@ -34,7 +34,7 @@ function wait_for_removal # pool
# The pool state changes before the TXG finishes syncing; wait for
# the removal to be completed on disk.
#
- sync_pool
+ sync_pool $pool
log_must is_pool_removed $pool
return 0