Test Programs


FTP Server Test Programs -- describe the test programs and their host-side support

Test Programs

There are three test programs in the tests subdirectory of this package that exercise the FTP server and do duty as examples of its use. These are supported by an eCos configuration and expect scripts in the misc subdirectory which call the standard linux ftp client to exercise the FTP server.

To build an eCos library suitably configured to support the test programs, import the ftpserver.ecm minimal configuration located in the misc subdirectory of this package (at packages/net/ftpserver/VERSION within your eCos package repository) into your target configuration. This minimal configuration loads the CYGPKG_NET, CYGPKG_IO, CYGPKG_NET_FTPSERVER and CYGPKG_FS_RAM packages, enables the building of the test programs as well as increases the sizes of CYGPKG_NET_MAXSOCKETS, CYGNUM_FILEIO_NFILE and CYGNUM_FILEIO_NFD from their default values to values large enough to allow the test scripts to operate in a reasonable amount of time.

When each test program is executed it will output on either the gdb console, or a debug channel, the filename of a corresponding expect script to be executed on your development PC, along with any additional parameters to provide the script. This expect script is used to exercise each FTP server test application. The script name and parameter will be contained within angle braces prefixed by CMD:. Each script can be executed on a suitable Linux host which has expect and the standard Linux text-mode ftp client installed and on the PATH. For example, the output below suggests that the script ftpserver1.exp is executed with the argument

   INFO:<Create file1>
   INFO:<Start FTP server> 

These scripts are located within the misc subdirectory of the FTP server package and on its completion will terminate the ftp test program on the target.

Note: All tests can be stopped manually by logging onto the target platform running the test with a standard ftp client using the user ID "shutdown" and password "now".


The ftpserver1.c test creates a default FTP server using the RAM filesystem. A default file, file1, is created that can be retrieved, and further files can be uploaded, retrieved or overwritten.


The ftpserver2.c test uses the callback interface to serve files in memory. It creates a read-only file, text, and a 32KB read/write buffer, buffer.


The ftpserver3.c test is identical to ftpserver1.c except that it expects a specific user and password, "test" and "barnwell", to be supplied before it permits access.

Documentation license for this page: eCosPro License