PTL framework’s class “Server” in pbs_testlib.py doesn’t store mom objects today. It would be good if this class contains mom objects within itself. Some background on a use case that got me here:
create_import_hook() is a helper function in “Server” class to create a hook, import content into it, set the event and enable it. There is a user story that requests extension to this method, to also verify if hook files (*.HK and *.PY files) are copied successfully to moms, in case of mom hooks. To accomplish this, I would want to look at corresponding mom logs for the messages like “<hook.py>;copy hook-related file request received”. Hence the need to get a handle to mom object from within this function.
We could have the ‘Server’ class store mom objects by the following approach: class “PBSTestSuite” already maintains a dictionary of mom objects , updated in the setUp() method. At this point, “Server” can be updated with this dictionary of mom objects. Any methods of the Server class can then have access to mom objects.
Please give your comments/suggestions on the above approach.
PR with the above fix:https://github.com/PBSPro/pbspro/pull/909