Execution
=========

To run the network stress testcases see testcases/network/README.md.

The behaviour of network stress tests is configurable with environment
variables (See `Environment Variable' section).


Attention for HTTP/FTP stress tests
===================================

When you run http or ftp stress tests, you have to start http or ftp server
before running the tests.
About ssh tests, you don't need to run the ssh server.  Each test runs sshd
automatically.

Those tests requires that the remote host has `curl' command in order to
upload/download files to/from the local host.

When you run the ftp upload tests, please make sure the local host have
enough disk space to upload somes files. The size of file is able to
specify the environment variable (See `Environment Variable' section).


Environment Variable
====================

For general shell network test variables see testcases/network/README.md.
All variables have meaningful defaults values.

The nestwork stress testcases require the following environment variables:

  LHOST_HWADDRS     (for broken IP stress test)
  RHOST_HWADDRS     (for broken IP stress test)
  HTTP_DOWNLOAD_DIR	(for http stress test)
  FTP_DOWNLOAD_DIR	(for ftp stress test)
  FTP_UPLOAD_DIR	(for ftp stress test)
  FTP_UPLOAD_URLDIR	(for ftp stress test)

You are able to configure the behavior of the testcases with the following
environment variables:

  NS_DURATION		(for the continual test)
  NS_TIMES		(for the repetition test)
  CONNECTION_TOTAL	(for creating a large number of connection test)
  IP_TOTAL		(for adding large number of IP address test)
  ROUTE_TOTAL		(for adding large number of route test)
  MTU_CHANGE_TIMES	(for changing mtu test)
  IF_UPDOWN_TIMES	(for interface up/down test)
  MCASTNUM_NORMAL	(for multicast test)
  MCASTNUM_HEAVY	(for multicast test)
  DOWNLOAD_BIGFILESIZE	(for http/ftp downloading stress test)
  DOWNLOAD_REGFILESIZE	(for http/ftp downloading stress test)
  UPLOAD_BIGFILESIZE	(for ftp uploading stress test)
  UPLOAD_REGFILESIZE	(for ftp uploading stress test)

In these value, NS_DURATION is important if you'd like to reduce the test time.

Required environment variables
------------------------------

 o LHOST_HWADDRS
   The blank-separated hardware address list of the interfaces which are
   connected to a test link at the local host.
   This value have to have at least one address. The sequence of the hardware
   address have to be same to the test link sequence.

 o RHOST_HWADDRS
   The blank-separated hardware address list of the interfaces which are
   connected to a test link at the remote host.
   This value have to have at least one address. The sequence of the hardware
   address have to be same to the test link sequence.

 o HTTP_DOWNLOAD_DIR (for http stress test)
   The directory out of which the http server will serve the documents.
   In the apache case, the value of this variable is same as DocumentRoot
   value in httpd.conf

 o FTP_DOWNLOAD_DIR (for ftp stress test)
   The directory out of which the ftp server will serve the files.

 o FTP_UPLOAD_DIR (for ftp stress test)
   The directory which the ftp server will store the uploaded files.

 o FTP_UPLOAD_URLDIR (for ftp stress test)
   The directory part of URL where the client specifys to upload.
   Namely, when the URL to upload is ftp://ltp.sourceforge.net/upload ,
   /upload is the value to set the environment variable.


Optional environment variables
------------------------------

 o NS_DURATION (for the continual test)
   The duration of the continual test. The time unit is `second'.
   This variable affects all icmp/tcp/udp tests. The number of the testcase
   in them is big. Therefore, the test time is reduced when you set small
   value to the this variable.
   Except icmp/tcp/udp tests, this variable affects ssh, ftp and http tests.

 o NS_TIMES (for the repetition test)
   The number of repetition times for the repetition tests.
   This value affects IP adress add/del testcase, IP address change testcase
   route add/del testcase.

 o CONNECTION_TOTAL (for creating a large number of connection test)
   The total number of connection when the testcase requires plural connection.
   This value affects udp/tcp multi-connection to the same/different port
   testcases, ftp and http testcases.

 o IP_TOTAL		(for adding large number of IP address test)
   The total number of IP address to add an interface.
   This value affect interface tests to add large number of IP address.

 o ROUTE_TOTAL		(for adding large number of route test)
   The total number of route to add an interface.
   This value affect interface tests to add large number of route.

 o MTU_CHANGE_TIMES	(for changing mtu test)
   The times of change the mtu value of an interface. The interval of
   changing mtu is 5 seconds. Therefore, mtu changing tests requires
   5 x MTU_CHANGE_TIMES [sec].
   This value affect interface tests of changing mtu.

 o IF_UPDOWN_TIMES	(for interface up/down test)
   The up/down times of the interface tests. To up/down an interface takes
   time. If you specify 10,000 into this value, it takes 6 hours.
   This value affect interface tests of upping/down the interface.

 o MCASTNUM_NORMAL	(for multicast tests)
   The number of multicast group to join. This variable is used for
   the stress test after joining some multicast groups. It is not the
   main target for joining lots of multicast.

 o MCASTNUM_HEAVY	(for multicast tests)
   The number of multicast group to join. This variable is used for
   the stress test for joining lots of multicast group. This value is the
   limit of the joining multicast group.

 o DOWNLOAD_BIGFILESIZE	(for http/ftp downloading stress test)
   The file size of the downloading large size file tests.
   This value affects ftp download and http tests.

 o DOWNLOAD_REGFILESIZE	(for http/ftp downloading stress test)
   The file size of the downloading file by many clients.
   This value affects ftp download and http tests.

 o UPLOAD_BIGFILESIZE	(for ftp uploading stress test)
   The file size of the uploading large size file tests.
   The server must have UPLOAD_BIGFILESIZE as free disk space.
   This value affects ftp upload tests.

 o UPLOAD_REGFILESIZE	(for ftp uploading stress test)
   The file size of the downloading file by many clients.
   The server must have UPLOAD_REGFILESIZE x CONNECTION_NUM as free disk space.
   This value affects ftp download and http tests.

--- Mitsuru Chinen <mitch@jp.ibm.com>
