xref: /illumos-gate/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_023_neg.ksh (revision b6805bf78d2bbbeeaea8909a05623587b42d58b3)
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 http://www.opensolaris.org/os/licensing.
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 2009 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27
28. $STF_SUITE/include/libtest.shlib
29
30#
31# DESCRIPTION:
32# 'zpool create -O' should return an error with badly formed parameters.
33#
34# STRATEGY:
35# 1. Create an array of parameters with '-O'
36# 2. For each parameter in the array, execute 'zpool create -O'
37# 3. Verify an error is returned.
38#
39
40verify_runnable "global"
41
42function cleanup
43{
44	datasetexists $TESTPOOL && log_must $ZPOOL destroy $TESTPOOL
45}
46
47log_onexit cleanup
48
49set -A args "QuOta=none" "quota=non" "quota=abcd" "quota=0" "quota=" \
50    "ResErVaTi0n=none" "reserV=none" "reservation=abcd" "reserv=" \
51    "recorDSize=64k" "recordsize=256K" "recordsize=256" \
52    "recsize=" "recsize=zero" "recordsize=0" \
53    "mountPoint=/tmp/tmpfile$$" "mountpoint=non0" "mountpoint=" \
54    "mountpoint=LEGACY" "mounpoint=none" \
55    "sharenfs=ON" "ShareNFS=off" "sharenfs=sss" \
56    "checkSUM=on" "checksum=SHA256" "chsum=off" "checksum=aaa" \
57    "compression=of" "ComPression=lzjb" "compress=ON" "compress=a" \
58    "atime=ON" "ATime=off" "atime=bbb" \
59    "deviCes=on" "devices=OFF" "devices=aaa" \
60    "exec=ON" "EXec=off" "exec=aaa" \
61    "readonly=ON" "reADOnly=off" "rdonly=OFF" "rdonly=aaa" \
62    "zoned=ON" "ZoNed=off" "zoned=aaa" \
63    "snapdIR=hidden" "snapdir=VISible" "snapdir=aaa" \
64    "aclmode=DIScard" "aclmODE=groupmask" "aclmode=aaa" \
65    "aclinherit=deny" "aclinHerit=secure" "aclinherit=aaa" \
66    "type=volume" "type=snapshot" "type=filesystem" \
67    "creation=aaa" "used=10K" "available=10K" \
68    "referenced=10K" "compressratio=1.00x" \
69    "version=0" "version=1.234" "version=10K" "version=-1" \
70    "version=aaa" "version=999"
71
72log_assert "'zpool create -O' should return an error with badly formed parameters."
73
74typeset -i i=0
75while (( $i < ${#args[*]} )); do
76	log_mustnot $ZPOOL create -O ${args[i]} -f $TESTPOOL $DISKS
77	((i = i + 1))
78done
79
80log_pass "'zpool create -O' should return an error with badly formed parameters."
81
82