/* 
* Copyright (c) 2000 by Sun Microsystems, Inc. 
* All rights reserved. 
*/ 

TEST NAME 

      tape - tape and disk I/O stress test 

SYNOPSIS 

      sh tape.sh mt_name 
      sh runtests.sh mt_name [length_in_MB] 

DESCRIPTION 

      This test consists of a set of shell scripts and an executable. There are
      two main driver scripts: tape.sh and runtests.sh. The script runtests.sh
      executes the script tape.sh for a specified amount of time.

      Both runtape.sh and tape.sh use the parameter passed to runtape.sh (that
      is, the name assigned to the magnetic tape drive).

      The script tape.sh executes tapetest, cpio_write/cpio_read, and
      tar_write/tar_read. Before starting the test, verify that adequate space
      is available on the hard disk mounted on /mnt. The test should be run on
      a system where the root partition contents can fit on the available tape
      drive.

      First, tape.sh calls tapetest to test the tape. tapetest is executed on
      the entire length of tape. It fills the tape with a standard pattern,
      either to the limit specified in megabytes as an argument to the tapetest
      executable, or, if no argument is specified, to the end of the
      medium. Then the tape is rewound, its contents are read, and its size is
      compared with that of the original. The exit code is 0 if the comparison
      is successful, and non-zero if it is not.

      Next, cpio_write/cpio_read is run. This script changes to the root
      directory and copies the entire contents of the files and directories
      specified in the file 'files' onto the tape drive. The name of the tape
      drive is passed as a parameter to the script runtests.sh. The cpio
      command then copies the list of files and directories specified in
      'files' onto tape, reads the contents of the tape back to the /mnt
      directory, and compares the copies with the originals. Any differences
      are reported on the console.

      The last test executed by runtests.sh is tar_write/tar_read. The magnetic
      tape drive is read by the tar command and the contents are extracted and
      copied to /mnt. At the end of the test, the script compares the copies to
      the originals, and displays any differences on the console.

OPTIONS 

      length_in_MB   This optional parameter is the length of the magnetic
                     tape to write and then verify. If omitted, the entire
                     length of tape is assumed to be available for writing.

OPERANDS 

      mt_name   Name of the magnetic tape drive (/dev/rmt/0, for example).

USAGE VARIABLES 

      RUNTIME   This environment variable specifies, in seconds, the duration
                of the test. 

DURATION 

      About 12 hours 

POSSIBLE CONCURRENT TESTS 

      This test can be run with CON5, cd3, dd, and fs_stress. 

EXAMPLES 

      Example 1: 

      This command writes data to magnetic tape drive /dev/rmt/0 and then
      verifies the tape using tapetest.

      # sh tape.sh /dev/rmt/0

      cpio and tar are used to verify the tape. 

      Example 2: 

      This command calls the tape.sh test for the amount of time specified in
      the environment variable RUNTIME.

      # sh runtests.sh /dev/rmt/0
