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 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26
27 #
28 # A test purpose file to test functionality of the add-view subfunction
29 # of the stmfadm command.
30
31 #
32 # __stc_assertion_start
33 #
34 # ID: add023
35 #
36 # DESCRIPTION:
37 # Attempt to add the valid view with specified logical unit
38 # and without lu number
39 #
40 # STRATEGY:
41 #
42 # Setup:
43 # Create the logical unit lu1 lu2
44 # Create the host group hg1 hg2
45 # Create the target group tg1 tg2
46 # Add the view with hg1, tg1 on lu1
47 # Add the view with hg2, tg2 on lu1
48 # Add the conflict view with hg2, tg2 and lun=0 on lu2
49 # Add the conflict view with hg2, and lun=0 on lu2
50 # Add the valid view with hg2, tg2 on lu2
51 # Test:
52 # Verify the last view addition success
53 # Verify the return code
54 # Cleanup:
55 # Delete the logical unit lu1 lu2
56 # Delete the host group hg1 hg2
57 # Delete the target group tg1 tg2
58 # Remove the existing view
59 #
60 # STRATEGY_NOTES:
61 #
62 # KEYWORDS:
63 #
64 # add-view
65 #
66 # TESTABILITY: explicit
67 #
68 # AUTHOR: John.Gu@Sun.COM
69 #
70 # REVIEWERS:
71 #
72 # TEST_AUTOMATION_LEVEL: automated
73 #
74 # CODING_STATUS: IN_PROGRESS (2008-02-14)
75 #
76 # __stc_assertion_end
77 function add023 {
78 cti_pass
79 tc_id="add023"
80 tc_desc="Add another view with different lu number for specified lu"
81 print_test_case $tc_id - $tc_desc
82
83 build_fs zdsk
84 fs_zfs_create -V 1g $ZP/${VOL[0]}
85 fs_zfs_create -V 1g $ZP/${VOL[1]}
86
87 sbdadm_create_lu POS -s 1024k $DEV_ZVOL/$ZP/${VOL[0]}
88 sbdadm_create_lu POS -s 1024k $DEV_ZVOL/$ZP/${VOL[1]}
89
90 eval guid0=\$LU_${VOL[0]}_GUID
91 eval guid1=\$LU_${VOL[1]}_GUID
92
93 stmfadm_create POS hg ${HG[0]}
94 stmfadm_create POS hg ${HG[1]}
95
96 stmfadm_create POS tg ${TG[0]}
97 stmfadm_create POS tg ${TG[1]}
98
99 stmfadm_add POS view -h ${HG[0]} -t ${TG[0]} $guid0
100 stmfadm_add POS view -h ${HG[1]} -t ${TG[1]} $guid0
101 stmfadm_add NEG view -h ${HG[1]} -t ${TG[1]} -n 0 $guid1
102 stmfadm_add NEG view -h ${HG[1]} -n 0 $guid1
103 stmfadm_add POS view -h ${HG[1]} -t ${TG[1]} $guid1
104
105
106 tp_cleanup
107 clean_fs zdsk
108
109 }