Skip to content

Commit

Permalink
Add zimport.sh compatibility test script
Browse files Browse the repository at this point in the history
Verify that an assortment of known good reference pools can be imported
using different versions of the ZoL code.

By default references pools for the major ZFS implementation will be
checked against the most recent ZoL tags and the master development branch.
Alternate tags or branches may be verified with the '-s <src-tag> option.
Passing the keyword "installed" will instruct the script to test whatever
version is installed.

Preferentially a reference pool is used for all tests.  However, if one
does not exist and the pool-tag matches one of the src-tags then a new
reference pool will be created using binaries from that source build.
This is particularly useful when you need to test your changes before
opening a pull request.

New reference pools may be added by placing a bzip2 compressed tarball
of the pool in the scripts/zpool-example directory and then passing
the -p <pool-tag> option.  To increase the test coverage reference pools
should be collected for all the major ZFS implementations.  Having these
pools easily available is also helpful to the developers.

Care should be taken to run these tests with a kernel supported by all
the listed tags.  Otherwise build failure will cause false positives.

EXAMPLES:

The following example will verify the zfs-0.6.2 tag, the master branch,
and the installed zfs version can correctly import the listed pools.
Note there is no reference pool available for master and installed but
because binaries are available one is automatically constructed.  The
working directory is also preserved between runs (-k) preventing the
need to rebuild from source for multiple runs.

 zimport.sh -k -f /var/tmp/zimport \
     -s "zfs-0.6.2 master installed" \
     -p "zevo-1.1.1 zol-0.6.2 zol-0.6.2-173 master installed"

--------------------- ZFS on Linux Source Versions --------------
                zfs-0.6.2       master          0.6.2-175_g36eb554
-----------------------------------------------------------------
Clone SPL       Local         Local           Skip
Clone ZFS       Local         Local           Skip
Build SPL       Pass          Pass            Skip
Build ZFS       Pass          Pass            Skip
-----------------------------------------------------------------
zevo-1.1.1      Pass          Pass            Pass
zol-0.6.2       Pass          Pass            Pass
zol-0.6.2-173   Fail          Pass            Pass
master          Pass          Pass            Pass
installed       Pass          Pass            Pass

Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#2094
  • Loading branch information
behlendorf committed Feb 11, 2014
1 parent 68563fd commit 7fb89bd
Show file tree
Hide file tree
Showing 5 changed files with 479 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "scripts/zfs-images"]
path = scripts/zfs-images
url = https://github.com/zfsonlinux/zfs-images
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ AC_CONFIG_FILES([
scripts/zpios-profile/Makefile
scripts/zpios-test/Makefile
scripts/zpool-config/Makefile
scripts/zpool-example/Makefile
scripts/common.sh
rpm/Makefile
rpm/fedora/Makefile
Expand Down
2 changes: 2 additions & 0 deletions scripts/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dist_pkgdata_SCRIPTS = \
$(top_builddir)/scripts/common.sh \
$(top_srcdir)/scripts/zconfig.sh \
$(top_srcdir)/scripts/zfault.sh \
$(top_srcdir)/scripts/zimport.sh \
$(top_srcdir)/scripts/zfs.sh \
$(top_srcdir)/scripts/zpool-create.sh \
$(top_srcdir)/scripts/zpios.sh \
Expand All @@ -17,6 +18,7 @@ dist_pkgdata_SCRIPTS = \
ZFS=$(top_builddir)/scripts/zfs.sh
ZCONFIG=$(top_builddir)/scripts/zconfig.sh
ZFAULT=$(top_builddir)/scripts/zfault.sh
ZIMPORT=$(top_builddir)/scripts/zimport.sh
ZTEST=$(top_builddir)/cmd/ztest/ztest
ZPIOS_SANITY=$(top_builddir)/scripts/zpios-sanity.sh

Expand Down
1 change: 1 addition & 0 deletions scripts/zfs-images
Submodule zfs-images added at 00b7c2
Loading

0 comments on commit 7fb89bd

Please sign in to comment.