⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net-common-interactive-tests.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Interactive Tests</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="Tests and Demonstrations"HREF="net-common-tests-and-demonstrations.html"><LINKREL="PREVIOUS"TITLE="Performance Test"HREF="net-common-performance-test.html"><LINKREL="NEXT"TITLE="Maintenance Tools "HREF="net-common-maintenance-tools.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="net-common-performance-test.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 36. Tests and Demonstrations</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="net-common-maintenance-tools.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="NET-COMMON-INTERACTIVE-TESTS">Interactive Tests</H1><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">server_test</I></SPAN> - a very simple server example</PRE></TD></TR></TABLE><P>This test simply awaits a connection on port 7734 and afteraccepting a connection, gets a packet (with a timeout of a few seconds)and prints it. </P><P>The connection is then closed. We then loop to await the nextconnection, and so on. To use it, telnet to the target on port 7734then type something (quickly!)</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">% telnet 172.16.19.171 7734 Hello target board</PRE></TD></TR></TABLE><P>and the test program will print something like:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">connection from 172.16.19.13:3369 buf = "Hello target board"</PRE></TD></TR></TABLE><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">ga_server_test</I></SPAN> - another very simple server example</PRE></TD></TR></TABLE><P>This is a variation on the <SPANCLASS="emphasis"><ICLASS="EMPHASIS">ga_server_test</I></SPAN> testwith the difference being that it uses the <TTCLASS="FUNCTION">getaddrinfo</TT>function to set up its addresses.  On a system with IPv6 enabled, it willlisten on port 7734 for a TCP connection via either IPv4 or IPv6.</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">tftp_client_test</I></SPAN> - performs a tftp get and put from/to &#8220;server&#8221;</PRE></TD></TR></TABLE><P>This is only partially interactive.  You need to set thingsup on the &#8220;server&#8221; in order for this to work,and you will need to look at the server afterwards to confirm that allwas well.</P><P>For each interface in turn, this test attempts to read bytftp from the server, a file called<TTCLASS="FILENAME">tftp_get</TT>andprints the status and contents it read (if any).  It then writesthe same data to a file called<TTCLASS="FILENAME">tftp_put</TT>onthe same server.</P><P>In order for this to succeed, both files must already exist. The TFTP protocol does not require that a WRQ request _create_ afile, just that it can write it.  The TFTP server on Linux certainlywill only allow writes to an existing file, given the appropriatepermission.  Thus, you need to have these files in place, with proper permission,before running the test.</P><P>The conventional place for the tftp server to operate in LINUXis /tftpboot/; you will likely need root privilegesto create files there. The data contents of<TTCLASS="FILENAME">tftp_get</TT>canbe anything you like, but anything very large will waste lots oftime printing it on the test&#8217;s stdout, and anything above32kB will cause a buffer overflow and unpredictable failure.</P><P>Creating an empty tftp_put file (eg. by copying /dev/nullto it) is neatest.  So before the test you should have somethinglike:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">-rw-rw-rw- 1 root        1076 May  1 11:39 tftp_get-rw-rw-rw- 1 root        0 May  1 15:52 tftp_put </PRE></TD></TR></TABLE><P>note that both files have public permissions wide open.  Afterrunning the test,<TTCLASS="FILENAME">tftp_put</TT>shouldbe a copy of<TTCLASS="FILENAME">tftp_get</TT>.</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">-rw-rw-rw-  1 root       1076 May  1 11:39 tftp_get-rw-rw-rw-  1 root       1076 May  1 15:52 tftp_put&#13;</PRE></TD></TR></TABLE><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">tftp_server_test</I></SPAN> - runs a tftp server for a short while</PRE></TD></TR></TABLE><P>This test is truly interactive, in that you can use a standardtftp application to get and put files from the server, during the5 minutes that it runs.  The dummy filesystem which underlies theserver initially contains one file, called &#8220;uu&#8221; which containspart of a familiar text and some padding.  It also accommodatescreation of 3 further files of up to 1Mb in size and names of upto 256 bytes.  Exceeding these limits will cause a buffer overflowand unpredictable failure.</P><P>The dummy filesystem is an implementation of the generic APIwhich allows a true filesystem to be attached to the tftp serverin the network stack.</P><P>We have been testing the tftp server by running the test onthe target board, then using two different host computers connectingto the different target interfaces, putting a file from each, gettingthe &#8220;uu&#8221; file, and getting the file from the other computer. This verifies that data is preserved during the transfer as wellas interworking with standard tftp applications.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="net-common-performance-test.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="net-common-maintenance-tools.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Performance Test</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="net-common-tests-and-demonstrations.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Maintenance Tools</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -