Commit 5309bdf4 authored by Benjamin Blanc's avatar Benjamin Blanc

testnode: ScalabilityTestRunner: Add getting slapos API REST url from ERP5 Master

parent 7ac59050
...@@ -575,6 +575,13 @@ class TaskDistributor(RPCRetry): ...@@ -575,6 +575,13 @@ class TaskDistributor(RPCRetry):
Returns the url of slapos master related to the distributor Returns the url of slapos master related to the distributor
""" """
return self._retryRPC('getSlaposUrl') return self._retryRPC('getSlaposUrl')
def getSlaposHateoasUrl(self):
"""
Returns the url of API REST using hateoas of
slapos master related to the distributor
"""
return self._retryRPC('getSlaposHateoasUrl')
class DummyTaskDistributionTool(object): class DummyTaskDistributionTool(object):
......
...@@ -63,19 +63,31 @@ class ScalabilityTestRunner(): ...@@ -63,19 +63,31 @@ class ScalabilityTestRunner():
# Create the slapos account configuration file and dir # Create the slapos account configuration file and dir
key = self.testnode.test_suite_portal.getSlaposAccountKey() key = self.testnode.test_suite_portal.getSlaposAccountKey()
certificate = self.testnode.test_suite_portal.getSlaposAccountCertificate() certificate = self.testnode.test_suite_portal.getSlaposAccountCertificate()
# Get Slapos Master Url # Get Slapos Master Url
slapos_url = '' self.slapos_url = ''
try:
self.slapos_url = self.testnode.test_suite_portal.getSlaposUrl()
if not self.slapos_url:
self.slapos_url = self.testnode.config['server_url']
except:
self.slapos_url = self.testnode.config['server_url']
# Get Slapos Master url used for api rest (using hateoas)
self.slapos_api_rest_url = ""
try: try:
slapos_url = self.testnode.test_suite_portal.getSlaposUrl() self.slapos_api_rest_url = self.testnode.test_suite_portal.getSlaposHateoasUrl()
if not slapos_url: if not self.slapos_api_rest_url:
slapos_url = self.testnode.config['server_url'] self.slapos_api_rest_url = self.testnode.config['hateoas_slapos_master_url']
except: except:
slapos_url = self.testnode.config['server_url'] self.slapos_api_rest_url = self.testnode.config['hateoas_slapos_master_url']
self.log("SlapOS Master url is: %s" %slapos_url) self.log("SlapOS Master url is: %s" %self.slapos_url)
self.key_path, self.cert_path, config_path = self.slapos_controler.createSlaposConfigurationFileAccount( self.key_path, self.cert_path, config_path = self.slapos_controler.createSlaposConfigurationFileAccount(
key, certificate, slapos_url, self.testnode.config) key, certificate, self.slapos_url, self.testnode.config)
self.slapos_communicator = None self.slapos_communicator = None
self.remaining_software_installation_dict = {} self.remaining_software_installation_dict = {}
...@@ -250,7 +262,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -250,7 +262,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self.cert_path, self.cert_path,
self.key_path, self.key_path,
self.log, self.log,
self.testnode.config['hateoas_slapos_master_url']) self.slapos_api_rest_url)
# Only master testnode must order software installation # Only master testnode must order software installation
if self.testnode.test_suite_portal.isMasterTestnode( if self.testnode.test_suite_portal.isMasterTestnode(
self.testnode.config['test_node_title']): self.testnode.config['test_node_title']):
......
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