1 #!/usr/local/bin/ksh93 -p
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]
26 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
27 # Use is subject to license terms.
29 # ident "@(#)zdb_001_neg.ksh 1.4 08/02/27 SMI"
31 . $STF_SUITE/include/libtest.kshlib
33 ################################################################################
35 # __stc_assertion_start
40 # A badly formed parameter passed to zdb(1) should
44 # 1. Create an array containg bad zdb parameters.
45 # 2. For each element, execute the sub-command.
46 # 3. Verify it returns an error.
48 # TESTABILITY: explicit
50 # TEST_AUTOMATION_LEVEL: automated
52 # CODING_STATUS: COMPLETED (2005-09-28)
56 ################################################################################
58 verify_runnable "global"
60 set -A args "create" "add" "destroy" "import fakepool" \
61 "export fakepool" "create fakepool" "add fakepool" \
62 "create mirror" "create raidz" \
63 "create mirror fakepool" "create raidz fakepool" \
64 "create raidz1 fakepool" "create raidz2 fakepool" \
65 "create fakepool mirror" "create fakepool raidz" \
66 "create fakepool raidz1" "create fakepool raidz2" \
67 "add fakepool mirror" "add fakepool raidz" \
68 "add fakepool raidz1" "add fakepool raidz2" \
69 "add mirror fakepool" "add raidz fakepool" \
70 "add raidz1 fakepool" "add raidz2 fakepool" \
71 "setvprop" "blah blah" "-%" "--?" "-*" "-=" \
72 "-a" "-f" "-g" "-h" "-j" "-k" "-m" "-n" "-p" "-p /tmp" \
73 "-r" "-t" "-w" "-x" "-y" "-z" \
74 "-D" "-E" "-G" "-H" "-I" "-J" "-K" "-M" \
77 log_assert "Execute zdb using invalid parameters."
80 while [[ $i -lt ${#args[*]} ]]; do
81 log_mustnot $ZDB ${args[i]}
86 log_pass "Badly formed zdb parameters fail as expected."