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 view visibility of the stmf framework.
29
30 #
31 # __stc_assertion_start
32 #
33 # ID: visible002
34 #
35 # DESCRIPTION:
36 # Verify the view visibility with offline-lu operation
37 #
38 # STRATEGY:
39 #
40 # Setup:
41 # Create a host group hg
42 # Create a target group tg
43 # Create a logical unit lu1 lu2
44 # Add all the host initiator ports into the host group hg
45 # Add all the target ports into the target group tg
46 # Add the view entry with hg, tg and lu1
47 # Add the view entry with hg, tg and lu2
48 # Offline the logical unit lu2
49 # Test:
50 # Verify the host side can only see the logical unit lu1
51 # Cleanup:
52 # Delete the host group
53 # Delete the target group
54 # Delete the logical units
55 # Delete the view entry
56 #
57 # STRATEGY_NOTES:
58 #
59 # KEYWORDS:
60 #
61 # stmfadm add-view
62 #
63 # TESTABILITY: explicit
64 #
65 # AUTHOR: John.Gu@Sun.COM
66 #
67 # REVIEWERS:
68 #
69 # TEST_AUTOMATION_LEVEL: automated
70 #
71 # CODING_STATUS: IN_PROGRESS (2008-02-14)
72 #
73 # __stc_assertion_end
74 function visible002 {
75 cti_pass
76 tc_id="visible002"
77 tc_desc="Verify the view visibility with offline-lu operation"
78 print_test_case $tc_id - $tc_desc
79
80 build_fs zdsk
81 fs_zfs_create -V 1g $ZP/${VOL[0]}
82 fs_zfs_create -V 1g $ZP/${VOL[1]}
83
84 sbdadm_create_lu POS -s 1024k $DEV_ZVOL/$ZP/${VOL[0]}
85 sbdadm_create_lu POS -s 1024k $DEV_ZVOL/$ZP/${VOL[1]}
86 eval guid0=\$LU_${VOL[0]}_GUID
87 eval guid1=\$LU_${VOL[1]}_GUID
88
89 stmfadm_create POS tg ${TG[0]}
90 stmfadm_create POS hg ${HG[0]}
91
92 stmf_smf_disable
93 for port in $G_TARGET
94 do
95 stmfadm_add POS tg-member -g ${TG[0]} $port
96 done
97 stmf_smf_enable
98
99 stmsboot_enable_mpxio $FC_IHOST
100 typeset hostname=`format_shellvar $FC_IHOST`
101 eval initiator_list="\$HOST_${hostname}_INITIATOR"
102 for port in $initiator_list
103 do
104 stmfadm_add POS hg-member -g ${HG[0]} $port
105 done
106
107
108 stmfadm_add POS view -t ${TG[0]} -h ${HG[0]} $guid0
109 stmfadm_add POS view -t ${TG[0]} -h ${HG[0]} $guid1
110 stmfadm_offline POS lu $guid1
111
112 stmfadm_verify initiator
113
114 tp_cleanup
115 clean_fs zdsk
116
117 }
118