]> granicus.if.org Git - zfs/commit
Clean up do_vol_test in zfs_copies tests
authorRyan Moeller <ryan@freqlabs.com>
Mon, 9 Sep 2019 23:04:05 +0000 (19:04 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 9 Sep 2019 23:04:05 +0000 (16:04 -0700)
commit43f4495bde1f862a7f234919fb6c627abfdbd040
treeb543c9d7e6839015967869e5e6808fcd14abcd44
parent4bbf0477a7f8936627c37ab89c704e763aa63b37
Clean up do_vol_test in zfs_copies tests

Get rid of the `get_used_prop` function. `get_prop used` works fine.

Fix the comment describing the function parameters. The type does not
have a default, and mntp is also used for ext2.

Rename the variable for the number of copies from `copy` to `copies`.

Use a `case` statement to match the type parameter, order the cases
alphabetically, and add a little sanity checking for good measure.

Use eval to make sure the output of commands is silenced rather than
the log messages when redirecting output to /dev/null.

Simplify cases where zfs requires special behavior.

Don't allow the test to loop forever in the event space usage does not
change. Bail out of the loop and fail after an arbitrary number of
iterations.

Add more information to the log message when the test fails, to help
debugging.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9286
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib