Commit a0436e5d authored by Benjamin Blanc's avatar Benjamin Blanc

testnode: scalability: Use request to update XML configuration

parent 4e2da560
......@@ -121,7 +121,8 @@ class ScalabilityTestRunner():
test_result, test_suite)
self.log("testnode, request : %s", instance_title)
self.slapos_controler.request(instance_title, software_path,
"scalability", {"_" : config})
"scalability", {"_" : config},
self.launcher_nodes_computer_guid[0])
self.authorize_request = False
return {'status_code' : 0}
else:
......@@ -179,12 +180,19 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
# Not empty grid means that all softwares are not installed
return len(self.remaining_software_installation_dict) > 0
def _updateInstanceXML(self, software_path, computer_guid, xml):
def _updateInstanceXML(self, software_path, software_configuration, instance_title,
test_result, test_suite):
"""
Just a proxy to SlapOSControler.updateInstanceXML.
"""
# use _generateInstanceXML...;
self.slapos_controler.updateInstanceXML(software_path, computer_guid, xml)
config = self._generateInstanceXML(software_path, software_configuration,
test_result, test_suite)
self.log("testnode, updateInstanceXML : %s", instance_title)
self.slapos_controler.updateInstanceXML(instance_title, software_path,
"scalability", {"_" : config},
self.launcher_nodes_computer_guid[0])
self.authorize_request = False
return {'status_code' : 0}
def prepareSlapOSForTestSuite(self, node_test_suite):
"""
......
......@@ -168,35 +168,17 @@ class SlapOSControler(object):
else:
raise ValueError("Configuration file not found.")
def updateInstanceXML(self, software_url, computer_id, xml):
def updateInstanceXML(self, reference,
software_url, software_type, software_configuration, computer_guid=None):
"""
Update the XML configuration of an instance
# If doesn't work, try to re-request same instance just with an other
xml onfiguration.
# Request same instance with different parameters.
"""
self.log('SlapOSControler : updateInstanceXML')
parser = argparse.ArgumentParser()
parser.add_argument("configuration_file")
parser.add_argument("software_url")
parser.add_argument("node")
if os.path.exists(self.configuration_file_path):
args = parser.parse_args([self.configuration_file_path, software_url, computer_id])
config = client.Config()
config.setConfig(args, args.configuration_file)
try:
slap = slapos.slap.slap()
slap.initializeConnection(config.master_url,
key_file=config.key_file,
cert_file=config.cert_file)
computer = slap.registerComputer(computer_id)
computer.updateConfiguration(xml)
self.log('SlapOSControler : updateInstanceXML %s' %(xml,))
except:
self.log("SlapOSControler.updateInstanceXML, \
exception in registerOpenOrder", exc_info=sys.exc_info())
raise ValueError("Unable to updateInstanceXML")
else:
raise ValueError("Configuration file not found.")
self.log('SlapOSControler : updateInstanceXML will request same'
'instance with new XML configuration...')
self.request(reference,
software_url, software_type, software_configuration, computer_guid)
def _resetSoftware(self):
self.log('SlapOSControler : GOING TO RESET ALL SOFTWARE : %r' %
......
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