Add `wait_freeing` helper function to ZTS
commitd834b9ce5ba6be96ce13c31351cf92c89f7762fe
authorGeorge Melikov <mail@gmelikov.ru>
Wed, 8 Feb 2017 23:27:37 +0000 (9 02:27 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Feb 2017 23:27:37 +0000 (8 15:27 -0800)
tree2f0281f8bdd55010801eae8904b043a6004074e1
parentd32d25c5c26c8d1e254bc0fcb8a8ae059e95cebc
Add `wait_freeing` helper function to ZTS

Sometimes the ZTS checks freed space just after `zfs destroy snapshot` and
gets an unexpected value because of space being freed asynchronously.
For cases like this add a `wait_freeing` function which blocks until the
pools `freeing` property drops to zero.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Melikov <mail@gmelikov.ru>
Closes #5740
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
tests/zfs-tests/tests/functional/snapshot/snapshot_008_pos.ksh