1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Interactive Tests</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="Tests and Demonstrations"
23 HREF="net-common-tests-and-demonstrations.html"><LINK
25 TITLE="Performance Test"
26 HREF="net-common-performance-test.html"><LINK
28 TITLE="Maintenance Tools "
29 HREF="net-common-maintenance-tools.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-performance-test.html"
65 >Chapter 36. Tests and Demonstrations</TD
71 HREF="net-common-maintenance-tools.html"
85 NAME="NET-COMMON-INTERACTIVE-TESTS">Interactive Tests</H1
93 CLASS="PROGRAMLISTING"
100 > - a very simple server example</PRE
105 >This test simply awaits a connection on port 7734 and after
106 accepting a connection, gets a packet (with a timeout of a few seconds)
109 >The connection is then closed. We then loop to await the next
110 connection, and so on. To use it, telnet to the target on port 7734
111 then type something (quickly!)</P
120 >% telnet 172.16.19.171 7734
121 Hello target board</PRE
126 >and the test program will print something like:</P
135 >connection from 172.16.19.13:3369
136 buf = "Hello target board"</PRE
147 CLASS="PROGRAMLISTING"
154 > - another very simple server example</PRE
159 >This is a variation on the <SPAN
166 with the difference being that it uses the <TT
170 function to set up its addresses. On a system with IPv6 enabled, it will
171 listen on port 7734 for a TCP connection via either IPv4 or IPv6.</P
179 CLASS="PROGRAMLISTING"
186 > - performs a tftp get and put from/to “server”</PRE
191 >This is only partially interactive. You need to set things
192 up on the “server” in order for this to work,
193 and you will need to look at the server afterwards to confirm that all
196 >For each interface in turn, this test attempts to read by
197 tftp from the server, a file called
203 prints the status and contents it read (if any). It then writes
204 the same data to a file called
212 >In order for this to succeed, both files must already exist.
213 The TFTP protocol does not require that a WRQ request _create_ a
214 file, just that it can write it. The TFTP server on Linux certainly
215 will only allow writes to an existing file, given the appropriate
216 permission. Thus, you need to have these files in place, with proper permission,
217 before running the test.</P
219 >The conventional place for the tftp server to operate in LINUX
220 is /tftpboot/; you will likely need root privileges
221 to create files there. The data contents of
227 be anything you like, but anything very large will waste lots of
228 time printing it on the test’s stdout, and anything above
229 32kB will cause a buffer overflow and unpredictable failure.</P
231 >Creating an empty tftp_put file (eg. by copying /dev/null
232 to it) is neatest. So before the test you should have something
241 CLASS="PROGRAMLISTING"
242 >-rw-rw-rw- 1 root 1076 May 1 11:39 tftp_get
243 -rw-rw-rw- 1 root 0 May 1 15:52 tftp_put </PRE
248 >note that both files have public permissions wide open. After
267 CLASS="PROGRAMLISTING"
268 >-rw-rw-rw- 1 root 1076 May 1 11:39 tftp_get
269 -rw-rw-rw- 1 root 1076 May 1 15:52 tftp_put </PRE
280 CLASS="PROGRAMLISTING"
287 > - runs a tftp server for a short while</PRE
292 >This test is truly interactive, in that you can use a standard
293 tftp application to get and put files from the server, during the
294 5 minutes that it runs. The dummy filesystem which underlies the
295 server initially contains one file, called “uu” which contains
296 part of a familiar text and some padding. It also accommodates
297 creation of 3 further files of up to 1Mb in size and names of up
298 to 256 bytes. Exceeding these limits will cause a buffer overflow
299 and unpredictable failure.</P
301 >The dummy filesystem is an implementation of the generic API
302 which allows a true filesystem to be attached to the tftp server
303 in the network stack.</P
305 >We have been testing the tftp server by running the test on
306 the target board, then using two different host computers connecting
307 to the different target interfaces, putting a file from each, getting
308 the “uu” file, and getting the file from the other computer.
309 This verifies that data is preserved during the transfer as well
310 as interworking with standard tftp applications.</P
317 SUMMARY="Footer navigation table"
328 HREF="net-common-performance-test.html"
346 HREF="net-common-maintenance-tools.html"
356 >Performance Test</TD
362 HREF="net-common-tests-and-demonstrations.html"
370 >Maintenance Tools</TD