...
Code Block |
---|
####### Part of the LUTF infrastructure ######## # The BaseTest class is provided by the LUTF infrastructure # The rpc method of the BaseTest class will take the parameters, # serialize it into a YAML block and send it to the target specified. class BaseTest(object, lutfrpc): def run__init__(target, parameters);=None): self.rpc(class_name+'execute', parameters) ###### In the test script ###### # Each test case will inherit from the BaseTest class. class Test_1a(BaseTest): def execute(parameters): # do the logic of the test # The run function will be executed by the LUTF master # it will instantiate the Test or the step of the test to run # then call the class' run function providing it with a dictionary # of parameters def run(dictionary): # do some logic Test1a = Test_1a(); Test1a.run(params)if target: self.remote = true self.target = target def __getattribute__(self,name): attr = object.__getattribute__(self, name) if hasattr(attr, '__call__'): def newfunc(*args, **kwargs): if self.remote: # execute on the remote defined by: # self.target # attr.__name__ = name of function # type(self).__name__ = name of class result = lutfrpc.send_rpc(self.target, attr.__name__, type(self).__name__, *args, **kwargs) else: result = attr(*args, **kwargs) return result return newfunc else: return attr def run(parameters, method="execute"); if self.remote: return self.rpc(self.target, class_name+method, parameters) # if not rpc then just execute locally return self.method(parameters) ###### In the test script ###### # Each test case will inherit from the BaseTest class. class Test_1a(BaseTest): def execute(parameters): # do the logic of the test # The run function will be executed by the LUTF master # it will instantiate the Test or the step of the test to run # then call the class' run function providing it with a dictionary # of parameters def run(dictionary, results): # do some logic Test1a = Test_1a(); result_yaml = Test1a.run(params) # append the results_yaml to the global results |
To simplify matters Test parameters take only a dictionary as input. The dictionary can include arbitrary data, which can be encoded in YAML eventually.
Communication Infrastructure
Gliffy Diagram | ||||||
---|---|---|---|---|---|---|
|
The mechanism here is not inte
Test Environment Set-Up
Each node which will run the LUTF will need to have the following installed
...