PTL Features for Testing PBS
1. Contents
- 1 1. Contents
- 2 2. PTL Framework Components
- 3 3. PTL Library: Objects and APIs
- 4 4. Communication of PBS Data in PTL
- 5 5. PBSTestSuite
- 6 6. Decorators
- 7 7. Exception Handling
- 8 8. Related Links and References
1.1 Abbreviations
API: Application Programming Interface
CLI: Command-line Interface
fw: framework
PBS: PBS Professional
PTL: PbsTestLab
2. PTL Framework Components
2.1 Interfaces to PBS
PTL executes tests with PBS operations using interfaces including the following:
PBS IFL-API
PBS commands
PBS configuration files
sched_config
mom_priv/config
the holidays file
the PBS daemon log files
PTL provides two ways of running tests:
IFL API mode (PTL_API)
Command Line mode (PTL_CLI)
2.2 PBS Entities: Core Library
The PTL library provides PBS IFL operations through either SWIG wrappers or the PBS CLI. It contains classes that encapsulate the following PBS entities:
Server
Scheduler
MoM
Comm
Queue
Job
Reservation
Hook
Resource
The PTL libary includes utility classes to convert PBS data structures and attributes to Python lists, strings, and dictionaries. It provides APIs for high-level PBS operations to operate on PBS entities. The PTL library provides the below PBS entity objects used in writing tests:
Server Object: PBS server configuration and control
Scheduler Object: Container of scheduler-related properties
MoM Object: Container for MoM properties. Provides various MoM operations
Comm Object: PBS comm configuration and control
Job Object: PBS job attributes and resources
Reservation Object: PBS reservation attributes and resources
Queue Object: PBS Queue container. Holds queue attributes and pointer to server
Hook Object: PBS hook objects. Holds attribute information and pointer to server
2.3 Distributed Shell Utilities
The PBS shell utilities are a set of functions to run commands, copy files, get process information, and parse a PBS configuration on an arbitrary host. Below are a few examples of the functions that these utilities provide:
Get local or remote platform info
Get the path of the pbs.conf file
Set/unset environment or configuration variables in a pbs.conf file
Run a command on a host or list of hosts
Copy a file or directory to specified target hosts
Wrapper method to run PTL command
Generic functions include chmod, chown, chgrp, rm, mkdir, useradd, userdel, with remote host support, etc.
2.4 Log Utilities
Miscellaneous utilities to process and analyze PBS log files. Contains utilities to parse and report metrics from server, scheduler, MoM, and accounting logs. Metrics include number of jobs queued, run, ended, cycle duration, and in-scheduler duration. Below are a few examples of the utilities and functions:
Get the number of lines of a daemon log
Helper function to parse log file
Function to match a line in log file
Analyze server, scheduler, MoM, and accounting logs
Get PBS job information
Etc.
2.5 Testing Utilities
PTL provides testing utilities as modules that aid in building tests using the PTL objects of PBS entities.
These are in pbspro/test/fw/ptl/utils (https://github.com/PBSPro/pbspro/tree/master/test/fw/ptl/utils)