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# Newly created pools should have all features enabled. 33# Specifying a feature to be enabled with '-o' should be a no-op. 34# 35# 1. Create a new pool. 36# 2. Verify that every feature@ property is in the 'enabled' or 'active' state 37# 3. Destroy the pool and create a new pool with 38# '-o feature@async_destroy=enabled' 39# 4. Verify again. 40# 41################################################################################ 42 43verify_runnable "global" 44 45function cleanup 46{ 47 datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL 48} 49 50function check_features 51{ 52 for state in $(zpool get all $TESTPOOL | \ 53 awk '$2 ~ /feature@/ { print $3 }'); do 54 if [[ "$state" != "enabled" && "$state" != "active" ]]; then 55 log_fail "some features are not enabled on new pool" 56 fi 57 done 58} 59 60log_onexit cleanup 61 62log_assert "'zpool create' creates pools with all features enabled" 63 64log_must zpool create -f $TESTPOOL $DISKS 65check_features 66log_must zpool destroy -f $TESTPOOL 67 68log_must zpool create -f -o feature@async_destroy=enabled $TESTPOOL $DISKS 69check_features 70 71log_pass "'zpool create' creates pools with all features enabled" 72