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_002
  34 #
  35 # DESCRIPTION:
  36 #       Verify itadm can not create obejcts when iscsi/target disabled
  37 #
  38 # STRATEGY:
  39 #       Setup:
  40 #               Enable stmf smf
  41 #               Disable iscsi/target smf
  42 #       Test:
  43 #               Attempt to create target portal group tag 1
  44 #               Attempt to create target node with tag 1
  45 #                       
  46 #       Cleanup:
  47 #               Delete the target portal group
  48 #               Delete the target node
  49 #
  50 #       STRATEGY_NOTES:
  51 #
  52 # TESTABILITY: explicit
  53 #
  54 # AUTHOR: john.gu@sun.com
  55 #
  56 # REVIEWERS:
  57 #
  58 # ASSERTION_SOURCE:
  59 #
  60 # TEST_AUTOMATION_LEVEL: automated
  61 #
  62 # STATUS: IN_PROGRESS
  63 #
  64 # COMMENTS:
  65 #
  66 # __stc_assertion_end
  67 #
  68 function iscsi_smf_002
  69 {
  70         cti_pass
  71 
  72         tc_id="iscsi_smf_002"
  73         tc_desc="Verify itadm can not create obejcts when iscsi/target disabled"
  74         print_test_case $tc_id - $tc_desc
  75 
  76         stmf_smf_enable
  77         iscsi_target_smf_disable
  78 
  79         eval set -A portal $(get_portal_list $ISCSI_THOST)
  80 
  81         itadm_create NEG tpg 1 ${portal[0]}
  82         itadm_create NEG target -t 1
  83 
  84         iscsi_target_smf_enable
  85         tp_cleanup
  86 }
  87