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 LOOKUPP operation test - negative tests
  27 
  28 # include all test enironment
  29 source LOOKUPP.env
  30 
  31 # connect to the test server
  32 Connect
  33 
  34 # setting local variables
  35 set TNAME $argv0
  36 
  37 # local proc trying to send the bad request and to check error returned
  38 proc ckerrs { tn dir exp mesg rc } {
  39     global TNAME
  40     global DEBUG
  41     putmsg stdout 0 "$TNAME{$tn}: Lookupp $mesg, expect $exp"
  42     set res [compound {Putrootfh; foreach c $dir {Lookup $c}; Lookupp}]
  43     ckres "Lookupp" $status $exp $res $rc
  44 }
  45 
  46 # Start testing
  47 # --------------------------------------------------------------
  48 # a: lookupp from a file-fh - expect NOTDIR
  49 set tfile $env(TEXTFILE)
  50 ckerrs "a" "$BASEDIRS $tfile" "NOTDIR" "from a file-fh" $PASS
  51 
  52 
  53 # b: lookupp from a symlink-fh - expect NOTDIR
  54 set symd $env(SYMLDIR)
  55 ckerrs "b" "$BASEDIRS $symd" "NOTDIR" "from symlink-dir" $PASS
  56 
  57 
  58 # c: lookupp from an none-reg-fh - expect NOTDIR
  59 ckerrs "c" "$BASEDIRS $env(ZIPFILE)" "NOTDIR" "from none-reg-fh" $PASS
  60 
  61 
  62 # d: lookupp from a noperm dir-fh - expect NOTDIR
  63 set dnoperm $env(DNOPERM)
  64 ckerrs "d" "$BASEDIRS $dnoperm" "ACCESS" "from noperm dir-fh" $PASS
  65 
  66 
  67 # f: lookupp at top of root-tree, expect NOENT
  68 set expcode NOENT
  69 set ASSERTION "Lookupp at the top of root-tree, expect $expcode"
  70 putmsg stdout 0 "$TNAME{f}: $ASSERTION"
  71 set res [compound {Putrootfh; Lookupp}]
  72 ckres "Lookupp" $status $expcode $res $PASS
  73 
  74 
  75 # g: lookupp without putrootfh, expect NOFILEHANDLE
  76 set expcode NOFILEHANDLE
  77 set ASSERTION "Lookupp without putrootfh, expect $expcode"
  78 putmsg stdout 0 "$TNAME{g}: $ASSERTION"
  79 set res [compound {Lookupp}]
  80 ckres "Lookupp" $status $expcode $res $PASS
  81 
  82 
  83 # --------------------------------------------------------------
  84 # disconnect and exit
  85 Disconnect
  86 exit $PASS