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 target discovery
  29 #
  30 
  31 # __stc_assertion_start
  32 #
  33 # ID: iscsi_discovery_004
  34 #
  35 # DESCRIPTION:
  36 #       iSCSI target with a active target portal group can register into 
  37 #       the default discovery domain of iSNS server and be visible by iSNS
  38 #       server
  39 #
  40 # STRATEGY:
  41 #       Setup:
  42 #               Modify default settings to isns enable and configure the isns
  43 #                   server ip address and port on target host
  44 #               Create a target portal group
  45 #               Create target node with specified node name and a tpg by 
  46 #                   itadm create-target option
  47 #       Test:
  48 #               Check that target node can be visible by isns server
  49 #       Cleanup:
  50 #               Delete the target node
  51 #               Delete the configuration information in isns server and target
  52 #
  53 #       STRATEGY_NOTES:
  54 #
  55 # TESTABILITY: explicit
  56 #
  57 # AUTHOR: john.gu@sun.com
  58 #
  59 # REVIEWERS:
  60 #
  61 # ASSERTION_SOURCE:
  62 #
  63 # TEST_AUTOMATION_LEVEL: automated
  64 #
  65 # STATUS: IN_PROGRESS
  66 #
  67 # COMMENTS:
  68 #
  69 # __stc_assertion_end
  70 #
  71 function iscsi_discovery_004
  72 {
  73         cti_pass
  74 
  75         tc_id="iscsi_discovery_004"
  76 
  77         tc_desc="iSCSI target with a active target portal group can register"
  78         tc_desc="${tc_desc} into the default discovery domain of iSNS server"
  79         tc_desc="${tc_desc} and be visible by iSNS server"
  80         print_test_case $tc_id - $tc_desc
  81 
  82         typeset t="${IQN_TARGET}.${TARGET[0]}"
  83 
  84         # Enable isns service on target host
  85         itadm_modify POS defaults -I "${ISNS_HOST}"
  86         itadm_modify POS defaults -i "enable"
  87 
  88         typeset portal_list
  89         set -A portal_list $(get_portal_list ${ISCSI_THOST})
  90 
  91         # Create target protal group
  92         itadm_create POS tpg 1 "${portal_list[0]}"
  93         # Create target 
  94         itadm_create POS target -n ${t} -t 1
  95 
  96         isnsadm_verify
  97 
  98         tp_cleanup
  99 }
 100