Test Scripts for Assignment 2

These are the tests we will be running on your kernel, possibly with different parameters.

Installing

These instructions are for using the student.cs environment. If you are working on another system you'll need to copy and transfer the a2-test-scripts.tar.gz file to your system and adjust the tar command below as appropriate.
# We are assuming your directory structure is as follows
# $HOME/cs350-os161
# $HOME/cs350-os161/os161-1.11
# $HOME/cs350-os161/root
#
# And that kernel-ASST2 is compiled and installed in 
# $HOME/cs350-os161/root

cd $HOME/cs350-os161

tar -xzf /u/cs350/pub/os161_repository/a2-test-scripts.tar.gz

cd a2-test-script

# This will create some symbolic links
make

# You should now be able to run the tests in the a2-test-script directory.


Using the test scripts

All the scripts in the a2-test-script directory use the csh so your PATH must be set properly in the .cshrc file.

The directory contains several files named test-*. These files are scripts that test specific features of your kernel by running a small number of programs that are in the testbin directory. You can find out which programs are being run by looking at the contents of each file.

The directory also contains a README file with information about the different tests. Use these scripts to test your system calls as you add them.

The a2-test-script directory also contains a script called run-batch that runs a batch of tests. We will try to run the tests as follows (assuming they are being run from the csh):

# Note: palin produces a long line that may cause problems when using tee
#       on some systems. 


# This test requires no input from the user.
./run-batch |& tee out.1        


# Run tests that use the console.
./test-rw-con |& tee out.2

# Consists of:
# conman - echos characters you type until the 'q' character is typed.
# sink - reads characters you type until the 'q' character is typed.
# tictac - interactive instructions for playing tic-tac-toe
#          plays until there is a winnner
# kitchen - runs 4 copies of sink so it reads characters typed until the 4th 'q'


# This test infintely forks threads. 
./test-forkbomb |& tee out.3
# It should not crash your kernel.
Note that run-batch runs tests in alphabetical order. This may not match the order that you would like to use to implement the various system calls. For example, one of the tests run by run-batch but one that you might want to start with first and can be run separately is:
# This script tests does a bit of computation
# and then calls the  _exit system call.
./test-_exit
Then you might like to test writing to the console using:
./test-write-con
These tests are not exhaustive but the majority of your testing/implementation mark will come from correctly running these tests.