OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [net-common-interactive-tests.html] - Blame information for rev 300

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 unneback
<!-- 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.               -->
9
<HTML
10
><HEAD
11
><TITLE
12
>Interactive Tests</TITLE
13
><meta name="MSSmartTagsPreventParsing" content="TRUE">
14
<META
15
NAME="GENERATOR"
16
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17
"><LINK
18
REL="HOME"
19
TITLE="eCos Reference Manual"
20
HREF="ecos-ref.html"><LINK
21
REL="UP"
22
TITLE="Tests and Demonstrations"
23
HREF="net-common-tests-and-demonstrations.html"><LINK
24
REL="PREVIOUS"
25
TITLE="Performance Test"
26
HREF="net-common-performance-test.html"><LINK
27
REL="NEXT"
28
TITLE="Maintenance Tools "
29
HREF="net-common-maintenance-tools.html"></HEAD
30
><BODY
31
CLASS="SECT1"
32
BGCOLOR="#FFFFFF"
33
TEXT="#000000"
34
LINK="#0000FF"
35
VLINK="#840084"
36
ALINK="#0000FF"
37
><DIV
38
CLASS="NAVHEADER"
39
><TABLE
40
SUMMARY="Header navigation table"
41
WIDTH="100%"
42
BORDER="0"
43
CELLPADDING="0"
44
CELLSPACING="0"
45
><TR
46
><TH
47
COLSPAN="3"
48
ALIGN="center"
49
>eCos Reference Manual</TH
50
></TR
51
><TR
52
><TD
53
WIDTH="10%"
54
ALIGN="left"
55
VALIGN="bottom"
56
><A
57
HREF="net-common-performance-test.html"
58
ACCESSKEY="P"
59
>Prev</A
60
></TD
61
><TD
62
WIDTH="80%"
63
ALIGN="center"
64
VALIGN="bottom"
65
>Chapter 36. Tests and Demonstrations</TD
66
><TD
67
WIDTH="10%"
68
ALIGN="right"
69
VALIGN="bottom"
70
><A
71
HREF="net-common-maintenance-tools.html"
72
ACCESSKEY="N"
73
>Next</A
74
></TD
75
></TR
76
></TABLE
77
><HR
78
ALIGN="LEFT"
79
WIDTH="100%"></DIV
80
><DIV
81
CLASS="SECT1"
82
><H1
83
CLASS="SECT1"
84
><A
85
NAME="NET-COMMON-INTERACTIVE-TESTS">Interactive Tests</H1
86
><TABLE
87
BORDER="5"
88
BGCOLOR="#E0E0F0"
89
WIDTH="70%"
90
><TR
91
><TD
92
><PRE
93
CLASS="PROGRAMLISTING"
94
><SPAN
95
CLASS="emphasis"
96
><I
97
CLASS="EMPHASIS"
98
>server_test</I
99
></SPAN
100
> - a very simple server example</PRE
101
></TD
102
></TR
103
></TABLE
104
><P
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)
107
and prints it. </P
108
><P
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
112
><TABLE
113
BORDER="5"
114
BGCOLOR="#E0E0F0"
115
WIDTH="70%"
116
><TR
117
><TD
118
><PRE
119
CLASS="SCREEN"
120
>% telnet 172.16.19.171 7734
121
Hello target board</PRE
122
></TD
123
></TR
124
></TABLE
125
><P
126
>and the test program will print something like:</P
127
><TABLE
128
BORDER="5"
129
BGCOLOR="#E0E0F0"
130
WIDTH="70%"
131
><TR
132
><TD
133
><PRE
134
CLASS="SCREEN"
135
>connection from 172.16.19.13:3369
136
buf = "Hello target board"</PRE
137
></TD
138
></TR
139
></TABLE
140
><TABLE
141
BORDER="5"
142
BGCOLOR="#E0E0F0"
143
WIDTH="70%"
144
><TR
145
><TD
146
><PRE
147
CLASS="PROGRAMLISTING"
148
><SPAN
149
CLASS="emphasis"
150
><I
151
CLASS="EMPHASIS"
152
>ga_server_test</I
153
></SPAN
154
> - another very simple server example</PRE
155
></TD
156
></TR
157
></TABLE
158
><P
159
>This is a variation on the <SPAN
160
CLASS="emphasis"
161
><I
162
CLASS="EMPHASIS"
163
>ga_server_test</I
164
></SPAN
165
> test
166
with the difference being that it uses the <TT
167
CLASS="FUNCTION"
168
>getaddrinfo</TT
169
>
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
172
><TABLE
173
BORDER="5"
174
BGCOLOR="#E0E0F0"
175
WIDTH="70%"
176
><TR
177
><TD
178
><PRE
179
CLASS="PROGRAMLISTING"
180
><SPAN
181
CLASS="emphasis"
182
><I
183
CLASS="EMPHASIS"
184
>tftp_client_test</I
185
></SPAN
186
> - performs a tftp get and put from/to &#8220;server&#8221;</PRE
187
></TD
188
></TR
189
></TABLE
190
><P
191
>This is only partially interactive.  You need to set things
192
up on the &#8220;server&#8221; in order for this to work,
193
and you will need to look at the server afterwards to confirm that all
194
was well.</P
195
><P
196
>For each interface in turn, this test attempts to read by
197
tftp from the server, a file called
198
<TT
199
CLASS="FILENAME"
200
>tftp_get</TT
201
>
202
and
203
prints the status and contents it read (if any).  It then writes
204
the same data to a file called
205
<TT
206
CLASS="FILENAME"
207
>tftp_put</TT
208
>
209
on
210
the same server.</P
211
><P
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
218
><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
222
<TT
223
CLASS="FILENAME"
224
>tftp_get</TT
225
>
226
can
227
be anything you like, but anything very large will waste lots of
228
time printing it on the test&#8217;s stdout, and anything above
229
32kB will cause a buffer overflow and unpredictable failure.</P
230
><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
233
like:</P
234
><TABLE
235
BORDER="5"
236
BGCOLOR="#E0E0F0"
237
WIDTH="70%"
238
><TR
239
><TD
240
><PRE
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
244
></TD
245
></TR
246
></TABLE
247
><P
248
>note that both files have public permissions wide open.  After
249
running the test,
250
<TT
251
CLASS="FILENAME"
252
>tftp_put</TT
253
>
254
should
255
be a copy of
256
<TT
257
CLASS="FILENAME"
258
>tftp_get</TT
259
>.</P
260
><TABLE
261
BORDER="5"
262
BGCOLOR="#E0E0F0"
263
WIDTH="70%"
264
><TR
265
><TD
266
><PRE
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&#13;</PRE
270
></TD
271
></TR
272
></TABLE
273
><TABLE
274
BORDER="5"
275
BGCOLOR="#E0E0F0"
276
WIDTH="70%"
277
><TR
278
><TD
279
><PRE
280
CLASS="PROGRAMLISTING"
281
><SPAN
282
CLASS="emphasis"
283
><I
284
CLASS="EMPHASIS"
285
>tftp_server_test</I
286
></SPAN
287
> - runs a tftp server for a short while</PRE
288
></TD
289
></TR
290
></TABLE
291
><P
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 &#8220;uu&#8221; 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
300
><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
304
><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 &#8220;uu&#8221; 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
311
></DIV
312
><DIV
313
CLASS="NAVFOOTER"
314
><HR
315
ALIGN="LEFT"
316
WIDTH="100%"><TABLE
317
SUMMARY="Footer navigation table"
318
WIDTH="100%"
319
BORDER="0"
320
CELLPADDING="0"
321
CELLSPACING="0"
322
><TR
323
><TD
324
WIDTH="33%"
325
ALIGN="left"
326
VALIGN="top"
327
><A
328
HREF="net-common-performance-test.html"
329
ACCESSKEY="P"
330
>Prev</A
331
></TD
332
><TD
333
WIDTH="34%"
334
ALIGN="center"
335
VALIGN="top"
336
><A
337
HREF="ecos-ref.html"
338
ACCESSKEY="H"
339
>Home</A
340
></TD
341
><TD
342
WIDTH="33%"
343
ALIGN="right"
344
VALIGN="top"
345
><A
346
HREF="net-common-maintenance-tools.html"
347
ACCESSKEY="N"
348
>Next</A
349
></TD
350
></TR
351
><TR
352
><TD
353
WIDTH="33%"
354
ALIGN="left"
355
VALIGN="top"
356
>Performance Test</TD
357
><TD
358
WIDTH="34%"
359
ALIGN="center"
360
VALIGN="top"
361
><A
362
HREF="net-common-tests-and-demonstrations.html"
363
ACCESSKEY="U"
364
>Up</A
365
></TD
366
><TD
367
WIDTH="33%"
368
ALIGN="right"
369
VALIGN="top"
370
>Maintenance Tools</TD
371
></TR
372
></TABLE
373
></DIV
374
></BODY
375
></HTML
376
>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.