Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Contents

Table of Contents
maxLevel3

...

Below are a few of the testing utilities:

pbs_testsuite

This utility defines a main master test suite class called PBSTestSuite that defines generic setup, teardown, and logging functions to be used. It is taken as parent class for most tests. This class by default instantiates server, scheduler, MoM, and comm objects connected to localhost. It also provides a wrapper class to handle multiple service instances (i.e., MoM, server, and scheduler) and certain aiding functions such as a function to skip a test, a function to check modules available on the system, etc. This utility is explained in detail in a later section of this document.

pbs_cliutils

Generic system command interface utility that provides functions such as:

  • Check for the existence of a binary (a command) using the "which" command
  • Expand a relative path to an absolute path
  • Return a list of privileged ports in use on a given host
  • getting PTL logging levels
  • Etc.

pbs_covutils

Code coverage utilities.  Below are a few of the functionalities provided by these utilities:

  • Set the coverage binary
  • Set the HTML generation utility
  • Set the coverage output directory
  • Set the coverage data directory
  • Initialize coverage
  • Capture the coverage parameters
  • Summarize the coverage output
  • Generate the HTML report
  • Etc.

pbs_procutils

Utilities to query process information.  Below are a few of the utilities and functions provided:

  • Get process information from a process name or PID on a given host
  • Get PID's process state on host
  • Get process information reports for PID such as RSS and VSZ, along with the respective times
  • Background process monitoring tool
  • Etc

pbs_fileutils

Utility to walk a file using the result of 'head' or 'tail' on the local file system. Below are a few of the functions provided:

  • Return the file descriptor associated with the file being processed
  • Get the size of the file
  • Get the next n lines of the file from head or tail
  • Get the nth line of the file
  • Get a block of lines in a file
  • Etc.

...

For PBS server configuration and control. 
A server object is an instance of the Server class.  A server object is a container for PBS server attributes, and uses wrappers for the IFL API to perform operations on the server.  For example, you can use it to submit, status, delete, manage, etc. jobs, reservations, and configurations.
The server class also offers higher-level routines to ease testing.  Examples: a function that reverts the PBS server configuration to prior known "out of the box" settings, a function to expect an attribute to match a given value as per an operation, and a function to return the count of anything queried in the PBS setup such as the  number of nodes etc. based on certain conditions.
The class contains routines to act upon the PBS server daemon, such as starting, stopping, or restarting the PBS server daemon, and a function to match log messages in the daemon log files.
The server class also contains a dictionary that holds general configuration for the framework's operations, such as operation mode (PTL_CLI or PTL_API), maximum attempts to try while checking for a command in a test condition, and the interval between which this check of the command happens.
Below is a depiction of the Server class hierarchy:

Server ClassImage Modified

  • Server: The Server class
  • PBSService: Generic PBS service object to hold properties of PBS daemons
  • PBSObject: Generic PBS object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

Container of Scheduler-related properties. 
The Scheduler class contains routines to update scheduler configuration along with routines to act upon the PBS scheduler daemon, such as starting, stopping, or restarting the PBS scheduler daemon, and function to match log messages in the daemon log files.
This class also offers higher-level routines to ease testing.   Examples: a function that reverts the PBS scheduler configuration to prior known "out of the box" settings, and a function to save daemon configurations.
Below is a depiction of the Scheduler class hierarchy:

Image Modified

  • Scheduler: The Scheduler Class
  • PBSService: Generic PBS service object to hold properties of PBS daemons
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

Container for MoM properties. 
The MoM class contains routines to update MoM attributes and act upon the PBS MoM daemon. Provides various MoM operations, such as creation, insertion, and deletion of vnodes.
This class also offers higher-level routines to ease testing.  Examples: a function that reverts the PBS MoM configuration to prior known "out of the box" settings, and a function to save daemon configuration.
Below is a depiction of the MoM class hierarchy:

MoM ClassImage Modified

  • MoM: The MoM Class
  • PBSService: Generic PBS service object to hold properties of PBS daemons
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

For PBS Comm configuration and control. 
This class also offers higher-level routines to ease testing, for example: a function that reverts the PBS comm configuration to prior known "out of the box" settings, and a function to save daemon configurations.
Below is a depiction of the comm class hierarchy:

Comm ClassImage Modified

  • Comm: The Comm Class
  • PBSService: Generic PBS service object to hold properties of PBS daemons
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

Below is depiction of the job class hierarchy:

Image Modified

  • Job: The Job Class
  • ResourceResv: Generic PBS resource reservation (a job or advance or standing reservation)
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

Below is a depiction of the reservation class hierarchy:

Reservation ClassImage Modified

  • Reservation: The Reservation class
  • ResourceResv: Generic PBS resource reservation (a job or advance or standing reservation)
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

Container for a PBS queue.  Holds attributes of the queue and a pointer to the server. Also defines a method to revert queue attributes to defaults.
Below is a depiction of the queue class hierarchy:

Queue ClassImage Modified

  • Queue: The Queue Class
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

Represents a PBS hook.  Holds attribute information and a pointer to the server.
Below is a depiction of the class hierarchy:

Hook ClassImage Modified

  • Hook: The Hook class
  • PBSObject: Generic PBS Object encapsulating attributes and defaults
  • Object: The most basic type in built-in Python classes (_builtin_.py)

...

4.1.1 Data Flow and Conversion During Testing of PBS

Data Flow When Testing PBSImage Modified

Testing PBS Operation in API Mode

...

4.1.2 Data Flow and Conversion for Result of Testing PBS

Data Flow for PBS Test ResultImage Modified

Testing Result of PBS Operation in API Mode

...


Below is the flow of methods inside a PTL test suite that is inherited from the master test suite, named PBSTestSuite, when test cases are executed:

Method Flow in Test SuiteImage Modified

Anchor
_Toc485217125
_Toc485217125
5. PBSTestSuite

...

5.5 Generic Setup and Teardown Functions

SetUpClass Method

  • Get test configuration parameters as a list of attributes

  • Validate PTL parameters whether enabled or disabled

  • Check whether or not the users exist

  • Initialize servers, comms, schedulers, and MoMs 

SetUp Method

TearDown Method

  • Stop process monitoring

TearDownClass Method

  • Nothing is done inside TearDownClass()

...

PTL provides decorators for use at the test suite level and at the test case level.  These decorators are defined in pbs_testsuite.py.

  • timeout - Decorator to set timeout value of test case. (Default value : 600)
  • requirements - Decorator to provide the cluster information required for a particular testcase
  • skipOnCpuSet - Decorator to skip a test on a CpuSet system
  • checkModule - Decorator to check if named module is available on the system and if not skip the test
  • skip - Unconditionally skip a test.

...