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 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26 # ident "@(#)README 1.6 09/03/04 SMI"
27 #
28
29 Solaris NIC Driver Test Suite
30
31 ################################################################################
32 ## Overview
33 ################################################################################
34
35 This (nicdrv) is a test suite designed to test Network Interface Card drivers.
36 This test suite uses the STF test harness and operates in the standard manner.
37 Brief instructions follow on how to interact with this test suite.
38
39 1. Operation Modes:
40
41 This test suite has two modes of operation:
42 standalone,
43 two-host (most of the tests)
44
45
46 2. Test Cases Included:
47
48 (1) functional: used to ensure that a NIC driver works properly, to
49 test the primary functionality of a NIC driver, including FTP,
50 netperf+snoop, ping, NFS, ip_multicast, setting of ndd parameters,
51 working-mode testing, statistics, vlan, and link aggregation.
52
53 (2) stress: used to stress a NIC driver to verify the driver's
54 stability, including loading and unloading of the driver module
55 and net traffic stress.
56
57 The "doc/nicdrv.assert" file documents the assertion verified by each
58 test case.
59
60
61 3. Directory Organization:
62 nicdrv/ -+--- doc: test assertions and other docs
63 |
64 +--- include: common libs that are included in test code
65 |
66 +--- tests: test code
67 |
68 +--- tools: common tools that are called by test code
69
70
71 4. For some planned features and known issues, please refer to the ReleaseNote
72 file in the "doc" directory.
73
74 #############################################################
75 ## Hardware requirements
76 #############################################################
77 Two machines, consisting of one server and one client are required.
78 The server is the DUT (Device Under Test) and the client is the SAP
79 (System As Peer).
80
81 * The client should have faster CPU and larger memory size
82 than Server. (It will give Server a bigger stress.)
83
84 * If possible, each machine can have two NIC cards of different types:
85
86 One interface (NIC1) on the server is the test target, which is directly
87 connected to the client. If the NICs don't support mdi/mdix, cross-over
88 cables should be used.
89
90 Another interface (NIC0) is connected with external network for command
91 control. You can also use the system console for this purpose.
92
93 A conceptual picture of the test setup is below:
94
95 +----------------+ +-------------+
96 | | command control | |
97 | Server (NIC0)-|<---------external network-------->| Client |
98 | | | |
99 | (DUT) (NIC1)-|<---------tested network---------->| |
100 +----------------+ NIC under test +-------------+
101
102 NIC1 is the network interface under test.
103
104
105 * If the server and client interfaces under test are connected through a
106 network switch with VLAN supported, the VLAN test case of this test
107 suite requires configuring the two ports on the switch into the
108 following VLAN: 30,31,32,33,34,35,36,37,38,39. If the switch does not
109 support VLAN, it must be configured to broadcast mode for VLAN.
110
111 Please refer to the user guide of the switch to configure VLAN.
112
113 #############################################################
114 ## Software requirements
115 #############################################################
116
117 * You should have installed Solaris and driver binaries successfully on
118 both machines. Ensure the driver under test has the correct version.
119
120 * This test suite should be run as the root user. During test execution,
121 the NIC driver under test will be 'removed,' so if all of the NICs on
122 the system are associated with the same type of driver, please use
123 the console to run the test, because the network may be disconnected.
124
125 * Download and install Solaris Test Framework (STF) packages on server.
126 http://opensolaris.org/os/community/testing/testsuites/stf/
127
128 root# pkgadd -d <package-location> SUNWstc-checkenv
129 root# pkgadd -d <package-location> SUNWstc-stf
130
131 * Install netperf on server.
132
133 For Sun internal users, install the SUNWstc-netperf2 package.
134 root# pkgadd -d <package-location> SUNWstc-netperf2
135
136 For external users, install netperf from http://www.netperf.org.
137 For instructions on how to build netperf, please refer to the
138 INSTALL file in netperf directory. The recommended netperf
139 version to use for this test suite is 2.4.0
140
141 * Set env for root user on server
142
143 root# PATH=/usr/ccs/bin:/opt/SUNWstc-stf/bin/`isainfo -n`:$PATH;
144 root# export PATH
145
146 * The server and client should be able to use rsh to access each
147 other by root, and they should also be able to ping each other
148 by hostname. To set this up,
149
150 . Modify the ~root/.rhosts as applicable, e.g. add
151 "<peer's ip_address> root"
152 or "<peer's hostname> root"
153 to the ~root/.rhosts file.
154
155 (Security warning: if you simply put a "+" in the ~root/.rhosts file,
156 it means "every user from every machine" is authorized to rsh-in as
157 'root'. Please use caution when making this entry in the .rhosts.)
158
159 . On both server and client side, enable this network service:
160 root# svcadm enable -r -s svc:/network/shell:default
161
162 . Append the hostname and corresponding IP address of client or server to the
163 /etc/hosts file.
164
165 * Ensure the nwam service is disabled on both server and client side.
166
167 root# svcadm disable svc:/network/physical:nwam
168 root# svcadm enable svc:/network/physical:default
169
170 * Ensure that the default system locale on both client and server are C, You
171 can change the default system locale by setting LANG=C in /etc/default/init
172 file.
173
174 #############################################################
175 ## How to Run:
176 #############################################################
177
178 1: Install or build nicdrv test suite
179
180 You can run the nicdrv test suite either from a binary package or the
181 source workspace. The following shows how to install the nicdrv package.
182 If a package is not available, see Appendix A for instructions on how
183 to build the nicdrv test suite.
184
185 * Install NICDRV package.
186
187 root# pkgadd -d <package-location> SUNWstc-driver-nicdrv
188
189 * Change to <SUITE_ROOT> directory where the NICDRV package is installed.
190
191 root# cd /opt/SUNWstc-driver-nicdrv
192
193 2: Check if the client has different architecture from the server.
194 root# isainfo -n
195
196 Beginning with version 1.7 of the test suite, it is now possible
197 to perform cross-platform testing by simply installing the test
198 suite packages for both SPARC and x86 architectures directly on
199 the 'server' machine.
200
201 Generally, the server and the client have the same CPU architecture
202 (i.e., both are X86 or SPARC). However, for cross-platform testing,
203 where the server's CPU architecture is different from the client's,
204 it is necessary to install the test suite binaries corresponding to
205 both architectures on the server system. Beginning with STC_VERSION
206 1.7, it is possible to install both SPARC and x86 packages on a
207 single system using pkgadd(1M). For example, if the client is an
208 amd64 system and the server is a SPARC machine, then install both
209 the sparc and i386 packages on the server:
210
211 root@server# pkgadd -d <sparc-package-location> SUNWstc-driver-nicdrv
212 root@server# pkgadd -d <i386-package-location> SUNWstc-driver-nicdrv
213
214 3: Configure test suites
215 Please set the appropriate values for the mandatory variables
216 specified in <SUITE_ROOT>/config.vars using 'stf_configure -c'
217 or 'stf_configure -f'
218
219 The following options need to be changed:
220
221 TST_INT=
222 TST_NUM=
223 RMT_INT=
224 RMT_NUM=
225 LOCAL_HST=
226 RMT_HST=
227 TST_PASS=
228 NETPERF_HOME=
229 RUN_MODE=
230
231 For details on the options listed above, please refer to comments of
232 the config.vars file.
233
234 In the <SUITE_ROOT> directory, run:
235 user$ stf_configure
236
237 4: Execute the test suites still in the <SUITE_ROOT> directory
238
239 user$ stf_execute -m `isainfo -n`
240
241 5: Examine the results
242 While the test is being executed, you can view the journal file at:
243 /var/tmp/SUNstc-driver-nicdrv/results, for example
244 "tail -f /var/tmp/SUNWstc-driver-nicdrv/results/journal.hostname1.20070821185114.execute.i386"
245 (The exact name of the journal file being used will be printed to
246 the terminal by 'stf_execute')
247
248 Appendix A:
249
250 #############################################################
251 ## How to Build Test Suite
252 #############################################################
253
254 * Add C compiler and STF path to environment.
255
256 user$ PATH=/opt/SUNWspro/bin:/opt/SUNWstc-stf/bin/`isainfo -n`:$PATH;
257 user$ export PATH
258
259 * Change to nicdrv source directory. Below, WS_ROOT refers to the
260 root of the STC workspace which contains the nicdrv test suite source.
261
262 user$ cd <WS_ROOT>/usr/src/suites/net/nicdrv
263
264 * Build the nicdrv test suite.
265
266 user$ stf_build package
267
268 * Install the package on the test system(s)
269
270 root# pkgadd -d <WS_ROOT>/packages/`uname -p` SUNWstc-driver-nicdrv
271
272 Now you can follow the instructions given earlier in this README for
273 configuring and executing the test suite.
274
275