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 # Test NFSv4 numbered attributes:(Not supported in NFSv4 in EA on UFS)
27 # UFS(Unix Filesystem)
28 # {a}:Test setattr FATTR4_ARCHIVE, expect ATTRNOTSUPP
29 #
30
31 # Get the TESTROOT directory; set to '.' if not defined
32 set TESTROOT $env(TESTROOT)
33 set delm $env(DELM)
34
35 # include common code and init section
36 source ${TESTROOT}${delm}tcl.init
37 source ${TESTROOT}${delm}testproc
38
39 # connect to the test server
40 Connect
41
42 # setting local variables
43 set TNAME $argv0
44 set bfh [get_fh "$BASEDIRS"]
45 set expcode "ATTRNOTSUPP"
46
47 # Create a new file for testing purposes
48 set filename "newfile.[pid]"
49 set tfile "[creatv4_file "$BASEDIR/$filename"]"
50
51 set sid {0 0}
52
53 set addtofile "[write_ascii $tfile $sid "This is just a test"]"
54
55 # Start testing
56 # -----------------------------------------------------------------
57 # a :Test set attr FATTR4_ARCHIVE of a filesystem, expect $expcode
58
59 set ASSERTION "Test set attr FATTR4_ARCHIVE of a filesystem, expect $expcode
60 "
61 putmsg stdout 0 "$TNAME{a}: $ASSERTION"
62
63 set sid {0 0}
64 # Attempt Setattr of unsupported archive attr
65 set attr {archive}
66 set attrval "true"
67 set res [compound { Putfh $bfh; Lookup $filename; Getfh; Setattr $sid {{archive {$attrval}}} }]
68 ckres "Setattr" $status $expcode $res $PASS
69
70 puts ""
71
72 set res [compound {Putfh $bfh; Remove $filename}]
73 if {$status != "OK"} {
74 puts "ERROR, compound{} return status=$status"
75 exit 1
76 }
77
78 Disconnect
79 exit $PASS