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