aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade')
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/Makefile.am19
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/Makefile.am54
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror1.dat.bz2bin0 -> 8871 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror2.dat.bz2bin0 -> 29281 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1.dat.bz2bin0 -> 31464 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v10.dat.bz2bin0 -> 31549 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v11.dat.bz2bin0 -> 29695 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v12.dat.bz2bin0 -> 29786 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v13.dat.bz2bin0 -> 30554 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v14.dat.bz2bin0 -> 30605 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v15.dat.bz2bin0 -> 33172 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror1.dat.bz2bin0 -> 32989 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror2.dat.bz2bin0 -> 32965 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror3.dat.bz2bin0 -> 32956 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz1.dat.bz2bin0 -> 28792 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz2.dat.bz2bin0 -> 28480 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz3.dat.bz2bin0 -> 28779 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe1.dat.bz2bin0 -> 20361 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe2.dat.bz2bin0 -> 20251 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe3.dat.bz2bin0 -> 32498 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2.dat.bz2bin0 -> 32492 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror1.dat.bz2bin0 -> 44185 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror2.dat.bz2bin0 -> 44155 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror3.dat.bz2bin0 -> 44170 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz1.dat.bz2bin0 -> 45894 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz2.dat.bz2bin0 -> 49452 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz3.dat.bz2bin0 -> 44503 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe1.dat.bz2bin0 -> 35305 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe2.dat.bz2bin0 -> 28513 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe3.dat.bz2bin0 -> 35344 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3.dat.bz2bin0 -> 27124 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare1.dat.bz2bin0 -> 42097 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare2.dat.bz2bin0 -> 35584 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare3.dat.bz2bin0 -> 19501 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror1.dat.bz2bin0 -> 28160 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror2.dat.bz2bin0 -> 28149 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror3.dat.bz2bin0 -> 28166 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz1.dat.bz2bin0 -> 29077 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz2.dat.bz2bin0 -> 29340 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz21.dat.bz2bin0 -> 28067 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz22.dat.bz2bin0 -> 27999 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz23.dat.bz2bin0 -> 28046 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz3.dat.bz2bin0 -> 29120 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe1.dat.bz2bin0 -> 26174 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe2.dat.bz2bin0 -> 24408 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe3.dat.bz2bin0 -> 26213 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v4.dat.bz2bin0 -> 39824 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v5.dat.bz2bin0 -> 44358 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v6.dat.bz2bin0 -> 42006 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v7.dat.bz2bin0 -> 38100 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v8.dat.bz2bin0 -> 38287 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v9.dat.bz2bin0 -> 33474 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v999.dat.bz2bin0 -> 31807 bytes
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-vBROKEN.dat.bz2bin0 -> 26328 bytes
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh39
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh38
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg161
-rw-r--r--sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib140
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh78
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh59
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh59
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh83
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh54
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh57
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh70
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh80
-rwxr-xr-xsys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh66
67 files changed, 1057 insertions, 0 deletions
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/Makefile.am
new file mode 100644
index 000000000000..18311ed2ca25
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/Makefile.am
@@ -0,0 +1,19 @@
+SUBDIRS = blockfiles
+
+pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_upgrade
+dist_pkgdata_SCRIPTS = \
+ setup.ksh \
+ cleanup.ksh \
+ zpool_upgrade_001_pos.ksh \
+ zpool_upgrade_002_pos.ksh \
+ zpool_upgrade_003_pos.ksh \
+ zpool_upgrade_004_pos.ksh \
+ zpool_upgrade_005_neg.ksh \
+ zpool_upgrade_006_neg.ksh \
+ zpool_upgrade_007_pos.ksh \
+ zpool_upgrade_008_pos.ksh \
+ zpool_upgrade_009_neg.ksh
+
+dist_pkgdata_DATA = \
+ zpool_upgrade.cfg \
+ zpool_upgrade.kshlib
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/Makefile.am b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/Makefile.am
new file mode 100644
index 000000000000..ce8da278e9f0
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/Makefile.am
@@ -0,0 +1,54 @@
+pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles
+dist_pkgdata_DATA = \
+ zfs-broken-mirror1.dat.bz2 \
+ zfs-broken-mirror2.dat.bz2 \
+ zfs-pool-v1.dat.bz2 \
+ zfs-pool-v10.dat.bz2 \
+ zfs-pool-v11.dat.bz2 \
+ zfs-pool-v12.dat.bz2 \
+ zfs-pool-v13.dat.bz2 \
+ zfs-pool-v14.dat.bz2 \
+ zfs-pool-v15.dat.bz2 \
+ zfs-pool-v1mirror1.dat.bz2 \
+ zfs-pool-v1mirror2.dat.bz2 \
+ zfs-pool-v1mirror3.dat.bz2 \
+ zfs-pool-v1raidz1.dat.bz2 \
+ zfs-pool-v1raidz2.dat.bz2 \
+ zfs-pool-v1raidz3.dat.bz2 \
+ zfs-pool-v1stripe1.dat.bz2 \
+ zfs-pool-v1stripe2.dat.bz2 \
+ zfs-pool-v1stripe3.dat.bz2 \
+ zfs-pool-v2.dat.bz2 \
+ zfs-pool-v2mirror1.dat.bz2 \
+ zfs-pool-v2mirror2.dat.bz2 \
+ zfs-pool-v2mirror3.dat.bz2 \
+ zfs-pool-v2raidz1.dat.bz2 \
+ zfs-pool-v2raidz2.dat.bz2 \
+ zfs-pool-v2raidz3.dat.bz2 \
+ zfs-pool-v2stripe1.dat.bz2 \
+ zfs-pool-v2stripe2.dat.bz2 \
+ zfs-pool-v2stripe3.dat.bz2 \
+ zfs-pool-v3.dat.bz2 \
+ zfs-pool-v3hotspare1.dat.bz2 \
+ zfs-pool-v3hotspare2.dat.bz2 \
+ zfs-pool-v3hotspare3.dat.bz2 \
+ zfs-pool-v3mirror1.dat.bz2 \
+ zfs-pool-v3mirror2.dat.bz2 \
+ zfs-pool-v3mirror3.dat.bz2 \
+ zfs-pool-v3raidz1.dat.bz2 \
+ zfs-pool-v3raidz2.dat.bz2 \
+ zfs-pool-v3raidz21.dat.bz2 \
+ zfs-pool-v3raidz22.dat.bz2 \
+ zfs-pool-v3raidz23.dat.bz2 \
+ zfs-pool-v3raidz3.dat.bz2 \
+ zfs-pool-v3stripe1.dat.bz2 \
+ zfs-pool-v3stripe2.dat.bz2 \
+ zfs-pool-v3stripe3.dat.bz2 \
+ zfs-pool-v4.dat.bz2 \
+ zfs-pool-v5.dat.bz2 \
+ zfs-pool-v6.dat.bz2 \
+ zfs-pool-v7.dat.bz2 \
+ zfs-pool-v8.dat.bz2 \
+ zfs-pool-v9.dat.bz2 \
+ zfs-pool-v999.dat.bz2 \
+ zfs-pool-vBROKEN.dat.bz2
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror1.dat.bz2
new file mode 100644
index 000000000000..7ec82b755b4c
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror2.dat.bz2
new file mode 100644
index 000000000000..00ef2bc36ff3
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-broken-mirror2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1.dat.bz2
new file mode 100644
index 000000000000..9c8a157eebd6
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v10.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v10.dat.bz2
new file mode 100644
index 000000000000..5caf41c42009
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v10.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v11.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v11.dat.bz2
new file mode 100644
index 000000000000..4af228e73f11
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v11.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v12.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v12.dat.bz2
new file mode 100644
index 000000000000..a116e9db6b52
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v12.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v13.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v13.dat.bz2
new file mode 100644
index 000000000000..3fab2262b7df
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v13.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v14.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v14.dat.bz2
new file mode 100644
index 000000000000..e8443c375c51
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v14.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v15.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v15.dat.bz2
new file mode 100644
index 000000000000..0887ae814a12
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v15.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror1.dat.bz2
new file mode 100644
index 000000000000..ed42283eb1db
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror2.dat.bz2
new file mode 100644
index 000000000000..4e72f1acfba6
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror3.dat.bz2
new file mode 100644
index 000000000000..006c96df7073
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1mirror3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz1.dat.bz2
new file mode 100644
index 000000000000..3c3531c70fc0
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz2.dat.bz2
new file mode 100644
index 000000000000..99a0768b01ec
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz3.dat.bz2
new file mode 100644
index 000000000000..0fd057ecbaa9
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1raidz3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe1.dat.bz2
new file mode 100644
index 000000000000..41f63f668d2f
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe2.dat.bz2
new file mode 100644
index 000000000000..cc9eab160bed
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe3.dat.bz2
new file mode 100644
index 000000000000..866bd96c93e1
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1stripe3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2.dat.bz2
new file mode 100644
index 000000000000..184e3c3788aa
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror1.dat.bz2
new file mode 100644
index 000000000000..7466e7e25feb
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror2.dat.bz2
new file mode 100644
index 000000000000..de66b539b8e4
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror3.dat.bz2
new file mode 100644
index 000000000000..4c3504b84925
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2mirror3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz1.dat.bz2
new file mode 100644
index 000000000000..e008ae099c4e
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz2.dat.bz2
new file mode 100644
index 000000000000..bf7f6b119976
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz3.dat.bz2
new file mode 100644
index 000000000000..f7b7012690c5
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2raidz3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe1.dat.bz2
new file mode 100644
index 000000000000..16a7bb89d58e
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe2.dat.bz2
new file mode 100644
index 000000000000..8f7287ee7639
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe3.dat.bz2
new file mode 100644
index 000000000000..9fccd05c506f
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v2stripe3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3.dat.bz2
new file mode 100644
index 000000000000..fc122d8b8f32
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare1.dat.bz2
new file mode 100644
index 000000000000..d5c7e3c8b776
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare2.dat.bz2
new file mode 100644
index 000000000000..47b4d6a2e98b
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare3.dat.bz2
new file mode 100644
index 000000000000..cb253c308a18
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3hotspare3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror1.dat.bz2
new file mode 100644
index 000000000000..e8ab50c45b65
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror2.dat.bz2
new file mode 100644
index 000000000000..769e0f81abd6
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror3.dat.bz2
new file mode 100644
index 000000000000..e7e5a8958755
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3mirror3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz1.dat.bz2
new file mode 100644
index 000000000000..6d43f74ba3c8
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz2.dat.bz2
new file mode 100644
index 000000000000..6ab1059d0b91
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz21.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz21.dat.bz2
new file mode 100644
index 000000000000..dcc537f15d4e
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz21.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz22.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz22.dat.bz2
new file mode 100644
index 000000000000..3cd92b173041
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz22.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz23.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz23.dat.bz2
new file mode 100644
index 000000000000..e3c5f41f9a03
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz23.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz3.dat.bz2
new file mode 100644
index 000000000000..2109fda7196a
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3raidz3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe1.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe1.dat.bz2
new file mode 100644
index 000000000000..4e6afe22b5c5
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe1.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe2.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe2.dat.bz2
new file mode 100644
index 000000000000..6e755dd83b75
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe2.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe3.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe3.dat.bz2
new file mode 100644
index 000000000000..9cf396a3c558
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v3stripe3.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v4.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v4.dat.bz2
new file mode 100644
index 000000000000..b1c00e16892a
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v4.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v5.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v5.dat.bz2
new file mode 100644
index 000000000000..9c6cb0c73648
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v5.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v6.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v6.dat.bz2
new file mode 100644
index 000000000000..1eb1fea9d442
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v6.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v7.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v7.dat.bz2
new file mode 100644
index 000000000000..04c6cac75c9a
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v7.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v8.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v8.dat.bz2
new file mode 100644
index 000000000000..8f1e66303b5d
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v8.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v9.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v9.dat.bz2
new file mode 100644
index 000000000000..94528d373b7b
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v9.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v999.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v999.dat.bz2
new file mode 100644
index 000000000000..7ca57a24977a
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v999.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-vBROKEN.dat.bz2 b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-vBROKEN.dat.bz2
new file mode 100644
index 000000000000..6595f4a5d28a
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-vBROKEN.dat.bz2
Binary files differ
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh
new file mode 100755
index 000000000000..1fab5305adc0
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/cleanup.ksh
@@ -0,0 +1,39 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+for config in $CONFIGS; do
+ destroy_upgraded_pool $config
+done
+
+default_cleanup
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh
new file mode 100755
index 000000000000..860ba0f061a6
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/setup.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+verify_runnable "global"
+verify_disk_count "$DISKS" 2
+
+# give us a pool to play in
+default_setup "$DISKS"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg
new file mode 100644
index 000000000000..993fafc0324d
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg
@@ -0,0 +1,161 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+# The following variable names describe files, stored as gzip compressed files
+# in the test directory which can be used to construct a pool of a given
+# version. The variable names are important, in that the construction
+# ZPOOL_VERSION_$var_FILES describes the files the pool is made from, and
+# ZPOOL_VERSION_$var_NAME describes the pool name.
+
+# v1 pools
+ZPOOL_VERSION_1_FILES="zfs-pool-v1.dat"
+ZPOOL_VERSION_1_NAME="v1-pool"
+# v1 stripe
+ZPOOL_VERSION_1stripe_FILES="zfs-pool-v1stripe1.dat \
+zfs-pool-v1stripe2.dat zfs-pool-v1stripe3.dat"
+ZPOOL_VERSION_1stripe_NAME="pool-v1stripe"
+# v1 raidz
+ZPOOL_VERSION_1raidz_FILES="zfs-pool-v1raidz1.dat zfs-pool-v1raidz2.dat \
+zfs-pool-v1raidz3.dat"
+ZPOOL_VERSION_1raidz_NAME="pool-v1raidz"
+# v1 mirror
+ZPOOL_VERSION_1mirror_FILES="zfs-pool-v1mirror1.dat zfs-pool-v1mirror2.dat \
+zfs-pool-v1mirror3.dat"
+ZPOOL_VERSION_1mirror_NAME="pool-v1mirror"
+
+# v2 pools
+ZPOOL_VERSION_2_FILES="zfs-pool-v2.dat"
+ZPOOL_VERSION_2_NAME="v2-pool"
+# v2 stripe
+ZPOOL_VERSION_2stripe_FILES="zfs-pool-v2stripe1.dat zfs-pool-v2stripe2.dat \
+zfs-pool-v2stripe3.dat"
+ZPOOL_VERSION_2stripe_NAME="pool-v2stripe"
+# v2 raidz
+ZPOOL_VERSION_2raidz_FILES="zfs-pool-v2raidz1.dat zfs-pool-v2raidz2.dat \
+zfs-pool-v2raidz3.dat"
+ZPOOL_VERSION_2raidz_NAME="pool-v2raidz"
+# v2 mirror
+ZPOOL_VERSION_2mirror_FILES="zfs-pool-v2mirror1.dat zfs-pool-v2mirror2.dat \
+zfs-pool-v2mirror3.dat"
+ZPOOL_VERSION_2mirror_NAME="pool-v2mirror"
+
+# v3 pools
+ZPOOL_VERSION_3_FILES="zfs-pool-v3.dat"
+ZPOOL_VERSION_3_NAME="v3-pool"
+# v3 stripe
+ZPOOL_VERSION_3stripe_FILES="zfs-pool-v3stripe1.dat zfs-pool-v3stripe2.dat \
+zfs-pool-v3stripe3.dat"
+ZPOOL_VERSION_3stripe_NAME="pool-v3stripe"
+# v3 raidz
+ZPOOL_VERSION_3raidz_FILES="zfs-pool-v3raidz1.dat zfs-pool-v3raidz2.dat \
+zfs-pool-v3raidz3.dat"
+ZPOOL_VERSION_3raidz_NAME="pool-v3raidz"
+# v3 mirror
+ZPOOL_VERSION_3mirror_FILES="zfs-pool-v3mirror1.dat zfs-pool-v3mirror2.dat \
+zfs-pool-v3mirror3.dat"
+ZPOOL_VERSION_3mirror_NAME="pool-v3mirror"
+# v3 raidz2
+ZPOOL_VERSION_3dblraidz_FILES="zfs-pool-v3raidz21.dat zfs-pool-v3raidz22.dat \
+zfs-pool-v3raidz23.dat"
+ZPOOL_VERSION_3dblraidz_NAME="pool-v3raidz2"
+# v3 hotspares
+ZPOOL_VERSION_3hotspare_FILES="zfs-pool-v3hotspare1.dat \
+zfs-pool-v3hotspare2.dat zfs-pool-v3hotspare3.dat"
+ZPOOL_VERSION_3hotspare_NAME="pool-v3hotspare"
+
+# v4 pool
+ZPOOL_VERSION_4_FILES="zfs-pool-v4.dat"
+ZPOOL_VERSION_4_NAME="v4-pool"
+
+# v5 pool
+ZPOOL_VERSION_5_FILES="zfs-pool-v5.dat"
+ZPOOL_VERSION_5_NAME="v5-pool"
+
+# v6 pool
+ZPOOL_VERSION_6_FILES="zfs-pool-v6.dat"
+ZPOOL_VERSION_6_NAME="v6-pool"
+
+# v7 pool
+ZPOOL_VERSION_7_FILES="zfs-pool-v7.dat"
+ZPOOL_VERSION_7_NAME="v7-pool"
+
+# v8 pool
+ZPOOL_VERSION_8_FILES="zfs-pool-v8.dat"
+ZPOOL_VERSION_8_NAME="v8-pool"
+
+# v9 pool
+ZPOOL_VERSION_9_FILES="zfs-pool-v9.dat"
+ZPOOL_VERSION_9_NAME="v9-pool"
+
+# v10 pool
+ZPOOL_VERSION_10_FILES="zfs-pool-v10.dat"
+ZPOOL_VERSION_10_NAME="v10-pool"
+
+# v11 pool
+ZPOOL_VERSION_11_FILES="zfs-pool-v11.dat"
+ZPOOL_VERSION_11_NAME="v11-pool"
+
+# v12 pool
+ZPOOL_VERSION_12_FILES="zfs-pool-v12.dat"
+ZPOOL_VERSION_12_NAME="v12-pool"
+
+# v13 pool
+ZPOOL_VERSION_13_FILES="zfs-pool-v13.dat"
+ZPOOL_VERSION_13_NAME="v13-pool"
+
+# v14 pool
+ZPOOL_VERSION_14_FILES="zfs-pool-v14.dat"
+ZPOOL_VERSION_14_NAME="v14-pool"
+
+# v15 pool
+ZPOOL_VERSION_15_FILES="zfs-pool-v15.dat"
+ZPOOL_VERSION_15_NAME="v15-pool"
+
+# v2 pool, with device problems on one side of the mirror
+# so that the pool appears as DEGRADED
+ZPOOL_VERSION_2brokenmirror_FILES="zfs-broken-mirror1.dat \
+zfs-broken-mirror2.dat"
+ZPOOL_VERSION_2brokenmirror_NAME="zfs-broken-mirror"
+
+# v999 pool (an unknown version) which can be used to check whether upgrade,
+# import or other tests that should fail against unknown pool version.
+# It should not be listed in the CONFIGS variable below, as these are pool
+# versions that can be imported and upgraded.
+ZPOOL_VERSION_9999_FILES="zfs-pool-v999.dat"
+ZPOOL_VERSION_9999_NAME="v999-pool"
+
+# This is a list of pool configurations we should be able to upgrade from,
+# each entry should have corresponding ZPOOL_VERSION_*_FILES and
+# ZPOOL_VERSION_*_NAME variables defined above.
+CONFIGS="1 1stripe 1raidz 1mirror \
+2 2stripe 2raidz 2mirror 2brokenmirror \
+3 3stripe 3raidz 3mirror 3dblraidz 3hotspare \
+4 5 6 7 8 9 10 11 12 13 14 15"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
new file mode 100644
index 000000000000..783ae54e717b
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
@@ -0,0 +1,140 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2017 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.cfg
+
+# This part of the test suite relies on variables being setup in the
+# zpool_upgrade.cfg script. Those variables give us details about which
+# files make up the pool, and what the pool name is.
+
+
+# A function to import a pool from files we have stored in the test suite
+# We import the pool, and create some random data in the pool.
+# $1 a version number we can use to get information about the pool
+function create_old_pool
+{
+ typeset vers=$1
+ typeset -n pool_files=ZPOOL_VERSION_${vers}_FILES
+ typeset -n pool_name=ZPOOL_VERSION_${vers}_NAME
+
+ log_note "Creating $pool_name from $pool_files"
+ for pool_file in $pool_files; do
+ log_must bzcat \
+ $STF_SUITE/tests/functional/cli_root/zpool_upgrade/blockfiles/$pool_file.bz2 \
+ >$TEST_BASE_DIR/$pool_file
+ done
+ log_must zpool import -d $TEST_BASE_DIR $pool_name
+
+ # Put some random contents into the pool
+ for i in {1..1024} ; do
+ dd if=/dev/urandom of=/$pool_name/random.$i \
+ count=1 bs=1024 > /dev/null 2>&1
+ done
+}
+
+
+# A function to check the contents of a pool, upgrade it to the current version
+# and then verify that the data is consistent after upgrading. Note that we're
+# not using "zpool status -x" to see if the pool is healthy, as it's possible
+# to also upgrade faulted, or degraded pools.
+# $1 a version number we can use to get information about the pool
+function check_upgrade
+{
+ typeset vers=$1
+ typeset -n pool_files=ZPOOL_VERSION_${vers}_FILES
+ typeset -n pool_name=ZPOOL_VERSION_${vers}_NAME
+ typeset pre_upgrade_checksum
+ typeset post_upgrade_checksum
+
+ log_note "Checking if we can upgrade from ZFS version $vers"
+ pre_upgrade_checksum=$(check_pool $pool_name pre)
+ log_must zpool upgrade $pool_name
+ post_upgrade_checksum=$(check_pool $pool_name post)
+
+ log_note "Checking that there are no differences between checksum output"
+ log_must diff $pre_upgrade_checksum $post_upgrade_checksum
+ rm $pre_upgrade_checksum $post_upgrade_checksum
+}
+
+# A function to destroy an upgraded pool, plus the files it was based on.
+# $1 a version number we can use to get information about the pool
+function destroy_upgraded_pool
+{
+ typeset vers=$1
+ typeset -n pool_files=ZPOOL_VERSION_${vers}_FILES
+ typeset -n pool_name=ZPOOL_VERSION_${vers}_NAME
+
+ destroy_pool $pool_name
+
+ for file in $pool_files; do
+ rm -f $TEST_BASE_DIR/$file
+ done
+}
+
+# This function does a basic sanity check on the pool by computing the
+# checksums of all files in the pool, echoing the name of the file containing
+# the checksum results.
+# $1 the name of the pool
+# $2 a flag we can use to determine when this check is being performed
+# (ie. pre or post pool-upgrade)
+function check_pool
+{
+ typeset pool=$1
+ typeset flag=$2
+ find /$pool -type f -exec cksum {} + > \
+ $TEST_BASE_DIR/pool-checksums.$pool.$flag
+ echo $TEST_BASE_DIR/pool-checksums.$pool.$flag
+}
+
+# This function simply checks that a pool has a particular version number
+# as reported by zdb and zpool upgrade -v
+# $1 the name of the pool
+# $2 the version of the pool we expect to see
+function check_poolversion
+{
+ typeset pool=$1
+ typeset vers=$2
+ typeset actual
+
+ # check version using zdb
+ actual=$(zdb -C $pool | sed -n 's/^.*version: \(.*\)$/\1/p')
+ if [[ $actual != $vers ]] ; then
+ log_fail "$pool: zdb reported version $actual, expected $vers"
+ fi
+
+ # check version using zpool upgrade
+ actual=$(zpool upgrade | grep $pool$ | \
+ awk '{print $1}' | sed -e 's/ //g')
+ if [[ $actual != $vers ]] ; then
+ log_fail "$pool: zpool reported version $actual, expected $vers"
+ fi
+}
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh
new file mode 100755
index 000000000000..b49c19c5551c
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_001_pos.ksh
@@ -0,0 +1,78 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# Executing 'zpool upgrade -v' command succeeds, prints a description of legacy
+# versions, and mentions feature flags.
+#
+# STRATEGY:
+# 1. Execute the command
+# 2. Verify a 0 exit status
+# 3. Grep for version descriptions and 'feature flags'
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ rm -f $versions
+}
+
+log_assert "Executing 'zpool upgrade -v' command succeeds"
+log_onexit cleanup
+
+typeset versions=$TEST_BASE_DIR/zpool-versions.$$
+
+log_must zpool upgrade -v
+
+# We also check that the usage message contains a description of legacy
+# versions and a note about feature flags.
+
+log_must eval "zpool upgrade -v | head -1 | grep 'feature flags'"
+
+zpool upgrade -v > $versions
+
+#
+# Current output for 'zpool upgrade -v' has different indent space
+# for single and double digit version number. For example,
+# 9 refquota and refreservation properties
+# 10 Cache devices
+#
+for version in {1..28}; do
+ log_note "Checking for a description of pool version $version"
+ log_must eval "awk '/^ $version / { print $1 }' $versions | grep $version"
+done
+
+log_pass "Executing 'zpool upgrade -v' command succeeds"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh
new file mode 100755
index 000000000000..16ab14907055
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_002_pos.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# import pools of all versions - zpool upgrade on each pools works
+#
+# STRATEGY:
+# 1. Execute the command with several invalid options
+# 2. Verify a 0 exit status for each
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_upgraded_pool $config
+}
+
+log_assert "Import pools of all versions - zpool upgrade on each pool works"
+log_onexit cleanup
+
+for config in $CONFIGS; do
+ create_old_pool $config
+ check_upgrade $config
+ destroy_upgraded_pool $config
+done
+
+log_pass "Import pools of all versions - zpool upgrade on each pool works"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh
new file mode 100755
index 000000000000..0ac3470dedfe
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_003_pos.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# Upgrading a pool that has already been upgraded succeeds.
+#
+# STRATEGY:
+# 1. Upgrade a pool, then try to upgrade it again
+# 2. Verify a 0 exit status
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_upgraded_pool 1
+}
+
+log_assert "Upgrading a pool that has already been upgraded succeeds"
+log_onexit cleanup
+
+# Create a version 1 pool
+create_old_pool 1
+check_upgrade 1
+check_upgrade 1
+destroy_upgraded_pool 1
+
+log_pass "Upgrading a pool that has already been upgraded succeeds"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
new file mode 100755
index 000000000000..0e278c81ccb4
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
@@ -0,0 +1,83 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# zpool upgrade -a works
+#
+# STRATEGY:
+# 1. Create all upgradable pools for this system, then upgrade -a
+# 2. Verify a 0 exit status
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ for config in $CONFIGS; do
+ destroy_upgraded_pool $config
+ done
+}
+
+log_assert "zpool upgrade -a works"
+log_onexit cleanup
+
+TEST_POOLS=
+# Now build all of our pools
+for config in $CONFIGS; do
+ typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
+
+ TEST_POOLS="$TEST_POOLS $pool_name"
+ create_old_pool $config
+ check_pool $pool_name pre > /dev/null
+done
+
+# upgrade them all at once
+export __ZFS_POOL_RESTRICT="$TEST_POOLS"
+log_must zpool upgrade -a
+unset __ZFS_POOL_RESTRICT
+
+# verify their contents then destroy them
+for config in $CONFIGS ; do
+ typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
+
+ check_pool $pool_name post > /dev/null
+ log_must diff $TEST_BASE_DIR/pool-checksums.$pool_name.pre \
+ $TEST_BASE_DIR/pool-checksums.$pool_name.post
+ rm $TEST_BASE_DIR/pool-checksums.$pool_name.pre \
+ $TEST_BASE_DIR/pool-checksums.$pool_name.post
+ destroy_upgraded_pool $config
+done
+
+log_pass "zpool upgrade -a works"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh
new file mode 100755
index 000000000000..b294af06cf46
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_005_neg.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# Variations of upgrade -v print usage message, return with non-zero status
+#
+# STRATEGY:
+# 1. Execute the command with several invalid options
+# 2. Verify a 0 exit status for each
+#
+
+verify_runnable "global"
+
+log_assert "Variations of upgrade -v print usage message," \
+ "return with non-zero status"
+
+for arg in "/tmp" "-?" "-va" "-v fakepool" "-a fakepool" ; do
+ log_mustnot zpool upgrade $arg
+done
+
+log_pass "Variations of upgrade -v print usage message," \
+ "return with non-zero status"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh
new file mode 100755
index 000000000000..4c16f81082ca
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_006_neg.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# Attempting to upgrade a non-existent pool will return an error
+#
+# STRATEGY:
+# 1. Compose non-existent pool name, try to upgrade it
+# 2. Verify non-zero exit status
+#
+
+log_assert "Attempting to upgrade a non-existent pool will return an error"
+
+NO_POOL=notapool
+
+while true ; do
+ if poolexists $NO_POOL ; then
+ NO_POOL="${NO_POOL}x"
+ else
+ log_mustnot zpool upgrade $NO_POOL
+ break
+ fi
+done
+
+log_pass "Attempting to upgrade a non-existent pool will return an error"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh
new file mode 100755
index 000000000000..696c8c66cc1c
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_007_pos.ksh
@@ -0,0 +1,70 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+. $STF_SUITE/tests/functional/cli_root/zfs_upgrade/zfs_upgrade.kshlib
+
+#
+# DESCRIPTION:
+# import pools of all versions - verify the following operation not break.
+# * zfs create -o version=<vers> <filesystem>
+# * zfs upgrade [-V vers] <filesystem>
+# * zfs set version=<vers> <filesystem>
+#
+# STRATEGY:
+# 1. Import pools of all versions
+# 2. Setup a test environment over the old pools.
+# 3. Verify the commands related to 'zfs upgrade' succeed as expected.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_upgraded_pool $config
+}
+
+POOL_CONFIGS="1raidz 1mirror 2raidz 2mirror 3raidz 3mirror"
+
+log_assert "Import pools of all versions - 'zfs upgrade' on each pool works"
+log_onexit cleanup
+
+# $CONFIGS gets set in the .cfg script
+for config in $POOL_CONFIGS; do
+ typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
+
+ create_old_pool $config
+ default_check_zfs_upgrade $pool_name
+ destroy_upgraded_pool $config
+done
+
+log_pass "Import pools of all versions - 'zfs upgrade' on each pool works"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh
new file mode 100755
index 000000000000..d930919652bf
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_008_pos.ksh
@@ -0,0 +1,80 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+#
+# zpool upgrade should be able to upgrade pools to a given version using -V
+#
+# STRATEGY:
+# 1. For all versions pools that can be upgraded on a given OS version
+# (latest pool version - 1)
+# 2. Pick a version that's a random number, greater than the version
+# we're running.
+# 3. Attempt to upgrade that pool to the given version
+# 4. Check the pool was upgraded correctly.
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_upgraded_pool $ver_old
+}
+
+log_assert "zpool upgrade should be able to upgrade pools to a given version" \
+ "using -V"
+
+log_onexit cleanup
+
+# We're just using the single disk version of the pool, which should be
+# enough to determine if upgrade works correctly. Also set a MAX_VER
+# variable, which specifies the highest version that we should expect
+# a zpool upgrade operation to succeed from.
+VERSIONS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
+MAX_VER=15
+
+for ver_old in $VERSIONS; do
+ typeset -n pool_name=ZPOOL_VERSION_${ver_old}_NAME
+ typeset -i ver_new=$(random_int_between $ver_old $MAX_VER)
+
+ create_old_pool $ver_old
+ log_must zpool upgrade -V $ver_new $pool_name > /dev/null
+ check_poolversion $pool_name $ver_new
+ destroy_upgraded_pool $ver_old
+done
+
+log_pass "zpool upgrade should be able to upgrade pools to a given version" \
+ "using -V"
diff --git a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh
new file mode 100755
index 000000000000..22ffda2114a5
--- /dev/null
+++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_009_neg.ksh
@@ -0,0 +1,66 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+#
+
+. $STF_SUITE/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
+
+#
+# DESCRIPTION:
+#
+# zpool upgrade -V shouldn't be able to upgrade a pool to an unknown version
+#
+# STRATEGY:
+# 1. Take an existing pool
+# 2. Attempt to upgrade it to an unknown version
+# 3. Verify that the upgrade failed, and the pool version was still the original
+#
+
+verify_runnable "global"
+
+function cleanup
+{
+ destroy_upgraded_pool $config
+}
+
+log_assert "zpool upgrade -V shouldn't be able to upgrade a pool to" \
+ "unknown version"
+
+typeset -i config=2
+typeset -n pool_name=ZPOOL_VERSION_${config}_NAME
+
+create_old_pool $config
+log_mustnot zpool upgrade -V 999 $pool_name
+log_mustnot zpool upgrade -V 999
+check_poolversion $pool_name $config
+destroy_upgraded_pool $config
+
+log_pass "zpool upgrade -V shouldn't be able to upgrade a pool to" \
+ "unknown version"