Testing the firmware and software

The EMP test suite (implemented in Python, using pytest) validates that the framework firmware and software are functioning as expected, using ‘null algo’ builds of the EMP firmware. The tests are organised into many test cases, each of which tests a specific workflow or area of functionality with a specific set of parameters. These test cases are grouped into three test modules:

  • test_ttc - TTC reset & configuration

  • test_datapath - I/O buffers

  • test_links - Backend links, including collection of eyescan/bathtub data (verified by configuring the MGTs in internal loopback mode)

Environment

export PATH=/opt/cactus/bin/emp:$PATH
export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
export PYTEST_ADDOPTS="--rootdir=."

The last line is required to set the location for .pytest_cache.

Running the test suite

The test suite can be run as follows (after replacing CONNECTIONS.xml, DEVICE_ID and CHANNEL_LIST with the appropriate values for your firmware build and board):

python -m emp.tests -v --conn CONNECTIONS.xml --device DEVICE_ID --channels CHANNEL_LIST --repeat=1

For example, for channels 1, 2, 3, 4 and 12 on a daughter card at site X0 on a Serenity, you would run the following:

python -m emp.tests -v --conn connections.xml --device x0 --channels 1-4,12 --repeat=1

You can get the test suite to repeat each test case several times by changing the value passed to the --repeat flag.

Warning

If external TTC sources (e.g. an FC7 and/or DTH) are not present/configured, then add the --no-external-legacyttc and/or --no-external-tcds2 flags to the end of the test command so the test suite knows that it should expect failures on those interfaces.

Note

If you want to only run a subset of tests, you can specify the name of the test module or test cases using the -k flag. For example, to only run the TTC tests:

python -m emp.tests -vk test_ttc --conn CONNECTIONS.xml --device DEVICE_ID --channels CHANNEL_LIST --repeat=1

Or, to run the TTC and I/O buffer tests:

python -m emp.tests -vk "test_ttc or test_datapath" --conn CONNECTIONS.xml --device DEVICE_ID --channels CHANNEL_LIST --repeat=1