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 2006 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # NFSv4 COMMIT operation test - more of negative tests
  27 
  28 # include all test enironment
  29 source COMMIT.env
  30 
  31 # connect to the test server
  32 Connect
  33 
  34 # setting local variables
  35 set TNAME $argv0
  36 set bfh [get_fh $BASEDIRS]
  37 
  38 # Start testing
  39 # --------------------------------------------------------------
  40 # b: Commit but the file is removed, expect STALE
  41 set expcode "STALE"
  42 set ASSERTION "Commit but the file is removed, expect $expcode"
  43 set tag "$TNAME{b}"
  44 #putmsg stdout 0 "$tag: $ASSERTION"
  45 #puts "\t Test UNTESTED: XXX need hook to remove <cfh> in server\n"
  46 
  47 
  48 # m: Commit with <cfh> is bad, expect BADHANDLE
  49 set expcode "BADHANDLE"
  50 set ASSERTION "Commit with <cfh> is bad, expect $expcode"
  51 set tag "$TNAME{m}"
  52 #putmsg stdout 0 "$tag: $ASSERTION"
  53 #puts "\t Test UNTESTED: XXX need hook from server to set <cfh> to a bad FH\n"
  54 
  55 
  56 # n: try to Commit of expired FH, expect FHEXPIRED
  57 set expcode "FHEXPIRED"
  58 set ASSERTION "Commit an expired FH, expect $expcode"
  59 set tag "$TNAME{n}"
  60 #putmsg stdout 0 "$tag: $ASSERTION"
  61 #puts "\t Test UNTESTED: XXX need server hook for FH expired.\n"
  62 
  63 
  64 # x: Commit with WrongSec, expect WRONGSEC
  65 # XXX Need more setup with w/Security
  66 set expcode "WRONGSEC"
  67 #set ASSERTION "Commit with wrongSec, expect $expcode"
  68 set tag "$TNAME{x}"
  69 #putmsg stdout 0 "$tag: $ASSERTION"
  70 #set res [compound {Putrootfh; Commit $env(KRB5DIR)}]
  71 #ckres "Commit" $status $expcode $res $PASS
  72 #puts "\t Test UNTESTED: XXX need hook to change SEC in <cfh>.\n"
  73 
  74 # y: XXX how do we simulate some server errors:
  75 #       NFS4ERR_MOVED
  76 #       NFS4ERR_SERVERFAULT
  77 #       NFS4ERR_RESOURCE
  78 #       NFS4ERR_IO
  79 
  80 
  81 # --------------------------------------------------------------
  82 # disconnect and exit
  83 Disconnect
  84 exit $PASS