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 OPENATTR operation test - negative tests
  27 #       verify SERVER errors returned under error conditions
  28 
  29 # include all test enironment
  30 source OPENATTR.env
  31 
  32 # connect to the test server
  33 Connect
  34 
  35 # setting local variables
  36 set TNAME $argv0
  37 set bfh [get_fh "$BASEDIRS"]
  38 
  39 
  40 # Start testing
  41 # --------------------------------------------------------------
  42 # a: Try to openattr with bad <cfh> - expect BADHANDLE
  43 set expcode "BADHANDLE"
  44 set ASSERTION "openattr with bad <cfh>, expect $expcode"
  45 set tag "$TNAME{a}"
  46 #putmsg stdout 0 "$tag: $ASSERTION"
  47 #set res [compound {Putfh $bfh; Lookup __badfh; Openattr T}]
  48 #ckres "Openattr" $status $expcode $res $PASS
  49 #puts "\t Test UNTESTED: need different thread to trash <cfh> in server."
  50 
  51 
  52 # b: Openattr when the <cfh> expired - expect FHEXPIRED
  53 set expcode "FHEXPIRED"
  54 set ASSERTION "Openattr when the <cfh> expired, expect $expcode"
  55 set tag "$TNAME{b}"
  56 #putmsg stdout 0 "$tag: $ASSERTION"
  57 #set res [compound {Putfh $bfh; Lookup __fhexp; Openattr T}]
  58 #ckres "Openattr" $status $expcode $res $PASS
  59 #puts "\t Test UNTESTED: need migration support in server."
  60 
  61 
  62 # c: Openattr when the <cfh> moved - expect MOVED
  63 set expcode "MOVED"
  64 set ASSERTION "Openattr when the <cfh> moved, expect $expcode"
  65 set tag "$TNAME{c}"
  66 #putmsg stdout 0 "$tag: $ASSERTION"
  67 #set res [compound {Putfh $bfh; Lookup __moved; Openattr T}]
  68 #ckres "Openattr" $status $expcode $res $PASS
  69 puts "\t Test UNTESTED: need migration support in server."
  70 
  71 
  72 # d: Openattr when the <cfh> removed - expect STALE
  73 set expcode "STALE"
  74 set ASSERTION "Openattr when the <cfh> is revmoed, expect $expcode"
  75 set tag "$TNAME{d}"
  76 #putmsg stdout 0 "$tag: $ASSERTION"
  77 #set res [compound {Putfh $bfh; Lookup __stale; Openattr T}]
  78 #ckres "Openattr" $status $expcode $res $PASS
  79 #puts "\t Test UNTESTED: need different thread to remove <cfh> in server."
  80 
  81 
  82 # e: Openattr when the <cfh> changed SEC - expect WRONGSEC
  83 set expcode "WRONGSEC"
  84 set ASSERTION "Openattr when the <cfh> is changed SEC, expect $expcode"
  85 set tag "$TNAME{e}"
  86 #putmsg stdout 0 "$tag: $ASSERTION"
  87 #set res [compound {Putfh $bfh; Lookup __wsec; Openattr T}]
  88 #ckres "Openattr" $status $expcode $res $PASS
  89 #puts "\t Test UNTESTED: need different thread to change sec to <cfh> in server"
  90 
  91 
  92 # m: Openattr when the server errors - expect XXX
  93 # XXX current there is no way to simulate the following errors:
  94 #       NFS4ERR_IO
  95 #       NFS4ERR_RESOURCE
  96 #       NFS4ERR_SERVERFAULT
  97 
  98 
  99 # --------------------------------------------------------------
 100 # disconnect and exit
 101 Disconnect
 102 exit $PASS