1#!/bin/ksh -p 2# 3# CDDL HEADER START 4# 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. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or https://opensource.org/licenses/CDDL-1.0. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 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] 19# 20# CDDL HEADER END 21# 22 23# 24# Copyright (c) 2012, 2016 by Delphix. All rights reserved. 25# 26 27. $STF_SUITE/include/libtest.shlib 28. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib 29 30################################################################################ 31# 32# When using the '-d' option or specifying '-o version=X' new pools should 33# have all features disabled. 34# 35# 1. Create a new pool with '-d'. 36# 2. Verify that every feature@ property is in the 'disabled' state 37# 3. Destroy pool and re-create with -o version=28 38# 4. Verify again. 39# 40################################################################################ 41 42verify_runnable "global" 43 44function cleanup 45{ 46 datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL 47} 48 49function check_features 50{ 51 for prop in $(zpool get all $TESTPOOL | awk '$2 ~ /feature@/ { print $2 }'); do 52 state=$(zpool list -Ho "$prop" $TESTPOOL) 53 if [[ "$state" != "disabled" ]]; then 54 log_fail "$prop is enabled on new pool" 55 fi 56 done 57} 58 59log_onexit cleanup 60 61log_assert "'zpool create -d' creates pools with all features disabled" 62 63log_must zpool create -f -d $TESTPOOL $DISKS 64check_features 65log_must zpool destroy -f $TESTPOOL 66 67log_must zpool create -f -o version=28 $TESTPOOL $DISKS 68check_features 69 70log_pass 71