Commit 8717c124 authored by Benjamin Blanc's avatar Benjamin Blanc

util: testnode up

parent 4e70b15d
...@@ -55,10 +55,9 @@ class ScalabilityLauncher(object): ...@@ -55,10 +55,9 @@ class ScalabilityLauncher(object):
metavar='ERP5_URL', metavar='ERP5_URL',
help='Main url of ERP5 instance to test') help='Main url of ERP5 instance to test')
parser.add_argument('--test-result-url', parser.add_argument('--test-result-path',
metavar='ERP5_TEST_RESULT_URL', metavar='ERP5_TEST_RESULT_PATH',
help='ERP5 URL to find test results corresponding ' help='ERP5 relative path of the test result')
'to the current running test_suite')
parser.add_argument('--revision', parser.add_argument('--revision',
metavar='REVISION', metavar='REVISION',
...@@ -69,9 +68,9 @@ class ScalabilityLauncher(object): ...@@ -69,9 +68,9 @@ class ScalabilityLauncher(object):
help='Title of the testnode which is running this' help='Title of the testnode which is running this'
'launcher') 'launcher')
parser.add_argument('--portal-url', parser.add_argument('--test-suite-master-url',
metavar='PORTAL_URL', metavar='TEST_SUITE_MASTER_URL',
help='Url to connect to ERP5 Master portal') help='Url to connect to the ERP5 Master testsuite taskditributor')
parser.add_argument('--log-path', parser.add_argument('--log-path',
metavar='LOG_PATH', metavar='LOG_PATH',
...@@ -117,6 +116,14 @@ class ScalabilityLauncher(object): ...@@ -117,6 +116,14 @@ class ScalabilityLauncher(object):
start_time = time.time() start_time = time.time()
error_message_set, exit_status = set(), 0 error_message_set, exit_status = set(), 0
test_result = taskdistribution.TestResultProxyProxy(
self.__argumentNamespace.test_suite_master_url,
1.0, self.log,
self.__argumentNamespace.test_result_path,
self.__argumentNamespace.node_title,
self.__argumentNamespace.revision
)
#self.log("%s", self.test_result.isAlive()) #self.log("%s", self.test_result.isAlive())
while time.time()-start_time < max_time: while time.time()-start_time < max_time:
......
...@@ -382,18 +382,27 @@ class TestResultProxyProxy(TestResultProxy): ...@@ -382,18 +382,27 @@ class TestResultProxyProxy(TestResultProxy):
""" """
A wrapper/proxy to TestResultProxy A wrapper/proxy to TestResultProxy
""" """
def __init__(self, portal_url, retry_time, logger, test_result_path, def __init__(self, test_suite_master_url, retry_time, logger, test_result_path,
node_title, revision): node_title, revision):
try: try:
proxy = ServerProxy( proxy = ServerProxy(
portal_url, portal_url,
allow_none=True, allow_none=True,
) ).portal_task_distribution
except: except:
raise ValueError("Cannot instanciate ServerProxy") raise ValueError("Cannot instanciate ServerProxy")
TestResultProxy.__init__(self, proxy, retry_time, logger, test_result_path, TestResultProxy.__init__(self, proxy, retry_time, logger, test_result_path,
node_title, revision) node_title, revision)
def getNextTestResultLinePath(self):
"""
A proxy to getNextTestResultLinePath
Return the relative path of the test with the running state
"""
return bool(self._retryRPC('getNextTestResultLinePath', [self._test_result_path]))
class ServerProxy(xmlrpclib.ServerProxy): class ServerProxy(xmlrpclib.ServerProxy):
......
...@@ -109,6 +109,7 @@ class ScalabilityTestRunner(): ...@@ -109,6 +109,7 @@ class ScalabilityTestRunner():
config.update({'scalability-launcher-title':'MyTestNodeTitle'}) config.update({'scalability-launcher-title':'MyTestNodeTitle'})
config.update({'test-result-path':test_result.test_result_path}) config.update({'test-result-path':test_result.test_result_path})
config.update({'test-suite-revision':test_result.revision}) config.update({'test-suite-revision':test_result.revision})
config.update({'test-suite-master-url':self.config['test_suite_master_url']})
return config return config
def _createInstance(self, software_path, software_configuration, instance_title, def _createInstance(self, software_path, software_configuration, instance_title,
...@@ -293,13 +294,16 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -293,13 +294,16 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
count = 0 count = 0
for configuration in configuration_list: for configuration in configuration_list:
# Here: update instance XML
# Wait for ready status from slapos
# Start only the current test # Start only the current test
exclude_list=[x for x in test_list if x!=test_list[count]] exclude_list=[x for x in test_list if x!=test_list[count]]
count += 1 count += 1
test_result_line_proxy = test_result_proxy.start(exclude_list) test_result_line_proxy = test_result_proxy.start(exclude_list)
self.log("Test for count : %d is in a running state." %count) self.log("Test for count : %d is in a running state." %count)
while test_result_line_proxy.isRunning() and test_result_proxy.isAlive(): while test_result_line_proxy.isRunning() and test_result_proxy.isAlive():
time.sleep(10) time.sleep(15)
pass pass
if test_result_line_proxy.isCompleted(): if test_result_line_proxy.isCompleted():
self.log("Test completed.") self.log("Test completed.")
......
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