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 numbered attributes:
  27 # UFS(Unix Filesystem)
  28 # a: Test set attr FATTR4_HIDDEN return ATTRNOTSUPP for UFS, expect OK 
  29 #
  30 
  31 set TESTROOT $env(TESTROOT)
  32 set delm $env(DELM)
  33 
  34 # include common code and init section
  35 source ${TESTROOT}${delm}tcl.init
  36 source ${TESTROOT}${delm}testproc
  37 
  38 # connect to the test server
  39 Connect
  40 
  41 # setting local variables
  42 set TNAME $argv0
  43 set expcode "ATTRNOTSUPP"
  44 
  45 # Get testfile pathname
  46 set filename "newfile.[pid]"
  47 set tfile "[creatv4_file "$BASEDIR/$filename" 777]"
  48 
  49 # Get testfile pathname
  50 set bfh [get_fh "$BASEDIRS"]
  51 
  52 # Start testing
  53 # ---------------------------------------------------------------
  54 #a: Test set attr FATTR4_HIDDEN return ATTRNOTSUPP for UFS; return true for WIN32, expect $expcode 
  55 
  56 set ASSERTION "Test set attr FATTR4_HIDDEN return ATTRNOTSUPP for UFS, expect $expcode"
  57 putmsg stdout 0 "$TNAME{a}: $ASSERTION"
  58 
  59 set sid {0 0}
  60 
  61 # Setup testfile for attribute purposes
  62 set attr {hidden}
  63 set attrval "true"
  64 
  65 #Get the filehandle of the test file 
  66 set res2 [compound {
  67         Putfh $bfh;
  68         Lookup $filename;
  69         Getfh;
  70         Setattr $sid {{hidden {$attrval}}} 
  71 }]
  72 ckres "Setattr" $status $expcode $res2 $PASS 
  73 
  74 puts ""
  75 
  76 set res2 [compound {Putfh $bfh; Remove $filename}]
  77 if {$status != "OK"} {
  78     puts "ERROR, compound{} return status=$status"
  79     exit 1
  80 }
  81 
  82 
  83 Disconnect 
  84 exit $PASS