]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_features_005_pos.ksh
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 by Delphix. All rights reserved.
27 .
$STF_SUITE/include
/libtest.shlib
28 .
$STF_SUITE/tests
/functional
/cli_root
/zpool_create
/zpool_create.shlib
30 ################################################################################
32 # Specifically disabling a feature, all other features should be enabled.
34 # 1. Loop through all existing features:
35 # a. Create a new pool with '-o feature@XXX=disabled'.
36 # b. Verify that every other feature is 'enabled' or 'active'.
38 ################################################################################
40 verify_runnable
"global"
44 datasetexists
$TESTPOOL && log_must zpool destroy
$TESTPOOL
47 function check_features
49 typeset feature
="${1}"
51 zpool get all
${TESTPOOL} |
grep feature@ |
while read line
; do
52 set -- $
(echo "${line}")
54 if [[ "feature@${feature}" == "${2}" ]]; then
55 # Failure passed feature must be disabled.
56 if [[ "${3}" != "disabled" ]]; then
60 # Failure other features must be enabled or active.
61 if [[ "${3}" != "enabled" && "${3}" != "active" ]]; then
67 # All features enabled or active except the expected one.
73 # Several representative features are tested to keep the test time short.
74 # The features 'extensible_dataset' and 'enabled_txg' are intentionally
75 # excluded because other features depend on them.
83 while (( $i < ${#features[*]} )); do
84 log_assert
"'zpool create' creates pools with ${features[i]} disabled"
86 log_must zpool create
-f -o "feature@${features[i]}=disabled" \
88 log_must check_features
"${features[i]}"
89 log_must zpool destroy
-f $TESTPOOL
93 log_pass
"'zpool create -o feature@feature=disabled' disables features"