INTRODUCTION

This directory contains a variety of test and example application
programs for the EXODUS Storage Manager (SM).  
The subdirectories are:
misc/                 - simple single-server programs
producer_consumer/    - single-server programs that demonstrate
                        concurrency control
et/                   - single-server or multiple-server tests
                        that demonstrate recovery

Each subdirectory contains a README file with instructions.  General
instructions for running clients and servers are given in the user
guide, "Using the EXODUS Storage Manager." Please read at least
sections 1 and 2 in this user guide before running these tests.

Note that the Makefiles for each subdirectory compile the programs
using C++.  We have only tested compiling them with GNU C++ (g++),
but they should work fine with other C++ compilers.  Unfortunately,
the SM client library, libsm_client.a, as distributed is compiled
with g++ so you need the the g++ library to link.

In order to compile the test programs it is assumed that the
Storage Manager header file, sm_client.h, is installed in ../include
and that the client library, libsm_client.a, is installed in ../lib.
To run the server, it is assumed that sm_server, diskrw, and
formatvol are installed in ../bin.

STARTING THE SERVER  (for single-server tests)

The tests programs in the subdirectories misc/ and producer_consumer/
require that data volumes are already formatted and that a server is
running.  This section briefly describes how to format volumes and run
the server.  More information can be found in the user guide.  By
default, the server expects an /etc/services entry, with the name
"exodussm", for the port it is to use to listen for client messages. 
The user guide describes how to set this entry up.  For these tests, we
will override the default by starting the server with the
-portname option.

Here are instructions for formatting volumes and running the server.
These instructions assume you are running the csh or tcsh shells.

* Copy the configuration file ../lib/.sm_config to
  your home directory:
	cp ../lib/.sm_config ~/.sm_config

* Create a directory "volume" in your home directory.  This
  directory will hold the volume files used for testing.  It is also
  a convenient place to put symbolic links to volumes on raw devices
  or other disks partitions.

* Edit the ~/.sm_config file to reflect your environment:
   At the line:
	client*mount:       3001 9000@<serverhost>
   change <serverhost> to be your machine name.

   Run "netstat -a | grep 9000" to see if port 9000 is being used
   by any other process.  If so, change 9000 to some other port.
   You need to make the identical change at the line
	server.sm_server.portname:  9000

   Replace all <full_path_to_home> with the complete path
   to your home directory.  DO NOT USE " ~ ".

* cd to the ../bin directory where the server executable is located.

* Run:  ./formatvol -vol 3000
  where "3000" is the volume ID for the log volume.

* Run:  ./formatvol -vol 3001
  where "3001" is the volume ID for the data volume.

* Run:  ./sm_server
  to start the server.  The server will print a message that is is
  regenerating the log volume.  Clients can be started when the
  message: "Server ready for requests" is printed.

  If you get the error:
	SERVER_ERROR: Could not fork the disk process: filename the
  server is attempting to use filename as the disk I/O process.  The
  disk I/O process is bin/diskrw, and the server should have been told
  this during installation.  If the server cannot find bin/diskrw then
  you can start the server with:
	./sm_server -diskproc ./diskrw
  if you are in bin/.

RUNNING THE SINGLE-SERVER TESTS

Once the server is started, tests in misc/ and producer-consumer/ 
can be run.  Open a window for running the tests.  First, run 
the tests in the misc directory.  See misc/README and
producer_consumer/README for more details.

After these tests are run, the server can be shut down by typing 
"shutdown" in the server window,  or by running:
	../bin/shutserver -v 3001
where "3001" is a data volume that the server manages.

RUNNING THE ET TESTS

The tests in et/ can be run as single-server tests or 
as multiple-server tests.
See et/README, et/README.install for details.
