Commit 4d50b6ca authored by Benjamin Blanc's avatar Benjamin Blanc

Change 'dict of list' to 'dict' in the software installation control of ScalabilityTestRunner

parent 4cf2bb01
...@@ -60,7 +60,7 @@ class ScalabilityTestRunner(): ...@@ -60,7 +60,7 @@ class ScalabilityTestRunner():
self.testnode.config) self.testnode.config)
self.remaining_software_installation_grid = {} self.remaining_software_installation_dict = {}
# Protection to prevent installation of softwares after checking # Protection to prevent installation of softwares after checking
self.authorize_supply = True self.authorize_supply = True
...@@ -74,10 +74,7 @@ class ScalabilityTestRunner(): ...@@ -74,10 +74,7 @@ class ScalabilityTestRunner():
""" """
self.testnode.log("testnode, supply : %s %s", software_path, computer_guid) self.testnode.log("testnode, supply : %s %s", software_path, computer_guid)
if self.authorize_supply : if self.authorize_supply :
if not computer_guid in self.remaining_software_installation_grid: self.remaining_software_installation_dict[computer_guid] = software_path
# Add computer_guid to the grid if it isn't
self.remaining_software_installation_grid[computer_guid] = []
self.remaining_software_installation_grid[computer_guid].append(software_path)
self.slapos_controler.supply(software_path, computer_guid) self.slapos_controler.supply(software_path, computer_guid)
# Here make a request via slapos controler ? # Here make a request via slapos controler ?
return {'status_code' : 0} return {'status_code' : 0}
...@@ -104,7 +101,7 @@ class ScalabilityTestRunner(): ...@@ -104,7 +101,7 @@ class ScalabilityTestRunner():
late a SlapOS (positive) answer." %(str(os.getpid()),) late a SlapOS (positive) answer." %(str(os.getpid()),)
signal.signal(signal.SIGTERM, self._getSignal) signal.signal(signal.SIGTERM, self._getSignal)
def _comeBackFromDummySlapOS(self): def _comeBackFromDummySlapOS(self):
print "Dummy slapOS answer disabled" print "Dummy slapOS answer disabled, please don't send more signals."
# use SIG_USR (kill) # use SIG_USR (kill)
signal.signal(signal.SIGTERM, signal.SIG_DFL) signal.signal(signal.SIGTERM, signal.SIG_DFL)
def simulateSlapOSAnswer(self): def simulateSlapOSAnswer(self):
...@@ -128,14 +125,11 @@ late a SlapOS (positive) answer." %(str(os.getpid()),) ...@@ -128,14 +125,11 @@ late a SlapOS (positive) answer." %(str(os.getpid()),)
Return True if it remains softwares to install, otherwise return False Return True if it remains softwares to install, otherwise return False
""" """
# Remove from grid installed software entries # Remove from grid installed software entries
for computer_guid,v in self.remaining_software_installation_grid.items(): for computer_guid, software_path in self.remaining_software_installation_dict.items():
for software_url in v: if self.isSoftwareReleaseReady(software_path, computer_guid):
if self.isSoftwareReleaseReady(software_url, computer_guid): del self.remaining_software_installation_dict[computer_guid]
self.remaining_software_installation_grid[computer_guid].remove(software_url)
if len(self.remaining_software_installation_grid[computer_guid])==0:
del self.remaining_software_installation_grid[computer_guid]
# Not empty grid means that all softwares are not installed # Not empty grid means that all softwares are not installed
return len(self.remaining_software_installation_grid) > 0 return len(self.remaining_software_installation_dict) > 0
def prepareSlapOSForTestSuite(self, node_test_suite): def prepareSlapOSForTestSuite(self, node_test_suite):
""" """
...@@ -227,7 +221,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),) ...@@ -227,7 +221,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),)
def _cleanUpNodesInformation(self): def _cleanUpNodesInformation(self):
self.involved_nodes_computer_guid = [] self.involved_nodes_computer_guid = []
self.launcher_nodes_computer_guid = [] self.launcher_nodes_computer_guid = []
self.remaining_software_installation_grid = {} self.remaining_software_installation_dict = {}
self.authorize_supply = True self.authorize_supply = True
def runTestSuite(self, node_test_suite, portal_url, log=None): def runTestSuite(self, node_test_suite, portal_url, log=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