NASD Programmer's Documentation
Running programs in tests/

There are several programs in the tests/ subdirectory that are used for regression testing of NASD. A perl script called regression has been provided that runs the regression tests and checks their output for anomalies. This is the recommended way of running the full test suite.

The syntax for invoking the test suite is (from the tests directory):

% ./regression [-s] [-k] [-i N] [-p N] [-R path] drive The drive argument specifies the drive to run against. The drive must be started before running the regression tests. Starting the drive is described in the section on running the drive.
Option Description
-s Enable security testing; the default is to tests without security
-k Run kpdev tests.
-i N Sets the number of iterations of tests to be N; the default is 10 iterations.
-p N Sets the partition protection level (passed to pcrpart as the protection_level argument) to N; can only be given if the -s option is also specified.
-R path Sets the path to the test suite programs; the default is the current directory.
-v Produce verbose output; by default, only brief status messages on the progress of the regression tests are printed.

regression runs the following tests, each of which can be run separately as well:

  • marshall_tester - tests basic RPC marshalling functionality and makes sure all of the data types pack and unpack into and out of buffers of the appropriate sizes.
  • ubench - run micro-benchmarks against a drive.
  • pcnulls - simple connectivity check that makes sure that NASD RPCs work at all.
  • pinit - test NASD drive initialization.
  • pcrpart - create a partition on a NASD drive.
  • pinfo - retrieve NASD drive and partition information.
  • pcrobj - create an object on a NASD drive.
  • preadwrite - read/write functionality tester for NASD drive
  • psg - exercise the NASD scatter/gather operations.
  • pgetattr - send the getattr request to a NASD drive.
  • pcreatedelete - test the NASD create and delete operations.
  • premove - remove an object from a NASD drive.
  • plspart - list objects in a NASD partition.
  • pdrspeed - instrument NASD drive read/write speed.
  • psync - flush dirty blocks on a NASD drive.
  • The regression script first runs the simplest tests once: marshall_tester, pcnulls, pinit, pcrpart and pcrobj to test basic NASD RPC and drive functionality. It then executes N iterations (as specified by the -i option) of the core regression test, which runs ubench once in userlevel and optionally once against the kpdev device, preadwrite (once with the daily key and once with a capability), psg, and a series of calls to pdrspeed, once each for read and write with default parameters, optionally once each for read and write against the kpdev device, once for reads throttled to 350 bytes per millisecond in userlevel and optionally once for reads throttled to 350 bytes per millisecond against the kpdev device. In all cases, kpdev tests are only performed if the -k option is specified, and the default security level is zero, i.e. without security.

    Two older versions of the regression test drivers also come with NASD; they live in the shell scripts doregress and regress1 in the tests/ subdirectory. Their use is deprecated.

    Descriptions of all the individual test suite programs follow. Many tests have an option that selects the kpdev device for binding to NASD drives instead of user-level DCE, usually called -k. This mode of operation is currently not available for Linux, so those options do not apply on that platform. Several tests also allow you to select from other binding types, typically via options named -l (colocated), -M (message queues), and -T (DCE/TCP instead of DCE/UDP). All of these options (including -k) are mutually exclusive. Unless otherwise stated, the default binding is to use DCE/UDP for RPCs to NASD drives.


    ubench - run a series of micro-benchmarks on a new drive

    Usage:

    % ubench [options] servername partnum master_password
    Option Description
    -c delay Create delay in milliseconds; default is zero.
    -l Use colocated drive.
    -n iterations Set number of iterations; default is 100.
    -k Use kpdev.
    -M Use message queues.
    -s level Set security level. This option is only available if secure NASD RPCs are enabled at compile time. Valid values for level are:
    0 none
    1 INTEGRITY_ARGS
    2 INTEGRITY_DATA
    3 INTEGRITY_ARGS | INTEGRITY_DATA
    4 PRIVACY_DATA
    5 PRIVACY_DATA | PRIVACY_ARGS
    6 {INTEGRITY,PRIVACY}_{ARGS,DATA}
    -S test Skip named test; multiple -S options may be specified. Valid values for test are:
    noop skip no-op tests
    getattr skip getattr tests
    setattr0 skip the setattr test that does not set fs-specific data
    setattr1 skip the setattr> test that does set fs-specific data
    create skips the object creation and deletion tests
    remove skips the object deletion tests
    all skips all of the above tests
    -T Use DCE/TCP instead of DCE/UDP for the RPC transport.

    Description:

    ubench runs a series of microbenchmarks against a newly created NASD drive. In the nominal case, where no benchmarks are skipped (via the -S option), the following benchmarks are run (in order):

  • noop tests (this is essentially the same as pcnulls;
  • getattr requests.
  • setattr requests without NASD_ATTR_FS_SPECIFIC set;
  • setattr requests with NASD_ATTR_FS_SPECIFIC set;
  • object creation;
  • object deletion (only if object creation tests are not skipped).

  • marshall_tester - test RPC marshalling

    Usage:

    % marshall_tester

    Description:

    marshall_tester takes no arguments. It performs sanity checks on the marshalling of all basic NASD data types into and out of RPC requests, and reports any anomalies.


    pcnulls - test NASD RPC connectivity

    Usage:

    % pcnulls [options] servername niters
    Option Description
    -M Use message queues for binding to the NASD drive.
    -T Use DCE/TCP for binding to the NASD drive.

    Description:

    pcnulls tests basic RPC connectivity by sending no-op requests to a drive.


    pinit - test drive initialization

    Usage:

    % pinit servername master_password

    Description:

    pinit calls nasd_cl_p_initialize_dr on a drive to initialize its security subsystem. This is run before formatting a freshly started NASD drive, and is invoked in the test suite before anything but the pcnulls no-op test.


    pcrpart - create a partition on a NASD drive

    Usage:

    % pcrpart [options] servername partnum nblocks protection_level master_password
    Option Description
    -M Use message queues for binding to the NASD drive.
    -T Use DCE/TCP for binding to the NASD drive.

    Description:

    pcrpart creates a partition on a NASD drive. The partnum and nblocks arguments both start at 1. The protection_level argument takes the same values as the -s option of the ubench program (a number from zero to 6).


    pinfo - retrieve drive/partition information

    Usage:

    % pinfo [options] servername master_password
    Option Description
    -c Include drive cache statistics.
    -D Exclude basic drive information.
    -i Include drive ioqueue statistics.
    -I Include drive cache name.
    -l Include drive layout statistics.
    -L Include drive layout name.
    -M Use message queues.
    -o Include drive op statistics.
    -O Include drive op statistics (summary).
    -P Exclude partition information.
    -q Include rpc queue depth statistics.
    -t Include total operation times.
    -T Use DCE/TCP.
    -u Include drive I/O module statistics.
    -z Zero out statistics after printing (zero only printed stats).

    Description:

    pinfo prints a variety of statistics kept by NASD drives, optionally zeroing out the counters after they have been printed.


    pcrobj - create an object on a NASD partition

    Usage:

    % pcrobj [options] servername master_password
    Option Description
    -k Use kpdev.
    -M Use message queues.
    -n N Creates N objects (default is 1).
    -p partnum Creates objects on the given partition number (default is 1).
    -T Use DCE/TCP.

    Description:

    pcrobj creates objects on the given NASD drive.


    preadwrite - NASD read/write tests

    Usage:

    % preadwrite [options] servername partnum master_password [nasdid]
    Option Description
    -c Create new object for test.
    -d Use a daily key.
    -k Use kpdev.
    -l Use colocated drive.
    -M Use message queues.
    -s level Set security level. This option is only available if secure NASD RPCs are enabled at compile time. Valid values for level are:
    0 none
    1 INTEGRITY_ARGS
    2 INTEGRITY_DATA
    3 INTEGRITY_ARGS | INTEGRITY_DATA
    4 PRIVACY_DATA
    5 PRIVACY_DATA | PRIVACY_ARGS
    6 {INTEGRITY,PRIVACY}_{ARGS,DATA}
    -T Use DCE/TCP.
    -q Run quietly.

    Description:

    preadwrite generates read and write test loads of various sizes against NASD objects.

    If the -c option is not specified, the nasdid argument is required, and must be a valid NASD object ID on the given drive/partition. Otherwise, a new object is created for the purposes of the test.

    preadwrite does small I/Os, block-sized I/Os and very large I/Os, printing statistics on its progress as it goes unless the -q option is given.


    psg - test NASD scatter/gather operations

    Usage:

    % psg [options] servername partnum master_password [nasdid]
    Option Description
    -c Create new object for test.
    -d Use a daily key.
    -k Use kpdev.
    -l Use colocated drive.
    -M Use message queues.
    -s level Set security level. This option is only available if secure NASD RPCs are enabled at compile time. Valid values for level are:
    0 none
    1 INTEGRITY_ARGS
    2 INTEGRITY_DATA
    3 INTEGRITY_ARGS | INTEGRITY_DATA
    4 PRIVACY_DATA
    5 PRIVACY_DATA | PRIVACY_ARGS
    6 {INTEGRITY,PRIVACY}_{ARGS,DATA}
    -T Use DCE/TCP.

    Description:

    psg tests the scatter/gather I/O primitives nasd_cl_p_range_read and nasd_cl_p_range_write .


    pgetattr - send the getattr request to a NASD drive

    Usage:

    % pgetattr [options] servername partnum nasdid master_password
    Option Description
    -k Use kpdev.
    -M Use message queues.
    -T Use DCE/TCP.

    Description:

    pgetattr tests the nasd_cl_p_getattr_dr call on the given NASD drive and object.


    pcreatedelete - test NASD drive create/delete

    Usage:

    % pcreatedelete [options] servername partnum master_password
    Option Description
    -D Leave partition dirty (don't delete objects created by us).
    -d N Number of deletions to do (default is a random number).
    -e Randomize the order of deletions.
    -f We are running against a non-empty filesystem.
    -F Flush objects before deleting.
    -k Use kpdev.
    -l Use colocated drive.
    -n N Create N objects (default is 20).
    -p N Do N passes of our test.
    -P Disable per-pass checks.
    -R Run regression test (multiple passes of creats/deletes).
    -s seed Set the seed to use for random number generation.
    -S Sync between passes.
    -T Use DCE/TCP.
    -v Verbose mode.

    Description:

    pcreatedelete tests the create and delete primitives by creating and deleting many objects, and verifying contents of the list-of-objects-object.


    premove - remove an object from a NASD drive

    Usage:

    % premove servername partnum nasdid master_password

    Description:

    premove takes no options. It removes the NASD object specified by nasdid from the given drive.


    plspart - list objects in a NASD partition

    Usage:

    % plspart [options] servername partnum master_password
    Option Description
    -k Use kpdev
    -M Use message queues.
    -T Use DCE/TCP instead of DCE/UDP for the RPC transport.

    Description:

    plspart lists the ids of all the objects in a partition on a NASD drive.


    pdrspeed - instrument NASD drive read/write speed

    Usage:

    % pdrspeed [options] servername master_password
    Option Description
    -b blocksize
    Sets block size for read/write tests (default=131072)
    -i Increment offsets on each iteration
    -k Use kpdev
    -l Use colocated drive
    -n iterations Set the number of iterations for the test (default=10)
    -p partnum Set the partition number (default=1)
    -t value Use throttling versions of the NASD read primitive, and set the throttle to value bytes per millisecond (throttled writes are not supported by pdrspeed)
    -v bit_pattern Set the bit pattern used in data blocks for read/write tests. Only the first character of the bit_pattern option's value is used, i.e -v A would set the bit pattern to decimal 65. The default is all ones.
    -c Compare data after I/O with bit_pattern
    -w Do write tests; default is to do read tests.
    -T Use DCE/TCP instead of DCE/UDP for the RPC transport.
    -C filename Write sampled continuous distribution function to filename.

    Description:

    pdrspeed performs speed tests of read and write operations to a NASD drive, optionally invoking the throttled variant of the read primitive (nasd_cl_p_tread_simple_dr) if the -t command-line option is given.

    pdrspeed reports basic statistics on standard output. If given the -C option, it will also write files containing the sampled continuous distribtion function for the test runs in a form suitable for processing by tools such as xmgr. The samples are stored as plain ASCII in the named file.


    psync - flush dirty blocks on a NASD drive

    Usage:

    % psync servername

    Description:

    psync takes no options. It flushes any dirty blocks in the cache on the given drive to disk.



    <--- ---> ^<br>|<br>|
    Running the drive Running the NASD-NFS filemanager NASD Programmer's Documentation