PTL Architecture

Using PTL with PBS

PTL Architecture Layout

PTL Directory Structure

Contents of pbspro/test/fw/:


DirectoryDescription of Contents
fw




bin

Test command: pbs_benchpress

PTL-based commands:

pbs_config: for configuring PBS and PTL for testing
pbs_loganalyzer: for analyzing daemon and accounting logs
pbs_snapshot: for capturing state of complex
pbs_stat: for getting status of PBS objects, e.g. jobs, queues

Commands that are not currently in use:

pbs_as: for future API mode
pbs_cov: for getting code coverage
pbs_py_spawn: left over from another project
pbs_swigify: for future API mode


doc

Documentation source .rst files

ptl

PTL package


lib

Core Python library: PBSTestLib

Supporting files for PBSTestLib: pbs_api_to_cli.py, pbs_ifl_mock.py



utils

PBS test suite: pbs_testsuite.py containing PBSTestSuite (which is Python testing framework)

Utilities PTL provides, such as pbs_snaputils.py, pbs_logutils.py, pbs_dshutils.py, pbs_crayutils.py, etc.




pluginsNose plugins for PTL framework

Contents of pbspro/test/tests/:


DirectoryDescription of Contents
tests


functional

Feature-specific tests

Test suites under this directory should inherit base class TestFunctional


interfaces

Tests related to PBS interfaces (IFL, TM, RM)

Test suites under this directory should inherit base class TestInterfaces


performance

Performance tests

Test suites under this directory should inherit base class TestPerformance


resilience

Server & comm failover tests

Stress, load, and endurance tests

Test suites under this directory should inherit base class TestResilience


security

Security tests

Test suites under this directory should inherit base class TestSecurity


selftest

Testing PTL itself

Test suites under this directory should inherit base class TestSelf


upgrades

Upgrade-related tests

Test suites under this directory should inherit base class TestUpgrades

PTL Test Structures and Conventions

Test File Conventions

Each test file contains one test suite.

Name: pbs_<feature name>.py

- Start file name with pbs_ then use feature name

- Use only lower-case characters and the underscore (“_”) (this is the only special character allowed)

- Start comments inside filename with a single # (No triple/single quotes)

- No camel case needed in test file name

Examples: pbs_reservations.py, pbs_preemption.py

- Permission for file should be 0644

Test Suite Conventions

Each test suite is a Python class made up of tests.  Each test is a method in the class.

Name: Test<Feature>

- Start name of test suite with with string “Test”

- Use unique, English-language explanatory name

- Use naming conventions for Python Class names (Camel case)

- Docstring is mandatory.  This gives broad summary of tests in the suite

- Start comments with a single # (No triple/single quotes)

- Do not use ticket ID

Examples: TestReservations, TestNodesQueues

Test Case Conventions

Each test is a Python method and is a member of a Python class defining a test suite.  A test is also called a test case.

Name: test_<test description>

- Start test name with "test_", then use all lower case alphanumeric for the test description

- Make name unique, accurate, & explanatory, but concise; can have multiple words if needed

- Docstring is mandatory.  This gives summary of the whole test case

- Tagging is optional.  Tag can be based on category in which the test belongs.  Ex: :@tags('smoke')  ### leading colon?

- Test case name need not include the feature name (as it will be part of the test suite anyways)

- Start comments with a single # (No triple/single quoted comments)

Examples: test_create_routing_queue, test_finished_jobs

Inherited Python Classes

PTL is derived from and inherits classes from the Python unittest unit testing framework. 

PTL test suites are directly inherited from the unittest TestCase class.