/epics-stress-tests

EPICS network stress test framework

Primary LanguagePythonOtherNOASSERTION

epics-stress-tests

image

image

Python scripts for distributed client/server EPICS CA and PVA network stress tests.

Documentation

Sphinx-generated documentation for this project can be found here: https://slac-epics.github.io/epics-stress-tests/

Requirements

Describe the project requirements (i.e. Python version, packages and how to install them)

Installation

Describe the installation procedure

Running the Tests

$ python run_tests.py

Directory Structure

This repo is based the PCDS python cookiecutter. See the following github page for more info:

EPICS stress tests for CA and PVA network protocols

Python scripts read test configuration files which describe which test servers and clients to run on which hosts and the timing for when each server and/or client runs.

Uses some new executables from stressTestClients project to facilitate capture and post analysis of EPICS PV's via Channel Access (CA) and PVAccess (PVA) network protocols.

  • pvGet - Derived from pvget but adds options to capture, repeat, save, etc. Used to test success of repeated cycles of connect, fetch data, and disconnect.
  • pvCapture - Derived from pvmonitor but adds options to capture, save, PV list from file, etc. Used to test PVAccess monitor connections.

The .env files are bash compatible shell scripts that set bash environment variables. They are also read by some of the python test management code.

The .cfg files are json format dictionaries with test configuration.

Test Folder Organization ---------------------------

Test output is organized as follows: GW_TESTS=/reg/d/iocData/gwTest TEST_NAME=YourTestName $TEST_TOP=$GW_TESTS/$TEST_NAME

Test Configuration

$TEST_TOP/test.cfg json format dictionary w/ configuration settings for this test

Test Environment

Environment files are simple VARIABLE=Value environment variable definitions. Value can contain other simple environment variable references. Examples w/ A,B,C variants indicate user can supply 0 or more w/ arbitrary names.

For example:

APP_TYPE=pvCapture CLIENT_NAME=${APP_TYPE}SinglePv LOG_FILE=${TEST_TOP}/${HOSTNAME}/${CLIENT_NAME}/${CLIENT_NAME}.log

Order in which test environment files are read: $TEST_TOP/test.env Env settings for this test $TEST_TOP/loadServer*A*.env loadServerA env settings $TEST_TOP/loadServer*B*.env loadServerB env settings $TEST_TOP/loadServer*C*.env loadServerC env settings ... $TEST_TOP/client*A*.env clientA env settings $TEST_TOP/client*B*.env clientB env settings $TEST_TOP/client*C*.env clientC env settings ... $TEST_TOP/launch_client*A*.sh clientA launch script $TEST_TOP/launch_client*B*.sh clientB launch script $TEST_TOP/launch_client*C*.sh clientC launch script ... $TEST_TOP/hostname/cpu.info Host CPU Info $TEST_TOP/hostname/mem.info Host Memory Info $TEST_TOP/hostname/uname.info Host OS Info $TEST_TOP/hostname/clients/client*A*00 Directory for clientA00 files $TEST_TOP/hostname/clients/client*A*01 Directory for clientA01 files ... $TEST_TOP/hostname/clients/client*A*00/pvs.list clientA00 PV list $TEST_TOP/hostname/clients/client*A*00/client*A*00.log clientA00 console output $TEST_TOP/hostname/clients/client*A*00/pvName.pvget clientA00 PV data from run_pvget.sh $TEST_TOP/hostname/clients/client*A*00/pvName.pvGet clientA00 PV data from pvGet $TEST_TOP/hostname/clients/client*A*00/pvName.pvCapture clientA00 PV data from pvCapture

Configuration env variables --------------------

SCRIPTDIR path to StressTestClients-git TOP

# Set in client env files (i.e. $TEST_TOP/clientFoo.env for clientFoo) APPTYPE Test type: loadServer, pvCapture, pvGet, pvGetGateway, run_pvget, run_pvgetarray * loadServer: Runs a loadServer EPICS IOC (See below for loadServer github URL) * pvCapture: Runs a stressTest pvCapture app * pvGet: Runs a stressTest pvGet app * pvGetGateway: Runs a stressTest pvGet app to capture gateway stats * run_pvget: Runs stressTest script run_pvget.sh that captures output of EPICS pvget. (deprecated) * run_pvgetarray: Runs stressTest script run_pvgetarray.sh. Dumps output of pvget but logs timestamp and number elements read.

# Set in $SCRIPTDIR/loadServerDefault.env STRESSTEST_TOP path to Top Dir For Set Of Stress Tests TEST_N_COUNTERS Number of incrementing counters in loadServer apps TEST_CIRCBUFF_SIZE Size of circular buffers in loadServer apps TEST_EPICS_PVA_SERVER_PORT EPICS_PVA_SERVER_PORT for client apps. Defaults to $EPICS_PVA_SERVER_PORT TEST_EPICS_PVA_BROADCAST_PORT EPICS_PVA_BROADCAST_PORT for client apps. Defaults to $EPICS_PVA_BROADCAST_PORT TEST_PV_PREFIX Default prefix for loadServer PVs (See below for loadServer PV naming scheme)

# TODO: Consolidate these by splitting into ${APPTYPE}Default.env files TEST_LOADSERVER_BASEPORT Base port number for loadServer procServ instances TEST_PVCAPTURE_BASEPORT Base port number for pvCapture procServ instances TEST_PVGET_BASEPORT Base port number for pvGet procServ instances TEST_RUN_PVGET_BASEPORT Base port number for run_pvget procServ instances TEST_RUN_PVGETARRAY_BASEPORT Base port number for run_pvgetarray procServ instances TEST_RUN_PVGET_GW_BASEPORT Base port number for run_pvget_gw procServ instances TEST_N_LOADSERVERS Number of loadServer instances to create TEST_N_PVCAPTURE Number of pvCapture instances to create TEST_N_PVGET Number of pvGet instances to create TEST_N_RUN_PVGET_CLIENTS Number of loadServer instances to create TEST_N_RUN_PVGETARRAY_CLIENTS Number of loadServer instances to create

# Set in $SCRIPTDIR/loadServerDefault.env TEST_CIRCBUFF_SIZE=1 TEST_COUNTER_RATE=100 TEST_COUNTER_DELAY=0.01 TEST_COUNTER_DELAY=$(gawk "BEGIN { print 1.0/$TEST_COUNTER_RATE }") TEST_DRIVE=drive TEST_CA_LNK=Unused

# Used as convenience variable in some scripts TEST_TOP path to Top Dir for a specfic StressTest instance

Configuration files --------------------

SCRIPTDIR=path to StressTestClientsTOP $SCRIPTDIR/stressTestDefault.env $SCRIPTDIR/loadServerDefault.env # TODO: More ${APPTYPE}Default.env files # $SCRIPTDIR/pvCaptureDefault.env