XRootD Testing Framework
GitHub Repository: https://github.com/stfc/xrootd-testing-framework/
What This Framework Is For:
This framework is made to test XRootD functionalities and performance on pre-deployed endpoints. The purpose of these tests is to:
-
Check that basic XRootD functionality works with the endpoint’s setup and configuration
-
Benchmark the performance of file transfer and deletion
Overview of How It Works:
The testing framework uses Pytest to parametrize and run the tests. Accessory classes are used to setup the data for the tests. The classes are organised into 3 types: ReadWriteTests, ThirdPartyCopyTests and MetadataTests, with attributes and methods specific to their type.
To set up a test, a test object is created from the relevant class. This object stores the endpoints that will be tested against, the port(s), and the protocol. The method genScenarios is used to setup functional tests, by generating XRootD (or gfal2) commands for each combination of protocol and endpoint.
The commands will then be run asynchronously using the asyncio-subprocess module, which return a returncode, stdout and stderr to be stored as results. Other outputs relevant to the type of command are also stored, such as checksums. Once the commands have been run, the outputs will be returned by genScenarios in a dictionary, under keys describing the type of output.
For performance tests, genTimedScenarios is used to:
- Get the start and end time of the command
- Re-run the command (default: 3) times
- Get the average time taken to run the commands
This average time is returned with the returncode, stdout and stderr.
After setting up the test by running the relevant commands, the output data is used to parametrise the Pytest test function. Each command is a scenario, and its output is used as a test case.