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 iscsi/target smf
  29 #
  30 
  31 # __stc_assertion_start
  32 #
  33 # ID: iscsi_smf_003
  34 #
  35 # DESCRIPTION:
  36 #       Verify the persistent configuration data is not retained by iscsi/target
  37 #
  38 # STRATEGY:
  39 #       Setup:
  40 #               Enable stmf smf
  41 #               Enable iscsi/target smf
  42 #       Test:
  43 #               Create target portal group tag 1
  44 #               Create target node with tag 1
  45 #               Disable iscsi/target smf
  46 #               Delete iscsi/target smf
  47 #               Import iscsi/target smf
  48 #               Enable iscsi/target smf
  49 #               Create target portal group tag 2
  50 #               Create target node with tag 2
  51 #                       
  52 #       Cleanup:
  53 #               Delete the target portal group
  54 #               Delete the target node
  55 #
  56 #       STRATEGY_NOTES:
  57 #
  58 # TESTABILITY: explicit
  59 #
  60 # AUTHOR: john.gu@sun.com
  61 #
  62 # REVIEWERS:
  63 #
  64 # ASSERTION_SOURCE:
  65 #
  66 # TEST_AUTOMATION_LEVEL: automated
  67 #
  68 # STATUS: IN_PROGRESS
  69 #
  70 # COMMENTS:
  71 #
  72 # __stc_assertion_end
  73 #
  74 function iscsi_smf_003
  75 {
  76         cti_pass
  77 
  78         typeset ret_code=0
  79         tc_id="iscsi_smf_003"
  80         tc_desc="Verify the persistent configuration data is not retained by iscsi/target"
  81         print_test_case $tc_id - $tc_desc
  82 
  83         stmf_smf_enable
  84         iscsi_target_smf_enable
  85 
  86         eval set -A portal $(get_portal_list $ISCSI_THOST)
  87 
  88         itadm_create POS tpg 1 ${portal[0]}
  89         itadm_create POS target -t 1
  90 
  91         iscsi_target_smf_disable
  92 
  93         iscsi_target_smf_reload
  94 
  95         iscsi_target_smf_enable
  96 
  97         itadm_create POS tpg 2 ${portal[1]}
  98         itadm_create POS target -t 2
  99 
 100         tp_cleanup
 101 }
 102