These files are located in the directory: ~hollingd/public.html/netprog/hw/hw2/testcode on any of the CS Suns. The perl script test.pl is the main test suite. For each of the tests it starts up a fresh copy of the proxy (using a random port number), and run the testclient program. test.pl checks for appropriate output from the test client, looks for zombies and memory leaks, etc. This script include path specific stuff, (so if you make a copy you should look at the configuration settings at the top of test.pl). Note there are some machine dependant things in this script, for example the path to the "ps" command, etc. ------------------------------------------- Scriptable test client for project 2. This is a perl program that interprets a small script language suitable for testing project 2 (proxy web servers). The perl program is call "testclient" and the command line arguments are: hostname port_number script_file the hostname and port_number identify the proxy server that will be tested and the script_file contains a series of commands that will control the testing. The script language includes the following commands (case is not important): # CONNECT : establish a connection to the proxy server # (forces a close as well) # SEND string : send the specified string # CLOSE : close the TCP socket the proxy # READLINE : read one line from proxy and toss away # READALL : read from proxy until EOF (tossing away) # SAVEALL file : read from proxy until EOF and save in file # SAVECONTENT : skip headers and save content in file # ECHOLINE : read one line from proxy and print # ECHOALL : read from proxy until EOF and print # EXPECT file : read from proxy until EOF and compare to a file # EXPECTCONTENT file : read from proxy, until EOF and compare to a file # tosses headers before comparing # PRINT string : print the string to STDOUT # EVAL string : eval the perl commandprint the string to STDOUT Each script file contains a series of these commands. The script files are in the directory "tests" Sample usage: Start the server: dishwasher.cs.rpi.edu> ./proxy 3333 In another window run the test script named "doc": eggbeater.cs.rpi.edu> ./testclient dishwasher 3333 tests/doc