TPCTest Class:

The TPCTest class inherits from BaseTest class, and contains the main methods to create and run the test commands.

class TPCTest( configFile=None, createFiles=False, root=True, https=True, davs=True )

A configuration file can be passed upon instantiation of the subclasses containing the endpoint, file path and optional port.

Optionally, specifying a directory, file name(s) and file size(s) in the config file and instantiating with createFiles=True will generate these files in the provided directory.

To exclude up to two of the protocols from being used, they can be toggled to False when instantiating the subclass

 

TPCTest Methods:


method genScenarios( action, sourcePath=None, sourceBaseNm=None, destinBaseNm=None, xrdArgs=None, gfalArgs=None, timeout=None, XROOTD_ECHO=False, INT_MANAGER=False )

This method generates and runs commands for a given functionality, for each protocol and endpoint combination.
These functionalities are performed on endpoint A and endpoint B, therefore the commands and their outputs are treated as pairs.

     Parameters:

  • action (string) – Functionality of the command. Expects a string of one of the following:
    • copy – copy a single file
    • checksum – get checksum of one or more destination files
    • delete – delete a single destination file
  • sourcePath (string) – Path to local file. Used to transfer local file to source endpoint
  • sourceBaseNm (string) – Base name of file on source endpoint.
  • destinBaseNm (string) – Base name of file on destination endpoint.
  • xrdArgs (string, optional) – Extra flag(s) to be added to the generated base command of the action, for XRootD commands
  • gfalArgs (string, optional) - Extra flag(s) to be added to the generated base command of the action, for gfal2 commands
  • TestAll (bool, optional) – If set to True, will run commands using all sites under TEST_ENDPOINTS in config file (i.e. all ‘Site A’s)
  • timeout (int, optional) – Optional timeout for all commands, overrides default (5 seconds)
  • XROOTD_ECHO (bool, optional) – Sets endpoint to redirector: xrootd.echo.stfc.ac.uk
  • INT_MANAGER (bool, optional) – Sets endpoint to redirector: echo-internal-manager01.gridpp.rl.ac.uk

     Returns:
         Returns a dictionary containing the command outputs required by the given action.
         The commands in TPCTest are generated and run as pairs, so the outputs are also in pairs.
         All actions will return a dictionary containing the following key:value pairs:

  • ‘cmdOuts’: [((returncodeAB, stdoutAB, stderrAB), (returncodeBA, stdoutBA, stderrBA)), … ((returncodeAB, stdoutAB, stderrAB), (returncodeBA, stdoutBA, stderrBA))] – Returncode, stdout and stderr in pairs of tuples for each command pair that was run
  • ‘IDs’: [‘example_ID1’, … ‘example_IDx’] – ID for each command/scenario in the format ‘protocol:sourceEndpoint-destinationEndpoint-file’

         Additionally, the following actions will also contain extra key:value outputs:

         Checksum:

  • ‘cmdOuts’: [(stderrAB, stderrBA), … (stderrAB, stderrBA)] – Standard errors (without returncode and stdout) for each command pair that was run.
  • ‘destsums’: [(checksumAB, checksumBA), … (checksumAB, checksumBA)] – Checksums for files on both sites in pairs.

     Return type:
         dictionary


method genTimedScenarios( action, sourcePath=None, destinBaseNm=None, xrdArgs=None, gfalArgs=None, reps=3, timeout=None, XROOTD_ECHO=False, INT_MANAGER=False )

This method generates and runs commands for a given functionality, for each protocol and endpoint combination.
These functionalities are performed on endpoint A and endpoint B, therefore the commands and their outputs are treated as pairs.
Each command pair is run for several repetitions (reps) and timed. An average of the time is returned with the output.

     Parameters:

  • action (string) – Functionality of the command. Expects a string of one of the following:
    • copy – copy a single file
    • checksum – get checksum of one or more destination files
    • delete – delete a single destination file
  • sourcePath (string) – Path to local file. Used to transfer local file to source endpoint
  • sourceBaseNm (string) – Base name of file on source endpoint.
  • destinBaseNm (string) – Base name of file on destination endpoint.
  • xrdArgs (string, optional) – Extra flag(s) to be added to the generated base command of the action, for XRootD commands
  • gfalArgs (string, optional) - Extra flag(s) to be added to the generated base command of the action, for gfal2 commands
  • reps (int, optional) – Set number of repetitions for each command to run, overrides default (3)
  • timeout (int, optional) – Optional timeout for all commands, overrides default (5 seconds)
  • XROOTD_ECHO (bool, optional) – Sets endpoint to redirector: xrootd.echo.stfc.ac.uk
  • INT_MANAGER (bool, optional) – Sets endpoint to redirector: echo-internal-manager01.gridpp.rl.ac.uk

     Returns:
         Returns a dictionary containing the command outputs required by the given action.
         The commands in TPCTest are generated and run as pairs, so the outputs are also in pairs.
         All actions will return a dictionary containing the following key:value pairs:

  • ‘cmdOuts’: [((returncodeAB, stdoutAB, stderrAB, avgTimeAB), (returncodeBA, stdoutBA, stderrBA, avgTimeBA)), … ((returncodeAB, stdoutAB, stderrAB, avgTimeAB), (returncodeBA, stdoutBA, stderrBA, avgTimeBA))] – Returncode, stdout, stderr and avgTime in pairs of tuples for each command pair that was run
  • ‘IDs’: [‘example_ID1’, … ‘example_IDx’] – ID for each command/scenario in the format ‘protocol:sourceEndpoint-destinationEndpoint-file’

         Additionally, the following actions will also contain extra key:value outputs:

         Checksum:

  • ‘cmdOuts’: [(stderrAB, stderrBA), … (stderrAB, stderrBA)] – Standard errors (without returncode and stdout) for each command pair that was run.
  • ‘destsums’ = [(checksumAB, checksumBA), … (checksumAB, checksumBA)] – Checksums for files on both sites in pairs.

     Return type:
         dictionary