Commit f8337edd authored by Benjamin Blanc's avatar Benjamin Blanc

Update

parent 8456c7c8
......@@ -503,9 +503,14 @@ branch = foo
original_createTestResult = TaskDistributionTool.createTestResult
TaskDistributionTool.createTestResult = patch_createTestResult
test_node = self.getTestNode()
runner = UnitTestRunner(test_node)
original_prepareSlapOS = runner._prepareSlapOS
runner._prepareSlapOS = doNothing
original_runTestSuite = runner.runTestSuite
runner.runTestSuite = doNothing
SlapOSControler.initializeSlapOSControler = doNothing
......
......@@ -58,29 +58,8 @@ def createFile(path, mode, content):
class GenericSlapOSControler(object):
def __init__(self, working_directory, config, log):
self.config = config
self.software_root = os.path.join(working_directory, 'soft')
self.instance_root = os.path.join(working_directory, 'inst')
self.slapos_config = os.path.join(working_directory, 'slapos.cfg')
self.log = log
def _resetSoftware(self):
pass
def initializeSlapOSControler(self):
pass
def runSoftwareRelease(self):
pass
def runComputerPartition(self):
pass
class SlapOSControlerCluster(GenericSlapOSControler):
# TODO : merge two controler in one (with different method name ?)
class SlapOSControlerCluster(object):
def __init__(self, working_directory, config,
log, configuration_path_file):
......@@ -91,7 +70,7 @@ class SlapOSControlerCluster(GenericSlapOSControler):
"""
Supply several softwares from a list on a node
Ex :
slapos_controler.initializeSlapOSControler(['kvm.cfg', 'ok.cfg'], 'COMP-726')
my_controler.initializeSlapOSControler(['kvm.cfg', 'ok.cfg'], 'COMP-726')
"""
for software_path in software_path_list:
self._supply(software_path, computer_guid)
......@@ -99,7 +78,7 @@ class SlapOSControlerCluster(GenericSlapOSControler):
def _supply(self, software_url, computer_id):
"""
Ex :
slapos_controler._supply('kvm.cfg', 'COMP-726')
my_controler._supply('kvm.cfg', 'COMP-726')
"""
# TODO : remove return
return
......@@ -126,7 +105,7 @@ class SlapOSControlerCluster(GenericSlapOSControler):
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
Ex :
slapos_controler._request('Instance16h34Ben',
my_controler._request('Instance16h34Ben',
'kvm.cfg', 'cluster', { "_" : "{'toto' : 'titi'}" } )
"""
......@@ -154,10 +133,14 @@ class SlapOSControlerCluster(GenericSlapOSControler):
class SlapOSControler(GenericSlapOSControler):
class SlapOSControler(object):
def __init__(self, working_directory, config, log):
GenericSlapOSControler.__init__(self, working_directory, config, log)
self.config = config
self.software_root = os.path.join(working_directory, 'soft')
self.instance_root = os.path.join(working_directory, 'inst')
self.slapos_config = os.path.join(working_directory, 'slapos.cfg')
self.log = log
self.proxy_database = os.path.join(working_directory, 'proxy.db')
def _resetSoftware(self):
......
......@@ -74,9 +74,12 @@ class UnitTestRunner():
method_list.append("runComputerPartition")
for method_name in method_list:
slapos_method = getattr(self.slapos_controler, method_name)
log("Before status_dict = slapos_method(...)")
status_dict = slapos_method(self.testnode.config,
environment=self.testnode.config['environment'],
)
log(status_dict)
log("After status_dict = slapos_method(...)")
if status_dict['status_code'] != 0:
slapos_instance.retry = True
slapos_instance.retry_software_count += 1
......
......@@ -395,6 +395,7 @@ class TestNode(BaseTestNode):
self.cleanUp(None)
remote_test_result_needs_cleanup = False
begin = time.time()
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))
......@@ -403,26 +404,32 @@ class TestNode(BaseTestNode):
log("Got following test suite data from master : %r" % \
(test_suite_data,))
##/BLOCK OK
# Here we know what we are (sclability or unit test)
# self.prepareSlapOSForTestNode(test_node_slapos)
# Select the good runner
if True :
runner = UnitTestRunner(self)
runner = UnitTestRunner(self)
elif False :
runner = ScalabilityTestRunner(self)
else :
runner = UnitTestRunner(self)
log("OKAYBEN1")
runner.prepareSlapOSForTestNode(test_node_slapos)
log("OKAYBEN2")
#Clean-up test suites
self.checkOldTestSuite(test_suite_data)
for test_suite in test_suite_data:
log("OKAYBEN3")
## BLOCK OK
remote_test_result_needs_cleanup = False
node_test_suite = self.getNodeTestSuite(
......@@ -503,7 +510,7 @@ class TestNode(BaseTestNode):
finally:
# Nice way to kill *everything* generated by run process -- process
# groups working only in POSIX compilant systems
# Exceptions are swallowed during cleanup phas
# Exceptions are swallowed during cleanup phase
log("GENERAL EXCEPTION, QUITING")
self.cleanUp(test_result)
log("GENERAL EXCEPTION, QUITING, cleanup finished")
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