Introducing the ZFS test suite

asomers at asomers at
Mon Aug 25 18:38:32 UTC 2014

I just merged the ZFS test suite to projects/zfsd/head in change 270604.

The ZFS test suite was originally written by Sun as part of the STF
(Solaris test framework).  They open sourced it in OpenSolaris, then
HighCloud partially ported it to FreeBSD, and Spectra Logic finished
the port.  We also added 37 testcases, fixed many broken ones, and
converted them all to the ATF framework. gibbs, will, ken, and myself
have all worked on it.  We've also taken a few contributions from
araujo and Steven Hartland.

The structure of the tests reflects their heritage as part of STF.
Each ATF test case has its own file, for example
tests/sys/cddl/zfs/tests/exec/exec_001_pos.ksh.  Each directory that
contains at least one test case has a separate atf-ksh93 test program,
for example tests/sys/cddl/zfs/tests/exec/  The test
programs are basically just wrappers around the test case files, but
they still need to source some kshlib files, which is why they must
use atf-ksh93 instead of atf-sh.  atf-ksh93 is a hack; it simply sets
the ATF_SHELL environment variable and execs atf-sh.  Technically,
this isn't guaranteed to work as the atf-sh shell functions aren't
guaranteed to work in ksh93.  In practice, however, they all do.  The
directories tests/sys/cddl/zfs/{include,bin} contain support files
used by many different tests.

The ZFS test suite still has some problems.  Some of these are
blocking it from being merged to head:
* The atf-ksh93 hack.  This is not a good thing to officially add to
ATF, but it would be a lot of work to convert the test programs to run
under sh.  Especially because of the use of ksh arrays.
* Many test cases reference Spectra Logic internal bug numbers.  We
need to create FreeBSD bugs for each of them that also affects
* It uses some ATF config variables that are not yet described in tests(7).

Remember, don't run these tests on a production system.  They WILL
cause panics and deadlocks, and they may cause data loss too.

Happy Hacking,

More information about the freebsd-testing mailing list