Commit d814b8da authored by Benjamin Blanc's avatar Benjamin Blanc

Add isValidatedMaster to taskdistribution (client side)

parent f2afe20f
......@@ -469,6 +469,13 @@ class TaskDistributor(RPCRetry):
self._retryRPC('generateConfiguration', (test_suite_title,))
def isValidatedMaster(self, test_node_title):
"""
Returns True or False if the testnode is the master
"""
self._retryRPC('isValidatedMaster', (test_node_title,))
class DummyTaskDistributionTool(object):
"""
Fake remote server.
......
......@@ -78,13 +78,16 @@ class ScalabilityTestRunner():
"""
We will build slapos software needed by the testnode itself,
"""
software_path_list = []
software_path_list.append(self.testnode.config.get("software_list"))
for software_path in software_path_list:
for launcher_node in self.launcher_nodes:
self._prepareSlapOS(software_path, launcher_node['computer_id'])
# TODO : change the line below
return {'status_code' : 0}
if self.portal_test_suite.isValidatedMaster(self.config['test_node_title']):
software_path_list = []
software_path_list.append(self.testnode.config.get("software_list"))
for software_path in software_path_list:
for launcher_node in self.launcher_nodes:
self._prepareSlapOS(software_path, launcher_node['computer_id'])
# TODO : change the line below
return {'status_code' : 0}
else:
return {'status_code' : 0}
def prepareSlapOSForTestSuite(self, node_test_suite):
"""
......
......@@ -358,12 +358,10 @@ from the distributor.")
raise NotImplementedError
log("Type of current test is %s" %(my_test_type,))
# master gets test_suites, slaves get nothing
if (len(test_suite_data) > 1) or (my_test_type == 'UnitTest'):
runner.prepareSlapOSForTestNode(test_node_slapos)
#Clean-up test suites
self.checkOldTestSuite(test_suite_data)
runner.prepareSlapOSForTestNode(test_node_slapos)
#Clean-up test suites
self.checkOldTestSuite(test_suite_data)
for test_suite in test_suite_data:
## BLOCK OK
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment