]> git.proxmox.com Git - mirror_zfs.git/commit
tests/quota: consistently clear quota property between tests
authorRob Norris <rob.norris@klarasystems.com>
Tue, 16 Apr 2024 04:56:35 +0000 (14:56 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 19 Apr 2024 23:06:56 +0000 (16:06 -0700)
commit26d49fec5f862818a0410fedbba1efded0543374
tree449416387e0cc1f65bade65b954fecffb2ff764f
parentf75574cbaaa1ade5bf24ab11751cbd5bc62ef7f1
tests/quota: consistently clear quota property between tests

When run in isolation, quota_005_pos would fail in cleanup because it
would attempt restore the previous quota, which was 0, and so get an
error (because you can't set quota to '0', you have to use 'none').

It worked as part of the quota tag set because the previous tests did
not clean up their quota, so there was always a non-zero quota to return
to.

This adds a simple quota reset function, and has all quota tests run it
at cleanup. For the ones that weren't cleaning up, they now do, and for
quota_005_pos, which was trying to do the right thing, it now just
resets it.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16097
tests/zfs-tests/tests/functional/quota/quota.kshlib
tests/zfs-tests/tests/functional/quota/quota_001_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_002_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_003_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_004_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh
tests/zfs-tests/tests/functional/quota/quota_006_neg.ksh