This page appears in the PTL Developer's Guide.
Excerpt | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Process for Improving PTL FrameworkThe process for improving the PTL framework is the same as the process you use for changing source code in PBS Professional. PTL Directory Structure
Construction of PTLPTL is derived from Python's unittest. PTL uses nose plugins. Testing PTLTests that test PTL are in pbspro/test/test/selftest, at https://github.com/PBSPro/pbspro/tree/master/test/tests/selftest Enhancing PTL for New PBS AttributesHow to Add a New Attribute to the LibraryThis section is for PBS developers who may be adding a new job, queue, server, or vnode attribute, and need to write tests that depend on their new attribute. PTL does not automatically generate mappings from API to CLI, so when adding new attributes, it is the responsibility of the test writer to define the attribute conversion in ptl/lib/pbs_api_to_cli.py. They must also define the new attribute in ptl/lib/pbs_ifl_mock.py so that the attribute name can be dereferenced if the SWIG wrapping was not performed.
ATTR_geometry: "W job_geometry="
ATTR_geometry: "job_geometry"
Nose Plugins for PTL
Related Links and ReferencesComplete Doxygenated PTL Documentationhttp://www.pbspro.org/ptldocs/ Repositoryhttps://github.com/PBSPro/pbspro Nose Documentationhttp://nose.readthedocs.io/en/latest/testing.html Python Documentation |
Process for Improving PTL Framework
The process for improving the PTL framework is the same as the process you use for changing source code in PBS Professional.
PTL Directory Structure
Construction of PTL
PTL is derived from Python's unittest.
PTL uses nose plugins.
Testing PTL
Tests that test PTL are in pbspro/test/test/selftest, at https://github.com/PBSPro/pbspro/tree/master/test/tests/selftest
Enhancing PTL for New PBS Attributes
How to Add a New Attribute to the Library
This section is for PBS developers who may be adding a new job, queue, server, or vnode attribute, and need to write tests that depend on their new attribute. PTL does not automatically generate mappings from API to CLI, so when adding new attributes, it is the responsibility of the test writer to define the attribute conversion in ptl/lib/pbs_api_to_cli.py. They must also define the new attribute in ptl/lib/pbs_ifl_mock.py so that the attribute name can be dereferenced if the SWIG wrapping was not performed.
For example, let's assume we are introducing a new job attribute called ATTR_geometry that maps to the string "job_geometry". In order to be able to set this attribute for a job:
We need to define it in pbs_api_to_cli.py as follows:
ATTR_geometry: "W job_geometry="
Add it to ptl/lib/pbs_ifl_mock.py as follows:
ATTR_geometry: "job_geometry"
In order to get the API to use the new attribute, rerun pbs_swigify, so that symbols from pbs_ifl.h are read in
Nose Plugins for PTL
Related Links and References
Complete Doxygenated PTL Documentation
http://www.pbspro.org/ptldocs/
Repository
https://github.com/PBSPro/pbspro
https://github.com/PBSPro/pbspro/test
Nose Documentation
http://nose.readthedocs.io/en/latest/testing.html
http://pythontesting.net/framework/nose/nose-introduction/
http://nose.readthedocs.io/en/latest/plugins/writing.html
Python Documentation
https://docs.python.org/2.7/tutorial/