next up previous
Next: Review of first attempt Up: Automatic Regression testing of Previous: Testing Pluto

The first virtual attempt

Figure 5: NetJig interface diagram
\includegraphics[height=4in,width=5in]{single_netjig.eps}

User Mode Linux was used to help automate the tests. A user mode linux is built which contains the required code. A number of root file systems are prepared by ``make uml''. Each contain the configuration for a specific node in the network: east, west, sunrise, sunset, nic and japan.

The apparatus shown arranges to run one of these ``machines'' with inputs and outputs connected to sources of replayed data.

The network interfaces are managed by ``uml_netjig'' - a program that is a variation of User-Mode-Linux's uml_switch (formerly called uml_router). uml_netjig opens a pair of network sockets for each network interface, and then starts the expect script.

The TCL expect script shown, host-test.tcl, starts the User-Mode-Linux machine with options to have it boot into single user mode. This is done using the standard expect command ``spawn'' - the script can then interact with the sub-processes standard in and out. As User-Mode-Linux will connect stdin/stdout as the console of the machine, the script can control the virtual machine.

The first thing that the script does it configure the machine. The enclosing uml_netjig script is waiting for this script to exit. host-test.tcl sets up all of the required parameters, and then it calls fork(2).

The parent exits, while the child continues to manage the console. If the child were to exit, the virtual machine would have no console and it would be impossible to capture further output.

When the parent exits, the uml_netjig can then continue. It opens any files that it was been told to read, and plays the packets it finds back on the public or private interfaces. If told to, the uml_netjig process will answer any ARP requests that it sees.

In addition, it records any packets that are emitted by the process under test and stores them in a file.

When the last packet has been played, then uml_netjig assumes that the test is over, and exits. The enclosing script then arranges to shutdown the user-mode-linux process using uml_mconsole.

The enclosing script then converts the captured network files (written in libpcap format) to text using tcpdump, and compares that to a file of expected values.

The captured console output is also compared.

Both the libpcap and the console output files are first put through some scripts to canoncalize them. In the case of console output, this means removing things like date stamps, kernel versions, ... from the kernel boot messages. There are also a number of KLIPS things that get in the way. Where possible, we have either removed them, or regularized them to make the scripts simpler.



Subsections
next up previous
Next: Review of first attempt Up: Automatic Regression testing of Previous: Testing Pluto
Michael Richardson
2002-06-26