Commit c78c7358 authored by Gabriel Monnerat's avatar Gabriel Monnerat Committed by Sebastien Robin

Refactor code to request installation and instanciation of external profiles...

Refactor code to request installation and instanciation of external profiles passed on parameter dict
parent bb307fb5
...@@ -30,6 +30,7 @@ import subprocess ...@@ -30,6 +30,7 @@ import subprocess
import time import time
import xml_marshaller import xml_marshaller
import shutil import shutil
import glob
MAX_PARTIONS = 10 MAX_PARTIONS = 10
MAX_SR_RETRIES = 3 MAX_SR_RETRIES = 3
...@@ -61,10 +62,12 @@ class SlapOSControler(object): ...@@ -61,10 +62,12 @@ class SlapOSControler(object):
self.slap = slap self.slap = slap
self.slap.initializeConnection(config['master_url']) self.slap.initializeConnection(config['master_url'])
# register software profile # register software profile
self.software_profile = config['custom_profile_path'] self.software_path_list = config.get("software_list", [])
slap.registerSupply().supply( self.software_path_list.append(config['custom_profile_path'])
self.software_profile, for path in self.software_path_list:
computer_guid=config['computer_id']) slap.registerSupply().supply(
path,
computer_guid=config['computer_id'])
computer = slap.registerComputer(config['computer_id']) computer = slap.registerComputer(config['computer_id'])
# Reset all previously generated software if needed # Reset all previously generated software if needed
if reset_software: if reset_software:
...@@ -129,8 +132,14 @@ class SlapOSControler(object): ...@@ -129,8 +132,14 @@ class SlapOSControler(object):
self.log("SlapOSControler.runComputerPartition") self.log("SlapOSControler.runComputerPartition")
# cloudooo-json is required but this is a hack which should be removed # cloudooo-json is required but this is a hack which should be removed
config['instance_dict']['cloudooo-json'] = "{}" config['instance_dict']['cloudooo-json'] = "{}"
self.slap.registerOpenOrder().request(self.software_profile, # report-url, report-project and suite-url are required to seleniumrunner
partition_reference='testing partition', # instance. This is a hack which must be removed.
config['instance_dict']['report-url'] = config.get("report-url", "")
config['instance_dict']['report-project'] = config.get("report-project", "")
config['instance_dict']['suite-url'] = config.get("suite-url", "")
for path in self.software_path_list:
self.slap.registerOpenOrder().request(path,
partition_reference='testing partition %s' % self.software_path_list.index(path),
partition_parameter_kw=config['instance_dict']) partition_parameter_kw=config['instance_dict'])
# try to run for all partitions as one partition may in theory request another one # try to run for all partitions as one partition may in theory request another one
......
...@@ -123,5 +123,9 @@ def main(*args): ...@@ -123,5 +123,9 @@ def main(*args):
else: else:
instance_dict = {} instance_dict = {}
CONFIG['instance_dict'] = instance_dict CONFIG['instance_dict'] = instance_dict
if 'software_list' in config.sections():
CONFIG['software_list'] = filter(None,
config.get("software_list", "path_list").split(","))
testnode = TestNode(logger.info, CONFIG) testnode = TestNode(logger.info, CONFIG)
testnode.run() testnode.run()
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