1d583b39bSJohn Wren Kennedy#!/bin/ksh -p
2d583b39bSJohn Wren Kennedy#
3d583b39bSJohn Wren Kennedy# CDDL HEADER START
4d583b39bSJohn Wren Kennedy#
5d583b39bSJohn Wren Kennedy# The contents of this file are subject to the terms of the
6d583b39bSJohn Wren Kennedy# Common Development and Distribution License (the "License").
7d583b39bSJohn Wren Kennedy# You may not use this file except in compliance with the License.
8d583b39bSJohn Wren Kennedy#
9d583b39bSJohn Wren Kennedy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10d583b39bSJohn Wren Kennedy# or http://www.opensolaris.org/os/licensing.
11d583b39bSJohn Wren Kennedy# See the License for the specific language governing permissions
12d583b39bSJohn Wren Kennedy# and limitations under the License.
13d583b39bSJohn Wren Kennedy#
14d583b39bSJohn Wren Kennedy# When distributing Covered Code, include this CDDL HEADER in each
15d583b39bSJohn Wren Kennedy# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16d583b39bSJohn Wren Kennedy# If applicable, add the following below this CDDL HEADER, with the
17d583b39bSJohn Wren Kennedy# fields enclosed by brackets "[]" replaced with your own identifying
18d583b39bSJohn Wren Kennedy# information: Portions Copyright [yyyy] [name of copyright owner]
19d583b39bSJohn Wren Kennedy#
20d583b39bSJohn Wren Kennedy# CDDL HEADER END
21d583b39bSJohn Wren Kennedy#
22d583b39bSJohn Wren Kennedy
23d583b39bSJohn Wren Kennedy#
241d32ba66SJohn Wren Kennedy# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
25d583b39bSJohn Wren Kennedy#
26d583b39bSJohn Wren Kennedy
27d583b39bSJohn Wren Kennedy. $STF_SUITE/include/libtest.shlib
28d583b39bSJohn Wren Kennedy
29d583b39bSJohn Wren Kennedy################################################################################
30d583b39bSJohn Wren Kennedy#
31fa517adbSYuri Pankov#  Specifying invalid feature names/states should cause the create to fail.
32d583b39bSJohn Wren Kennedy#
33fa517adbSYuri Pankov#  1. Try to create the pool with a variety of invalid feature names/states.
34d583b39bSJohn Wren Kennedy#  2. Verify no pool was created.
35d583b39bSJohn Wren Kennedy#
36d583b39bSJohn Wren Kennedy################################################################################
37d583b39bSJohn Wren Kennedy
38d583b39bSJohn Wren Kennedyverify_runnable "global"
39d583b39bSJohn Wren Kennedy
40fa517adbSYuri Pankovproperties="\
41*f3434519SLOLifeature@async_destroy=disable \
42fa517adbSYuri Pankovfeature@async_destroy=active \
43fa517adbSYuri Pankovfeature@xxx_fake_xxx=enabled \
44fa517adbSYuri Pankovunsupported@some_feature=inactive \
45fa517adbSYuri Pankovunsupported@some_feature=readonly \
46fa517adbSYuri Pankov"
47d583b39bSJohn Wren Kennedy
48d583b39bSJohn Wren Kennedyfunction cleanup
49d583b39bSJohn Wren Kennedy{
501d32ba66SJohn Wren Kennedy	datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
51d583b39bSJohn Wren Kennedy}
52d583b39bSJohn Wren Kennedy
53fa517adbSYuri Pankovlog_assert "'zpool create' with invalid feature names/states fails"
54d583b39bSJohn Wren Kennedylog_onexit cleanup
55d583b39bSJohn Wren Kennedy
56d583b39bSJohn Wren Kennedyfor prop in $properties; do
571d32ba66SJohn Wren Kennedy	log_mustnot zpool create -f -o "$prop" $TESTPOOL $DISKS
58d583b39bSJohn Wren Kennedy	log_mustnot datasetexists $TESTPOOL
59d583b39bSJohn Wren Kennedydone
60d583b39bSJohn Wren Kennedy
61d583b39bSJohn Wren Kennedylog_pass
62