1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26 # ident "@(#)tp_zones_001.ksh 1.3 08/06/11 SMI"
27 #
28
29 #
30 # zones test case
31 #
32
33 #__stc_assertion_start
34 #
35 #ID: zone_disable001
36 #
37 #DESCRIPTION:
38 #
39 # Attempt disable/enable from non-global zone.
40 #
41 #STRATEGY:
42 #
43 # Setup:
44 # - Create first share group with default options.
45 # - Add share to first share group.
46 # - Verify (by new and legacy* methods) that the share is indeed
47 # shared and has the default options.
48 # - Create second share group with default options.
49 # - Add share to second group.
50 # Test:
51 # - Attempt to disable the first test group from non-global
52 # zone. The attempt should fail.
53 # - Verify both groups are still enabled.
54 # - Disable the first test group from global zone.
55 # - Verify the second test group is still enabled.
56 # - Attempt to enable the first test group from non-global
57 # zone. The attempt should fail.
58 # - Verify the first test group is still disabled.
59 # - Enable the first test group from global zone.
60 # Cleanup:
61 # - Forcibly delete all share groups.
62 #
63 # STRATEGY_NOTES:
64 # - * Legacy methods will be used so long as they are still
65 # present.
66 # - Return status is checked for all share-related commands
67 # executed.
68 # - For all commands that modify the share configuration, the
69 # associated reporting commands will be executed and output
70 # checked to verify the expected changes have occurred.
71 #
72 #KEYWORDS:
73 #
74 # move-share
75 #
76 #TESTABILITY: explicit
77 #
78 #AUTHOR: andre.molyneux@sun.com
79 #
80 #REVIEWERS: TBD
81 #
82 #TEST_AUTOMATION_LEVEL: automated
83 #
84 #CODING_STATUS: COMPLETE
85 #
86 #__stc_assertion_end
87 function zone_disable001 {
88 tet_result PASS
89 tc_id="zone_disable001"
90 tc_desc="Attempt disable/enable fron non-global zone"
91 cmd_list=""
92 unset GROUPS
93 print_test_case $tc_id - $tc_desc
94 #
95 # Setup
96 #
97 # Create and populate first share group
98 #
99 create test_group_1
100 add_share POS test_group_1 "" ${MP[0]}
101 # Create and populate 'control' share group that will not be
102 # enabled/disabled
103 create test_group_2
104 add_share POS test_group_2 "" ${MP[1]}
105 #
106 # Perform disable/enable operations
107 #
108 # Attempt disable command from non-global zone
109 cmd_prefix="zlogin testzone1 "
110 disable NEG "" test_group_1
111 # Verify that test_group_1 is still enabled
112 verify_group_state test_group_1
113 # Verify that test_group_2 is still enabled
114 verify_group_state test_group_2
115 # Execute disable command from global zone
116 disable POS "" test_group_1
117 # Verify that test_group_2 is still enabled
118 verify_group_state test_group_2
119 # Attempt enable command from non-global zone
120 cmd_prefix="zlogin testzone1 "
121 enable NEG "" test_group_1
122 # Verify that test_group_1 is still disabled
123 verify_group_state test_group_1
124 # Verify that test_group_2 is still enabled
125 verify_group_state test_group_2
126 # Execute enable command with sufficient privileges
127 enable POS "" test_group_1
128 # Verify that test_group_2 is still enabled
129 verify_group_state test_group_2
130 #
131 # Cleanup
132 #
133 # Delete all test groups
134 delete_all_test_groups
135 report_cmds $tc_id POS
136 }