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

util: testnode up

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