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_move_004.ksh    1.3     08/06/11 SMI"
  27 #
  28 
  29 #
  30 # move-share test case
  31 #
  32 
  33 #__stc_assertion_start
  34 #
  35 #ID: move004
  36 #
  37 #DESCRIPTION:
  38 #
  39 #       Move multiple shares from multiple share groups to a new share group
  40 #       that has differing options from the source groups.
  41 #
  42 #STRATEGY:
  43 #
  44 #       Setup:
  45 #               - Create first share group with default options.
  46 #               - Add multiple shares to the first share group.
  47 #               - Verify (by new and legacy* methods) that the shares are
  48 #                 indeed shared and have the default options.
  49 #               - Create second share group with options differing from the
  50 #                 first share group.
  51 #               - Add multiple shares to the second share group.
  52 #               - Verify (by new and legacy* methods) that the shares are
  53 #                 indeed shared and have the options of the second share group.
  54 #               - Create third share group with options differing from either
  55 #                 of the other share groups.
  56 #       Test:
  57 #               - Move some of the shares from first two groups to third group.
  58 #               - Verify (by new and legacy* methods) that the moved shares are
  59 #                 still shared and now have the options of the third share
  60 #                 group.
  61 #               - Verify (by new and legacy* methods) that the shares that were
  62 #                 not moved are still shared and retain the same options as
  63 #                 before.
  64 #       Cleanup:
  65 #               - Forcibly delete all share groups.
  66 #
  67 #       STRATEGY_NOTES:
  68 #               - * Legacy methods will be used so long as they are still
  69 #                 present.
  70 #               - Return status is checked for all share-related commands
  71 #                 executed.
  72 #               - For all commands that modify the share configuration, the
  73 #                 associated reporting commands will be executed and output
  74 #                 checked to verify the expected changes have occurred.
  75 #
  76 #KEYWORDS:
  77 #
  78 #       move-share
  79 #
  80 #TESTABILITY: explicit
  81 #
  82 #AUTHOR: andre.molyneux@sun.com
  83 #
  84 #REVIEWERS: TBD
  85 #
  86 #TEST_AUTOMATION_LEVEL: automated
  87 #
  88 #CODING_STATUS: COMPLETE
  89 #
  90 #__stc_assertion_end
  91 function move004 {
  92         tet_result PASS
  93         tc_id="move004"
  94         tc_desc="Move multiple shares from different groups to a new group with different options"
  95         cmd_list=""
  96         unset GROUPS
  97         print_test_case $tc_id - $tc_desc
  98         #
  99         # Setup
 100         #
 101         # Create and populate initial share group
 102         create test_group_1
 103         add_share POS test_group_1 "" ${MP[1]}
 104         add_share POS test_group_1 "" ${MP[2]}
 105         # Create and populate second share group
 106         create test_group_2 -P nfs -p public=true -p nosub=true
 107         add_share POS test_group_2 "" ${MP[3]}
 108         add_share POS test_group_2 "" ${MP[4]}
 109         # Create third test group
 110         create test_group_3 -P nfs -p nosuid=true -p anon=12345 \
 111             -p index=test_file_aaa
 112         #
 113         # Perform move operation.  (Dry run first then the real thing.)
 114         #
 115         move_share POS test_group_3 "-n" ${MP[1]} ${MP[3]}
 116         move_share POS test_group_3 "" ${MP[1]} ${MP[3]}
 117         #
 118         # Cleanup
 119         #
 120         # Delete all test groups
 121         delete_all_test_groups
 122         report_cmds $tc_id POS
 123 }