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 #
28 # a: Test get attr FATTR4_SYSTEM to determine if system file, expect OK
29 # (NOT SUPPORTED IN NFSv4 on UFS(Unix Filesystem))
30 #
31
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 expcode "OK"
45
46 # Get testfile pathname
47 set bfh [get_fh "$BASEDIRS"]
48
49 # Start testing
50 # ---------------------------------------------------------------
51 # a:Test get attr FATTR4_SYSTEM to determine if system file, expect OK
52 # NOT SUPPORTED in NFSv4 on UFS
53
54 set ASSERTION "Test get attr FATTR4_SYSTEM to determine if system file, expect OK"
55 putmsg stdout 0 "$TNAME{a}: $ASSERTION"
56
57 # Set expected constant value reponse from server
58 set expval $env(SYSTEM)
59
60 # Get a list of the supported attributes
61 set attr {supported_attrs}
62 set res [compound { Putfh $bfh; Lookup $env(TEXTFILE); Getfh; Getattr $attr }]
63 set cont [ckres "Getattr" $status $expcode $res $FAIL]
64
65 if { ![string equal $cont "false"] } {
66
67 # Create supported_attr list
68 set alist [lindex [lindex $res 3] 2]
69 foreach attrval $alist {
70 set val [lindex $attrval 1]
71 set list [split $val]
72 putmsg stdout 1 "val on alist is $val"
73 putmsg stdout 1 "split list is $list"
74 }
75
76 # Set attr for testing purposes
77 set attr {system}
78
79 #Get the filehandle of the test file
80 set res2 [compound {
81 Putfh $bfh;
82 Lookup $env(TEXTFILE);
83 Getfh;
84 Getattr $attr
85 }]
86 set cont2 [ckres "Getattr" $status $expcode $res2 $FAIL]
87
88 if { ![string equal $cont2 "false"] } {
89
90 set fh [lindex [lindex $res2 2] 2]
91 set attrval [ extract_attr [lindex [lindex $res2 3] 2] $attr ]
92
93 # Verify attr not in supported_attr list
94 if { [ lsearch -exact $list $attr ] < 0 } {
95 putmsg stdout 0 "\t Test PASS: system attr not supported on UFS"
96 } else {
97 putmsg stdout 0 "\t Test FAIL: unexpected $attr in supported attr list"
98 }
99 }
100
101 }
102
103 puts ""
104
105 Disconnect
106 exit $PASS