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 backing storage
  29 #
  30 
  31 # __stc_assertion_start
  32 #
  33 # ID: iscsi_fs_001
  34 #
  35 # DESCRIPTION:
  36 #       Running I/O data validation on UFS backing storage 
  37 #
  38 # STRATEGY:
  39 #       Setup:
  40 #               MPXIO is enable on initiator host
  41 #               ufs LUs (specified by VOL_MAX variable in configuration) are
  42 #                   created in iSCSI target host 
  43 #               Map all the LUs can be accessed by all the target and host groups
  44 #                   by stmfadm add-view option
  45 #               Create one target portal group 1 with all the portals included
  46 #               Create one target node with tpgt 1
  47 #               Modify initiator target-param to allow all the initiator portals
  48 #                   to create one session individually to support mutlti-pathing 
  49 #                   with each target node
  50 #               Setup initiator node to enable "SendTarget" method
  51 #               Setup SendTarget with discovery address on initiator host
  52 #       Test:
  53 #               Start diskomizer on the initiator host
  54 #               Running I/O for 5 minutes
  55 #                       
  56 #       Cleanup:
  57 #               Stop the diskomizer
  58 #               Delete the target portal group
  59 #               Delete the target node
  60 #               Delete the configuration information in initiator and target
  61 #
  62 #       STRATEGY_NOTES:
  63 #
  64 # TESTABILITY: explicit
  65 #
  66 # AUTHOR: john.gu@sun.com
  67 #
  68 # REVIEWERS:
  69 #
  70 # ASSERTION_SOURCE:
  71 #
  72 # TEST_AUTOMATION_LEVEL: automated
  73 #
  74 # STATUS: IN_PROGRESS
  75 #
  76 # COMMENTS:
  77 #
  78 # __stc_assertion_end
  79 #
  80 function iscsi_fs_001
  81 {
  82         cti_pass
  83 
  84         tc_id="iscsi_fs_001"
  85         tc_desc="verify I/O data validation can pass UFS backing store"
  86         print_test_case $tc_id - $tc_desc
  87 
  88         msgfile_mark $ISCSI_IHOST START $tc_id
  89         msgfile_mark $ISCSI_THOST START $tc_id
  90 
  91         stmsboot_enable_mpxio $ISCSI_IHOST
  92 
  93         build_fs ufs
  94 
  95         typeset vol_num=0
  96         while [ $vol_num -lt $VOL_MAX ]
  97         do
  98                 typeset vol_id=`/usr/bin/printf "%03s" $vol_num`
  99                 typeset vol_name=vol${vol_id}
 100 
 101                 touch $MP/$vol_name
 102                 sbdadm_create_lu POS -s ${VOL_SIZE} $MP/$vol_name
 103                 (( vol_num+=1 ))
 104         done
 105 
 106         build_full_mapping
 107 
 108         build_tpgt_portals $ISCSI_THOST 1
 109 
 110         itadm_create POS target -t 1
 111 
 112         iscsiadm_modify POS $ISCSI_IHOST discovery -t disable
 113         iscsiadm_add POS $ISCSI_IHOST discovery-address $ISCSI_THOST
 114         iscsiadm_modify POS $ISCSI_IHOST discovery -t enable
 115 
 116         start_disko $ISCSI_IHOST
 117 
 118         sleep $FS_SECONDS
 119 
 120         stop_disko $ISCSI_IHOST
 121         verify_disko $ISCSI_IHOST
 122         ret=$?
 123         echo Done verify_disko
 124 
 125         msgfile_mark $ISCSI_IHOST STOP $tc_id
 126         msgfile_extract $ISCSI_IHOST $tc_id
 127         msgfile_mark $ISCSI_THOST STOP $tc_id
 128         msgfile_extract $ISCSI_THOST $tc_id
 129 
 130         host_reboot $ISCSI_IHOST
 131         tp_cleanup
 132         clean_fs ufs
 133         initiator_cleanup $ISCSI_IHOST
 134         [[ $ret -eq 0 ]] && cti_pass "tp_iscsi_fs_001: PASS"
 135 }
 136