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 SETATTR operation test - negative tests
  27 #       mostly UNTESTED tests
  28 
  29 # include all test enironment
  30 source SETATTR.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 # Start testing
  40 # --------------------------------------------------------------
  41 # b: try to Setattr while the obj is removed, expect STALE
  42 set expcode "STALE"
  43 set ASSERTION "try to Setattr while obj is removed, expect $expcode"
  44 set tag "$TNAME{b}"
  45 #putmsg stdout 0 "$tag: $ASSERTION"
  46 #set tmpd "tmp.[pid]"
  47 #set res [compound {Putfh $bfh; Create $tmpd {{mode 0775}} d; Getfh}]
  48 #set tfh [lindex [lindex $res 2] 2]
  49 #check_op "Putfh $bfh; Remove $tmpd" "OK" "UNINITIATED"
  50 #set ntime "[clock seconds] 0"
  51 #set res [compound {Putfh $tfh; 
  52 #       Setattr {0 0} {{time_modify_set {$ntime}}}; Getfh}]
  53 #ckres "Setattr" $status $expcode $res $PASS
  54 #puts "\t Test UNTESTED: XXX need to remove <cfh> between PUTFH/SETATTR\n"
  55 
  56 
  57 # g: Setattr from a bad-FH, expect BADHANDLE
  58 set expcode "BADHANDLE"
  59 set ASSERTION "Setattr from a bad-FH, expect $expcode"
  60 set tag "$TNAME{g}"
  61 #putmsg stdout 0 "$tag: $ASSERTION"
  62 #set res [compound {Putrootfh; Lookup "__badfh"; Setattr 0 {{mode 000}}}]
  63 #ckres "Setattr" $status $expcode $res $PASS
  64 #puts "\t Test UNTESTED: XXX need nfsv4shell & server support on BADFH\n"
  65 
  66 
  67 # h: Setattr with WrongSec, expect WRONGSEC
  68 set expcode "WRONGSEC"
  69 set ASSERTION "Setattr with WrongSec, expect $expcode"
  70 set tag "$TNAME{h}"
  71 #putmsg stdout 0 "$tag: $ASSERTION"
  72 #puts "\t Test UNTESTED: XXX need support on file-change-Sec on-the-fly.\n"
  73 
  74 
  75 # i: XXX how do we simulate some server errors:
  76 #       NFS4ERR_IO
  77 #       NFS4ERR_MOVE
  78 #       NFS4ERR_SERVERFAULT
  79 #       NFS4ERR_RESOURCE
  80 
  81 
  82 # m: try to Setattr of expired FH, expect FHEXPIRED
  83 set expcode "FHEXPIRED"
  84 set ASSERTION "Setattr an expired FH, expect $expcode"
  85 set tag "$TNAME{m}"
  86 #putmsg stdout 0 "$tag: $ASSERTION"
  87 #puts "\t Test UNTESTED: XXX need hook for FH to expire\n"
  88 
  89 
  90 # o: try to Setattr with DELAY response, expect DELAY
  91 set expcode "DELAY"
  92 set ASSERTION "Setattr with DELAY response, expect $expcode"
  93 set tag "$TNAME{o}"
  94 putmsg stdout 0 "$tag: $ASSERTION"
  95 #puts "\t Test UNTESTED: XXX need server support on this?\n"
  96 
  97 
  98 # --------------------------------------------------------------
  99 # disconnect and exit
 100 Disconnect
 101 exit $PASS