ZTS: Simplify zpool_initialize_verify_initialized
commit2844ad60d41717f4713ed01df2d46bc12f590ddd
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 18 Dec 2020 16:42:59 +0000 (18 08:42 -0800)
committerGitHub <noreply@github.com>
Fri, 18 Dec 2020 16:42:59 +0000 (18 08:42 -0800)
tree4fff2ab0afa58d0e904d654be5849d3481ef311a
parent71e4ce0e52c9205b9f4a8dceaa06a54089b0f70c
ZTS: Simplify zpool_initialize_verify_initialized

Consider the test to be a success as long as the initializing pattern
is found at least once per metaslab.  This indicates that at least
part of the free space was initialized.  Ideally we'd check that the
pattern was written to all free space but that's much trickier so this
check is a reasonable compromise.

Using a here-string to feed the loop in this test causes an empty
string to still trigger the loop so we miss the `spacemaps=0` case.
Pipe into the loop instead.

While here, we can use `zpool wait -t initialize $TESTPOOL` to wait for
the pool to initialize.

Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11365
tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized.ksh