Commit 1108dad6 authored by Benjamin Blanc's avatar Benjamin Blanc

correction of test log + FIX one test

parent 0f337070
...@@ -47,7 +47,7 @@ class ERP5TestNode(TestCase): ...@@ -47,7 +47,7 @@ class ERP5TestNode(TestCase):
os.mkdir(self.remote_repository2) os.mkdir(self.remote_repository2)
def log(*args,**kw): def log(*args,**kw):
for arg in args: for arg in args:
print "TESTNODE LOG : %r" % (arg,) print "TESTNODE LOG : %r, %r" % (arg, kw)
self.log = log self.log = log
def returnGoodClassRunner(self, test_type): def returnGoodClassRunner(self, test_type):
...@@ -597,8 +597,17 @@ branch = foo ...@@ -597,8 +597,17 @@ branch = foo
def test_15_suite_log_directory(self, my_test_type='UnitTest'): def test_15_suite_log_directory(self, my_test_type='UnitTest'):
def doNothing(self, *args, **kw): def doNothing(self, *args, **kw):
pass pass
# Used in case of 'ScalabilityTest'
def patch_getTestType(self, *args, **kw): def patch_getTestType(self, *args, **kw):
return my_test_type return my_test_type
def patch_getSlaposAccountKey(self, *args, **kw):
return "key"
def patch_getSlaposAccountCertificate(self, *args, **kw):
return "key"
def patch_generateConfiguration(self, *args, **kw):
return '{"configuration_list": [], "involved_nodes_computer_guid"\
: [], "error_message": "No error.", "launcher_nodes_computer_guid": {}, \
"launchable": false}'
test_self = self test_self = self
test_result_path_root = os.path.join(test_self._temp_dir,'test/results') test_result_path_root = os.path.join(test_self._temp_dir,'test/results')
os.makedirs(test_result_path_root) os.makedirs(test_result_path_root)
...@@ -644,6 +653,13 @@ branch = foo ...@@ -644,6 +653,13 @@ branch = foo
original_sleep = time.sleep original_sleep = time.sleep
time.sleep = doNothing time.sleep = doNothing
self.generateTestRepositoryList() self.generateTestRepositoryList()
if my_test_type == "ScalabilityTest":
original_getSlaposAccountKey = TaskDistributor.getSlaposAccountKey
original_getSlaposAccountCertificate = TaskDistributor.getSlaposAccountCertificate
original_generateConfiguration = TaskDistributor.generateConfiguration
TaskDistributor.getSlaposAccountKey = patch_getSlaposAccountKey
TaskDistributor.getSlaposAccountCertificate = patch_getSlaposAccountCertificate
TaskDistributor.generateConfiguration = patch_generateConfiguration
original_startTestSuite = TaskDistributor.startTestSuite original_startTestSuite = TaskDistributor.startTestSuite
original_subscribeNode = TaskDistributor.subscribeNode original_subscribeNode = TaskDistributor.subscribeNode
original_getTestType = TaskDistributor.getTestType original_getTestType = TaskDistributor.getTestType
...@@ -664,6 +680,10 @@ branch = foo ...@@ -664,6 +680,10 @@ branch = foo
checkTestSuite(test_node) checkTestSuite(test_node)
time.sleep = original_sleep time.sleep = original_sleep
# Restore old class methods # Restore old class methods
if my_test_type == "ScalabilityTest":
TaskDistributor.getSlaposAccountKey = original_getSlaposAccountKey
TaskDistributor.getSlaposAccountCertificate = original_getSlaposAccountCertificate
TaskDistributor.generateConfiguration = original_generateConfiguration
TaskDistributor.startTestSuite = original_startTestSuite TaskDistributor.startTestSuite = original_startTestSuite
TaskDistributionTool.createTestResult = original_createTestResult TaskDistributionTool.createTestResult = original_createTestResult
TaskDistributionTool.subscribeNode = original_subscribeNode TaskDistributionTool.subscribeNode = original_subscribeNode
......
...@@ -101,6 +101,7 @@ class ScalabilityTestRunner(): ...@@ -101,6 +101,7 @@ class ScalabilityTestRunner():
signal.signal(signal.SIGINT, self._getSignal) signal.signal(signal.SIGINT, self._getSignal)
def _comeBackFromDummySlapOS(self): def _comeBackFromDummySlapOS(self):
print "Dummy slapOS answer disabled, don't press crtl+c anymore." print "Dummy slapOS answer disabled, don't press crtl+c anymore."
# use SIG_USR (kill)
signal.signal(signal.SIGINT, signal.SIG_DFL) signal.signal(signal.SIGINT, signal.SIG_DFL)
def simulateSlapOSAnswer(self): def simulateSlapOSAnswer(self):
if len(self.last_slapos_answer)==0: if len(self.last_slapos_answer)==0:
...@@ -184,6 +185,7 @@ class ScalabilityTestRunner(): ...@@ -184,6 +185,7 @@ class ScalabilityTestRunner():
self._comeBackFromDummySlapOS() self._comeBackFromDummySlapOS()
if self.remainSoftwareToInstall() : if self.remainSoftwareToInstall() :
return {'status_code' : 1} return {'status_code' : 1}
self.testnode.log("Softwares installed")
return {'status_code' : 0} return {'status_code' : 0}
def _cleanUpNodesInformation(self): def _cleanUpNodesInformation(self):
......
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