PTL framework’s class “Server” doesn’t contain mom objects


#1

Hello,

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


#2

Thanks @lsubramanian. your approach sounds good to me. if there are more than one mom, will it pass for all of them?


#3

@anamika, Yes . The hook copy message will be looked for in the mom log of every mom in the cluster.


#4

This seems fine to me.