Commit 4aaaaf86 authored by Roque's avatar Roque Committed by Klaus Wölfel

tesnode: more generic get frontend information method in slapos master communicator

parent 23a5a1f0
...@@ -104,7 +104,7 @@ class SlapOSMasterCommunicator(object): ...@@ -104,7 +104,7 @@ class SlapOSMasterCommunicator(object):
self.latest_state = state self.latest_state = state
return self.slap_order.request( return self.slap_order.request(
software_release=self.url, software_release=self.url,
software_type="RootSoftwareInstance", software_type=software_type,
partition_reference=self.name, partition_reference=self.name,
shared=shared, shared=shared,
state=state, state=state,
...@@ -450,9 +450,11 @@ class SlapOSTester(SlapOSMasterCommunicator): ...@@ -450,9 +450,11 @@ class SlapOSTester(SlapOSMasterCommunicator):
pass pass
return {'instance_guid' : self.instance.getInstanceGuid(), 'frontend_master_ipv6' : frontend_master_ipv6} return {'instance_guid' : self.instance.getInstanceGuid(), 'frontend_master_ipv6' : frontend_master_ipv6}
# XXX TODO
# In the future, this should allow customization so each project to be tested parses its own information,
# probably in the test suite definition class
def getInstanceUrlDict(self): def getInstanceUrlDict(self):
frontend_url_list = [] frontend_url_list = []
zope_address_list = []
for instance in self.getInstanceUrlList(): for instance in self.getInstanceUrlList():
information = self.getInformationFromInstance(instance["href"]) information = self.getInformationFromInstance(instance["href"])
if "frontend-" in instance["title"]: if "frontend-" in instance["title"]:
...@@ -472,17 +474,7 @@ class SlapOSTester(SlapOSMasterCommunicator): ...@@ -472,17 +474,7 @@ class SlapOSTester(SlapOSMasterCommunicator):
password = connection_json["inituser-password"] password = connection_json["inituser-password"]
except Exception as e: except Exception as e:
raise ValueError("user and password not found in connection parameters. Error while instantiating?") raise ValueError("user and password not found in connection parameters. Error while instantiating?")
if "zope-" in instance["title"]: return {'user' : user, 'password' : password, 'frontend-url-list' : frontend_url_list }
try:
connection_dict = information["connection_dict"]["_"]
address = json.loads(connection_dict)["zope-address-list"][0][0]
zope = [instance["title"].replace("zope-", ""), address]
zope_address_list.append(zope)
except Exception as e:
logger.info("zope address not found in connection parameters. Error while instantiating?")
pass
return {'zope-address-list' : zope_address_list, 'user' : user,
'password' : password, 'frontend-url-list' : frontend_url_list }
class SoftwareReleaseTester(SlapOSTester): class SoftwareReleaseTester(SlapOSTester):
deadline = None deadline = None
......
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