diff --git a/erp5/util/testnode/ScalabilityTestRunner.py b/erp5/util/testnode/ScalabilityTestRunner.py index bd36cd3e1fbdd7fac98264662f69817d41ca8a9c..a7803a9ae1b3b6daec4ff307b99f0aa791d4e230 100644 --- a/erp5/util/testnode/ScalabilityTestRunner.py +++ b/erp5/util/testnode/ScalabilityTestRunner.py @@ -49,12 +49,8 @@ class ScalabilityTestRunner(): self.testnode.working_directory, self.testnode.config, self.testnode.log) - self.involved_nodes = [] # doesn't change during all the test - self.worker_nodes = [] # may change between two test_suite - self.launcher_nodes = [] # may change between two test_suite - self.master_nodes = [] # doesn't change during all the test - self.slave_nodes = [] # doesn't change during all the test - + # {'COMPX' : ['soft_path1.cfg', 'soft_path2.cfg'], + # 'COMPY' : ['soft_path1.cfg'], ... } self.remaining_software_installation_grid = {} # Protection to prevent installation of softwares after checking self.still_supply_to_request = True diff --git a/erp5/util/testnode/testnode.py b/erp5/util/testnode/testnode.py index 247588ecc47a441830fb76b5bd1843d4cd4de661..8be85f66a1e6234874c60806919edfb8c4c17e1d 100644 --- a/erp5/util/testnode/testnode.py +++ b/erp5/util/testnode/testnode.py @@ -316,14 +316,13 @@ branch = %(branch)s test_node_slapos = SlapOSInstance() test_node_slapos.edit(working_directory=self.config['slapos_directory']) ## /BLOCK OK - + print "computer_id:" print config['computer_id'] print "server_url:" print config['server_url'] time.sleep(30) - try: while True: try: @@ -338,35 +337,41 @@ branch = %(branch)s portal_url = config['test_suite_master_url'] portal = taskdistribution.TaskDistributionTool(portal_url, logger=DummyLogger(log)) test_suite_portal = taskdistribution.TaskDistributor(portal_url, logger=DummyLogger(log)) + + test_suite_json = test_suite_portal.startTestSuite(config['test_node_title']) test_suite_data = deunicodeData(json.loads(test_suite_json)) log("Got following test suite data from master : %r" % \ (test_suite_data,)) ##/BLOCK OK - - # Select the good runner - if my_type_test == None: - # Default way to determine if it is a slability or unit test - # Here parse/get information to - # if XXX : runner = UnitTe... - # elif YYY : runner = Scal... - # else : Raise ... - - # But for the moment : - runner = UnitTestRunner(self) - # Used in testERP5TestNode + if my_test_type == None: + # TODO : implement this method for each distributor + # (just UnitTestDistributor should be sufficient) + try: + my_test_type = portal.getTestType() + except: + log("testnode, error during requesting getTestType() method \ +from the distributor.") + raise NotImplementedError + + + # Select runner according to the test type if my_type_test == 'UnitTest': runner = UnitTestRunner(self) elif my_type_test == 'ScalabilityTest': runner = ScalabilityTestRunner(self) else: + log("testnode, Runner type '%s' not implemented.", %(my_type_test)) raise NotImplementedError - - runner.prepareSlapOSForTestNode(test_node_slapos) - #Clean-up test suites - self.checkOldTestSuite(test_suite_data) + + # difference master/slave + # master get test_suites, slave get nothing + if len(test_suite_data) > 1: + runner.prepareSlapOSForTestNode(test_node_slapos) + #Clean-up test suites + self.checkOldTestSuite(test_suite_data) for test_suite in test_suite_data: