5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright (c) 2012, 2016 by Delphix. All rights reserved.
27 . $STF_SUITE/include/libtest.shlib
28 . $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
30 #################################################################################
32 # Pool cannot be opened with active unsupported features. Error message should
33 # list active unsupported features.
36 # 2. Export and inject unsuppored features with zhack, make some of them active.
37 # 3. Try to import pool, error should only list active features. It should
38 # not say anything about being able to import the pool in readonly mode.
40 ################################################################################
42 verify_runnable "global"
44 enabled_features="com.test:xxx_unsup1 com.test:xxx_unsup3"
45 active_features="com.test:xxx_unsup0 com.test:xxx_unsup2"
49 poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1
52 log_must mkfile $FILE_SIZE $VDEV0
55 log_assert "Pool with active unsupported features cannot be imported."
58 log_must zpool create $TESTPOOL1 $VDEV0
59 log_must zpool export $TESTPOOL1
61 for feature in $enabled_features $active_features; do
62 log_must zhack -d $DEVICE_DIR feature enable $TESTPOOL1 $feature
65 for feature in $active_features; do
66 log_must zhack -d $DEVICE_DIR feature ref $TESTPOOL1 $feature
69 log_mustnot zpool import -d $DEVICE_DIR $TESTPOOL1
71 # error message should not mention "readonly"
72 log_mustnot eval "zpool import -d $DEVICE_DIR $TESTPOOL1 | grep readonly"
73 log_mustnot poolexists $TESTPOOL1
75 for feature in $active_features; do
76 log_must eval "zpool import -d $DEVICE_DIR $TESTPOOL1 \
78 log_mustnot poolexists $TESTPOOL1
81 for feature in $enabled_features; do
82 log_mustnot eval "zpool import -d $DEVICE_DIR $TESTPOOL1 \
84 log_mustnot poolexists $TESTPOOL1