7290 ZFS test suite needs to control what utilities it can run
[unleashed.git] / usr / src / test / zfs-tests / tests / functional / cli_root / zpool_create / zpool_create_023_neg.ksh
blob5626ed2518b2b0078029abbd9675d1cf941a5bab
1 #!/bin/ksh -p
3 # CDDL HEADER START
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]
20 # CDDL HEADER END
24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2015, 2016 by Delphix. All rights reserved.
32 . $STF_SUITE/include/libtest.shlib
35 # DESCRIPTION:
36 # 'zpool create -O' should return an error with badly formed parameters.
38 # STRATEGY:
39 # 1. Create an array of parameters with '-O'
40 # 2. For each parameter in the array, execute 'zpool create -O'
41 # 3. Verify an error is returned.
44 verify_runnable "global"
46 function cleanup
48 datasetexists $TESTPOOL && log_must zpool destroy $TESTPOOL
51 log_onexit cleanup
53 set -A args "QuOta=none" "quota=non" "quota=abcd" "quota=0" "quota=" \
54 "ResErVaTi0n=none" "reserV=none" "reservation=abcd" "reserv=" \
55 "recorDSize=64k" "recordsize=2M" "recordsize=2048K" \
56 "recordsize=256" "recsize=" "recsize=zero" "recordsize=0" \
57 "mountPoint=/tmp/tmpfile$$" "mountpoint=non0" "mountpoint=" \
58 "mountpoint=LEGACY" "mounpoint=none" \
59 "sharenfs=ON" "ShareNFS=off" "sharenfs=sss" \
60 "checkSUM=on" "checksum=SHA256" "chsum=off" "checksum=aaa" \
61 "compression=of" "ComPression=lzjb" "compress=ON" "compress=a" \
62 "atime=ON" "ATime=off" "atime=bbb" \
63 "deviCes=on" "devices=OFF" "devices=aaa" \
64 "exec=ON" "EXec=off" "exec=aaa" \
65 "readonly=ON" "reADOnly=off" "rdonly=OFF" "rdonly=aaa" \
66 "zoned=ON" "ZoNed=off" "zoned=aaa" \
67 "snapdIR=hidden" "snapdir=VISible" "snapdir=aaa" \
68 "aclmode=DIScard" "aclmODE=groupmask" "aclmode=aaa" \
69 "aclinherit=deny" "aclinHerit=secure" "aclinherit=aaa" \
70 "type=volume" "type=snapshot" "type=filesystem" \
71 "creation=aaa" "used=10K" "available=10K" \
72 "referenced=10K" "compressratio=1.00x" \
73 "version=0" "version=1.234" "version=10K" "version=-1" \
74 "version=aaa" "version=999"
76 log_assert "'zpool create -O' should return an error with badly formed parameters."
78 typeset -i i=0
79 while (( $i < ${#args[*]} )); do
80 log_mustnot zpool create -O ${args[i]} -f $TESTPOOL $DISKS
81 ((i = i + 1))
82 done
84 log_pass "'zpool create -O' should return an error with badly formed parameters."