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 data visibility related with
  29 # iscsi target port provider
  30 #
  31 
  32 # __stc_assertion_start
  33 #
  34 # ID: iscsi_visible_004
  35 #
  36 # DESCRIPTION:
  37 #       initiator can discovery new created target on target side
  38 #
  39 # STRATEGY:
  40 #       Setup:
  41 #               1. Configure discovery address with <target side ip address>
  42 #                  for initiator using iscsiadm add discovery-address
  43 #       Test:
  44 #               1. itadm create a target portal group with proper ip address
  45 #
  46 #               2. itadm create 3 targets with the created target portal group
  47 #
  48 #               3. Enable "SentTarget" discovery method on initiator using
  49 #                  iscsiadm modify discovery -t enable
  50 #
  51 #               4. Verify that the initiator can see the 3 new created target
  52 #
  53 #       Cleanup:
  54 #               1. Delete the targets, target portal group
  55 #
  56 #               2. Disable the discovery method on initiator and remove the
  57 #                  discovery address
  58 #
  59 #       STRATEGY_NOTES:
  60 #
  61 # TESTABILITY: explicit
  62 #
  63 # AUTHOR: zheng.he@sun.com
  64 #
  65 # REVIEWERS:
  66 #
  67 # ASSERTION_SOURCE:
  68 #
  69 # TEST_AUTOMATION_LEVEL: automated
  70 #
  71 # STATUS: IN_PROGRESS
  72 #
  73 # COMMENTS:
  74 #
  75 # __stc_assertion_end
  76 #
  77 function tp_iscsi_visible_004
  78 {
  79         cti_pass
  80 
  81         tc_id="tp_iscsi_visible_004"
  82 
  83         tc_desc="initiator can discovery new created target on target side"
  84         print_test_case $tc_id - $tc_desc
  85 
  86         typeset portal_list
  87         set -A portal_list $(get_portal_list ${ISCSI_THOST})
  88 
  89         iscsiadm_add POS "${ISCSI_IHOST}" discovery-address "${portal_list[0]}"
  90 
  91         itadm_create POS tpg 1 "${portal_list[0]}"
  92         itadm_create POS target -n ${IQN_TARGET}.${TARGET[0]} -t 1
  93         itadm_create POS target -n ${IQN_TARGET}.${TARGET[1]} -t 1
  94         itadm_create POS target -n ${IQN_TARGET}.${TARGET[2]} -t 1
  95 
  96         iscsiadm_modify POS "${ISCSI_IHOST}" discovery -t enable
  97         iscsiadm_verify "${ISCSI_IHOST}" target
  98 
  99         tp_cleanup
 100         initiator_cleanup "${ISCSI_IHOST}"
 101 }
 102