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