Fix ZFS test suite bugs introduced by change 292346
These bugs were all ksh93 syntax bugs. Oddly, ksh93 will exit 0 when it
encounters a syntax error, so these bugs weren't noticed at the time. Kyua
thought that the tests were passing. Also, Improve a few tests while I'm at
it.
tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_degrade_001_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_degrade_002_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_003_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_004_pos.ksh
Fix ksh93 syntax errors and typos. Also, fix some comments.
tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib
tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_004_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_import_001_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_001_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_003_pos.ksh
Turn wait_for_disk_to_reappear's global variables into arguments
tests/sys/cddl/zfs/tests/zfsd/zfsd_import_001_pos.ksh
Improve a debugging statement and a comment
tests/sys/cddl/zfs/tests/zfsd/zfsd_replace_003_pos.ksh
- wait_for_pool_removal only works for tests that disable a single
disk. Replace its use by wait_for_pool_dev_state_change
- Fix a ksh93 scoping issue. reconnect_disk declares EXPANDER and
PHY as local variables, shadowing globals of the same name, but then uses them as if they were still global.
- Get rid of the DEVNAME_MUST_DIFFER check. It never worked because
the variable was referenced by two different names. And it's not necessary because we always want to perform the check.
- Fix some variable definitions that don't match their references:
s/_disks/_disk/
- In reconnect_disk, call wait_for_pool_dev_state_change with the
correct devname.
- If the test should start with the DISKS array not in ascending
order, detect this and disable the disks in the correct order to produce the desired behavior.
tests/sys/cddl/zfs/tests/hotspare/hotspare.kshlib
When failing a test in wait_for_resilver, show the final zpool
status to assist debugging efforts.
tests/sys/cddl/zfs/include/libsas.kshlib
Style.
tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib
Remark zfsd_hotspare_007_pos and zfsd_degrade_002_pos as failing.
They were previously unmarked after change 292346 made them appear
to pass, but, but that was erroneous. They were still failing, but
were exiting 0 due to syntax errors so Kyua thought that they were
passing.
tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh
Increase the amount of io in corrupt_pool_vdev to ensure that there
are enough checksum errors for the device to become degraded. The
I/O was unintentionally decreased by change 292346.
Sponsored by: Spectra Logic Corp