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 NVERIFY operation test - negative tests
  27 #       verify SERVER returned NFSERR_SAME in different cases
  28 
  29 # include all test enironment
  30 source NVERIFY.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 set req_attrs "type fh_expire_type change size link_support
  39     symlink_support named_attr fsid unique_handles lease_time"
  40 
  41 # Start testing
  42 # --------------------------------------------------------------
  43 # a: Nverify a file with same supported attrs, expect SAME
  44 set expcode "SAME"
  45 set ASSERTION "Nverify a file with same supported attrs, expect $expcode"
  46 set tag "$TNAME{a}"
  47 putmsg stdout 0 "$tag: $ASSERTION"
  48 set res [compound {Putfh $bfh; Lookup $env(ZIPFILE); Getattr "$req_attrs"}]
  49 set cont [ckres "Getattr" $status "OK" $res $FAIL]
  50 # Nverify all attr returned from Getattr
  51   if {! [string equal $cont "false"]} {
  52         set attrl [lindex [lindex $res 2] 2]
  53         # do a nverify on these attributes
  54         set res [compound {Putfh $bfh; Lookup $env(ZIPFILE); Getfh;
  55                 Nverify {$attrl}; Getfh}]
  56         ckres "Nverify" $status $expcode $res $PASS
  57   }
  58 
  59 
  60 # b: Nverify a symlink with same other attrs, expect SAME
  61 set expcode "SAME"
  62 set ASSERTION "Nverify a symlink with same other attrs, expect $expcode"
  63 set tag "$TNAME{b}"
  64 putmsg stdout 0 "$tag: $ASSERTION"
  65 set ckl "type size cansettime chown_restricted fileid files_avail files_free
  66         files_total homogeneous maxfilesize maxlink maxname maxread maxwrite 
  67         mode no_trunc numlinks owner owner_group"
  68 set res [compound {Putfh $bfh; Lookup $env(SYMLDIR); Getattr "$ckl"}]
  69 set cont [ckres "Getattr" $status "OK" $res $FAIL]
  70 # Nverify all attr returned from Getattr
  71   if {! [string equal $cont "false"]} {
  72         set attrl [lindex [lindex $res 2] 2]
  73         # do a nverify on these attributes
  74         set res [compound {Putfh $bfh; Lookup $env(SYMLDIR); Getfh;
  75                 Nverify {$attrl}; Getfh}]
  76         ckres "Nverify" $status $expcode $res $PASS
  77   }
  78 
  79 # --------------------------------------------------------------
  80 # disconnect and exit
  81 Disconnect
  82 exit $PASS