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 READDIR operation test - negative tests
  27 #       verify SERVER errors returned with invalid Getattr.
  28 
  29 # include all test enironment
  30 source READDIR.env
  31 
  32 Connect
  33 
  34 # setting local variables
  35 set TNAME $argv0
  36 set bfh [get_fh $BASEDIRS]
  37 
  38 # Start testing
  39 # --------------------------------------------------------------
  40 # a: Readdir from a bad-FH, expect BADHANDLE
  41 set expcode "BADHANDLE"
  42 set ASSERTION "Readdir from a bad-FH, expect $expcode"
  43 set tag "$TNAME{a}"
  44 #putmsg stdout 0 "$tag: $ASSERTION"
  45 #set res [compound {Putrootfh; Lookup "__badfh"; Readdir type}]
  46 #ckres "Readdir" $status $expcode $res $PASS
  47 #puts "\t Test UNTESTED: XXX need nfsv4shell & server support on BADFH\n"
  48 
  49 
  50 # h: Readdir with WrongSec, expect WRONGSEC
  51 # XXX Need more set with w/Security
  52 set expcode "WRONGSEC"
  53 set ASSERTION "Readdir with WrongSec, expect $expcode"
  54 set tag "$TNAME{h}"
  55 #putmsg stdout 0 "$tag: $ASSERTION"
  56 #puts "\t Test UNTESTED: XXX need <cfh> be changed w/SEC in server\n"
  57 
  58 
  59 # i: XXX how do we simulate some server errors:
  60 #       NFS4ERR_IO
  61 #       NFS4ERR_MOVE
  62 #       NFS4ERR_SERVERFAULT
  63 #       NFS4ERR_RESOURCE
  64 
  65 
  66 # m: try to Readdir of expired FH, expect FHEXPIRED
  67 set expcode "FHEXPIRED"
  68 set ASSERTION "Readdir an expired FH, expect $expcode"
  69 set tag "$TNAME{m}"
  70 #putmsg stdout 0 "$tag: $ASSERTION"
  71 #puts "\t Test UNTESTED: XXX need hook for FH to expire\n"
  72 
  73 
  74 # o: try to Readdir with delay, expect DELAY
  75 set expcode "DELAY"
  76 set ASSERTION "Readdir with , expect $expcode"
  77 set tag "$TNAME{o}"
  78 #putmsg stdout 0 "$tag: $ASSERTION"
  79 #puts "\t Test UNTESTED: need hooks for this?\n"
  80 
  81 
  82 # --------------------------------------------------------------
  83 # disconnect and exit
  84 Disconnect
  85 exit $PASS