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 2008 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # ident "@(#)tp_create_001.ksh  1.3     08/06/11 SMI"
  27 #
  28 
  29 #
  30 # create-share test case
  31 #
  32 
  33 #__stc_assertion_start
  34 #
  35 #ID: create001
  36 #
  37 #DESCRIPTION:
  38 #
  39 #       Create a "blank" group
  40 #
  41 #STRATEGY:
  42 #
  43 #       Setup:
  44 #               - Create 2 groups as a control set of groups
  45 #       Test:
  46 #               - use the create command without a group
  47 #               - Verify that the command fails and that no group
  48 #                 was created.
  49 #       Cleanup:
  50 #               - Delete any groups created
  51 #
  52 #       STRATEGY_NOTES:
  53 #
  54 #KEYWORDS:
  55 #
  56 #       create NEG
  57 #
  58 #TESTABILITY: explicit
  59 #
  60 #AUTHOR: sean.wilcox@sun.com
  61 #
  62 #REVIEWERS: TBD
  63 #
  64 #TEST_AUTOMATION_LEVEL: automated
  65 #
  66 #CODING_STATUS: COMPLETE
  67 #
  68 #__stc_assertion_end
  69 function create001 {
  70         tet_result PASS
  71         tc_id="create001"
  72         tc_desc="Create a blank group"
  73         cmd_list=""
  74         unset GROUPS
  75         print_test_case $tc_id - $tc_desc
  76         #
  77         # Setup
  78         #
  79         # Create share group.  (Dry run, then for real.)
  80         create ${TG[0]} -n
  81         create ${TG[0]}
  82         create ${TG[1]} -n
  83         create ${TG[1]}
  84 
  85         #
  86         # Call list and count the items in the list
  87         #
  88         list
  89         groupcnt_before=`wc -l $l_log | awk ' { print $1 } '`
  90         #
  91         # Call create without a group.  (Dry run, then for real.)
  92         #
  93         create NEG "" -n
  94         create NEG ""
  95         #
  96         # Call list and count the items in the list, then check that the 
  97         # count has not increased.
  98         #
  99         list
 100         groupcnt_after=`wc -l $l_log | awk ' { print $1 } '`
 101         if [ $groupcnt_before -ne $groupcnt_after ]
 102         then
 103                 tet_infoline "FAIL - a blank group seems to have been created"
 104                 tet_result FAIL
 105         else
 106                 if [ $verbose ]
 107                 then
 108                         tet_infoline "PASS - a blank group was not created"
 109                 fi
 110         fi
 111         #
 112         # Cleanup
 113         #
 114         delete_all_test_groups
 115         report_cmds $tc_id POS
 116 }