diff --git a/tests/zfs-tests/tests/functional/quota/quota.kshlib b/tests/zfs-tests/tests/functional/quota/quota.kshlib index 5083415c89..b4cfde020f 100644 --- a/tests/zfs-tests/tests/functional/quota/quota.kshlib +++ b/tests/zfs-tests/tests/functional/quota/quota.kshlib @@ -95,3 +95,10 @@ function exceed_quota log_fail "Returned error code: $zret. Expected: $EDQUOT." return 0 } + +function reset_quota +{ + typeset FILESYSTEM="$1" + + log_must zfs set quota=none $FILESYSTEM +} 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 d124cb26ae..f01008a46b 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh @@ -64,6 +64,8 @@ function cleanup # wait_freeing $TESTPOOL sync_pool $TESTPOOL + + reset_quota $TESTPOOL/$TESTFS } 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 3af005e874..bea2a5a686 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh @@ -64,6 +64,8 @@ function cleanup wait_freeing $TESTPOOL sync_pool $TESTPOOL + + reset_quota $TESTPOOL/$TESTFS } 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 de265813d5..33f6421131 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh @@ -67,6 +67,8 @@ function cleanup # wait_freeing $TESTPOOL sync_pool $TESTPOOL + + reset_quota $TESTPOOL/$TESTCTR/$TESTFS1 } 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 8f20b533da..682d09f080 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh @@ -65,6 +65,8 @@ function cleanup wait_freeing $TESTPOOL sync_pool $TESTPOOL + + reset_quota $TESTPOOL/$TESTCTR/$TESTFS1 } log_onexit cleanup diff --git a/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh index fb3d97f486..9c4db81ca2 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh @@ -50,7 +50,7 @@ function cleanup { datasetexists $fs_child && destroy_dataset $fs_child - log_must zfs set quota=$quota_val $fs + reset_quota $fs } log_onexit cleanup diff --git a/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh b/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh index 12105162c5..111d771188 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh @@ -50,7 +50,7 @@ log_assert "Verify cannot set quota lower than the space currently in use" function cleanup { - log_must zfs set quota=none $TESTPOOL/$TESTFS + reset_quota $TESTPOOL/$TESTFS } log_onexit cleanup