#
# 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

# 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.

# Version 1 pools
export ZPOOL_VERSION_1_FILES="zfs-pool-v1.dat"
export ZPOOL_VERSION_1_NAME="v1-pool"
# v1 stripe
export ZPOOL_VERSION_1stripe_FILES="zfs-pool-v1stripe1.dat \
zfs-pool-v1stripe2.dat  zfs-pool-v1stripe3.dat"
export ZPOOL_VERSION_1stripe_NAME="pool-v1stripe"
# v1 raidz
export ZPOOL_VERSION_1raidz_FILES="zfs-pool-v1raidz1.dat zfs-pool-v1raidz2.dat \
zfs-pool-v1raidz3.dat"
export ZPOOL_VERSION_1raidz_NAME="pool-v1raidz"
# v1 mirror
export ZPOOL_VERSION_1mirror_FILES="zfs-pool-v1mirror1.dat \
zfs-pool-v1mirror2.dat zfs-pool-v1mirror3.dat"
export ZPOOL_VERSION_1mirror_NAME="pool-v1mirror"


# Version 2 pools
export ZPOOL_VERSION_2_FILES="zfs-pool-v2.dat"
export ZPOOL_VERSION_2_NAME="v2-pool"
# v2 stripe
export ZPOOL_VERSION_2stripe_FILES="zfs-pool-v2stripe1.dat \
zfs-pool-v2stripe2.dat  zfs-pool-v2stripe3.dat"
export ZPOOL_VERSION_2stripe_NAME="pool-v2stripe"
# v2 raidz
export ZPOOL_VERSION_2raidz_FILES="zfs-pool-v2raidz1.dat zfs-pool-v2raidz2.dat \
zfs-pool-v2raidz3.dat"
export ZPOOL_VERSION_2raidz_NAME="pool-v2raidz"
# v2 mirror
export ZPOOL_VERSION_2mirror_FILES="zfs-pool-v2mirror1.dat \
zfs-pool-v2mirror2.dat zfs-pool-v2mirror3.dat"
export ZPOOL_VERSION_2mirror_NAME="pool-v2mirror"


# This is a v3 pool
export ZPOOL_VERSION_3_FILES="zfs-pool-v3.dat"
export ZPOOL_VERSION_3_NAME="v3-pool"
# v3 stripe
export ZPOOL_VERSION_3stripe_FILES="zfs-pool-v3stripe1.dat \
zfs-pool-v3stripe2.dat  zfs-pool-v3stripe3.dat"
export ZPOOL_VERSION_3stripe_NAME="pool-v3stripe"
# v3 raidz
export ZPOOL_VERSION_3raidz_FILES="zfs-pool-v3raidz1.dat zfs-pool-v3raidz2.dat \
zfs-pool-v3raidz3.dat"
export ZPOOL_VERSION_3raidz_NAME="pool-v3raidz"
# v3 mirror
export ZPOOL_VERSION_3mirror_FILES="zfs-pool-v3mirror1.dat \
zfs-pool-v3mirror2.dat zfs-pool-v3mirror3.dat"
export ZPOOL_VERSION_3mirror_NAME="pool-v3mirror"
# v3 raidz2
export ZPOOL_VERSION_3dblraidz_FILES="zfs-pool-v3raidz21.dat \
zfs-pool-v3raidz22.dat zfs-pool-v3raidz23.dat"
export ZPOOL_VERSION_3dblraidz_NAME="pool-v3raidz2"
# v3 hotspares
export ZPOOL_VERSION_3hotspare_FILES="zfs-pool-v3hotspare1.dat \
zfs-pool-v3hotspare2.dat zfs-pool-v3hotspare3.dat"
export ZPOOL_VERSION_3hotspare_NAME="pool-v3hotspare"

# v4 pool
export ZPOOL_VERSION_4_FILES="zfs-pool-v4.dat"
export ZPOOL_VERSION_4_NAME="v4-pool"

# v5 pool
export ZPOOL_VERSION_5_FILES="zfs-pool-v5.dat"
export ZPOOL_VERSION_5_NAME="v5-pool"

# v6 pool
export ZPOOL_VERSION_6_FILES="zfs-pool-v6.dat"
export ZPOOL_VERSION_6_NAME="v6-pool"

# v7 pool
export ZPOOL_VERSION_7_FILES="zfs-pool-v7.dat"
export ZPOOL_VERSION_7_NAME="v7-pool"

# v8 pool
export ZPOOL_VERSION_8_FILES="zfs-pool-v8.dat"
export ZPOOL_VERSION_8_NAME="v8-pool"

# v9 pool
export ZPOOL_VERSION_9_FILES="zfs-pool-v9.dat"
export ZPOOL_VERSION_9_NAME="v9-pool"

# v10 pool
export ZPOOL_VERSION_10_FILES="zfs-pool-v10.dat"
export ZPOOL_VERSION_10_NAME="v10-pool"

# v11 pool
export ZPOOL_VERSION_11_FILES="zfs-pool-v11.dat"
export ZPOOL_VERSION_11_NAME="v11-pool"

# v12 pool
export ZPOOL_VERSION_12_FILES="zfs-pool-v12.dat"
export ZPOOL_VERSION_12_NAME="v12-pool"

# v13 pool
export ZPOOL_VERSION_13_FILES="zfs-pool-v13.dat"
export ZPOOL_VERSION_13_NAME="v13-pool"

# v14 pool
export ZPOOL_VERSION_14_FILES="zfs-pool-v14.dat"
export ZPOOL_VERSION_14_NAME="v14-pool"

# v15 pool
export ZPOOL_VERSION_15_FILES="zfs-pool-v15.dat"
export ZPOOL_VERSION_15_NAME="v15-pool"

# This pool is a v2 pool, with device problems on one side of the mirror
# so that the pool appears as DEGRADED
export ZPOOL_VERSION_2brokenmirror_FILES="zfs-broken-mirror1.dat \
zfs-broken-mirror2.dat"
export ZPOOL_VERSION_2brokenmirror_NAME="zfs-broken-mirror"


# This pool is a v999 pool (an unknown version) which can be used to check
# whether upgrade, import or other tests that should fail against unknown
# pool versions should fail. It should not be listed in the CONFIGS
# variable below, as these are pool versions that can be imported and upgraded
export ZPOOL_VERSION_9999_FILES="zfs-pool-v999.dat"
export 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.
export 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"
