Enable some of the ZFS test suite's hotplug tests.
The hotplug subdirectory has never previously been ported to FreeBSD,
because its tests relied on the Solaris-specific lofiadm(8) command. I
ported three of them, taking advantage of gnop(8) to simulate device
departure and arrival. I left the other 8 disabled because they're
redundant, Solaris-specific, or useless.
tests/sys/cddl/zfs/include/Makefile
tests/sys/cddl/zfs/include/libgnop.kshlib
Add a library for manipulating gnop devices. In the future, I
intend to adapt the zfsd tests to use this library rather than
libsas.kshlib.
tests/sys/cddl/zfs/tests/hotplug/cleanup.ksh
tests/sys/cddl/zfs/tests/hotplug/hotplug.cfg
tests/sys/cddl/zfs/tests/hotplug/hotplug.kshlib
tests/sys/cddl/zfs/tests/hotplug/hotplug_001_pos.ksh
tests/sys/cddl/zfs/tests/hotplug/hotplug_008_pos.ksh
tests/sys/cddl/zfs/tests/hotplug/hotplug_011_pos.ksh
tests/sys/cddl/zfs/tests/hotplug/setup.ksh
Port all this stuff to FreeBSD:
- Remove all references to FMA
- Instead of lofiadm(8) (roughly equivalent to vnode-backed md(4)
devices), use gnop(8) on top of real disks.
- Remove references to zones
- Don't bother doing background I/O. It's completely superfluous
to the purpose of these tests.
- Use ATF cleanup routines instead of the log_onexitmethod.
- Remove superfluous references to the autoreplace property.
tests/sys/cddl/zfs/tests/hotplug/hotplug_011_pos.ksh
Instead of unloading the ZFS module to simulate a reboot, simply
export the pool. It's the same thing from ZFS's perspective.
tests/sys/cddl/zfs/tests/hotplug/hotplug_test.sh
Enable the three aforementioned tests. Add comments to the others
indicating why I'm skipping them. Reduce extra-long timeouts to the
default 5 minutes.
Sponsored by: Spectra Logic Corp