Commit 59989cb5 authored by Benjamin Blanc's avatar Benjamin Blanc

Up

parent d5fc9b4a
...@@ -70,9 +70,9 @@ class ScalabilityTestRunner(): ...@@ -70,9 +70,9 @@ class ScalabilityTestRunner():
""" """
A proxy to supply : Install a software on a specific node A proxy to supply : Install a software on a specific node
""" """
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): if not computer_guid in self.remaining_software_installation_grid:
# Add computer_guid to the grid if it isn't # Add computer_guid to the grid if it isn't
self.remaining_software_installation_grid[computer_guid] = [] self.remaining_software_installation_grid[computer_guid] = []
self.remaining_software_installation_grid[computer_guid].append(software_path) self.remaining_software_installation_grid[computer_guid].append(software_path)
...@@ -94,26 +94,27 @@ class ScalabilityTestRunner(): ...@@ -94,26 +94,27 @@ class ScalabilityTestRunner():
return {'status_code' : 0} return {'status_code' : 0}
def isSoftwareReleaseReady(self, software_url, computer_guid): def isSoftwareReleaseReady(self, software_url, computer_guid):
# TODO : implement this method # TODO : implement this method
# -> communication with SlapOS master # -> communication with SlapOS master
# todo : simulate slapOS Master answer
# todo : simulate slapOS Master answer return False
return False
def remainSoftwareToInstall(self): def remainSoftwareToInstall(self):
""" """
Return True if all softwares are installed, otherwise return False Return True if all softwares are installed, 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: print "self.remaining_software_installation_grid:"
for software_url in v: print self.remaining_software_installation_grid
if isSoftwareReleaseReady(software_url, computer_guid):
self.remaining_software_installation_grid[computer_guid].remove(software_url) for computer_guid,v in self.remaining_software_installation_grid:
if len(self.remaining_software_installation_grid[computer_guid])==0: for software_url in v:
del self.remaining_software_installation_grid[computer_guid] if isSoftwareReleaseReady(software_url, computer_guid):
# Empty grid means that all softwares are installed self.remaining_software_installation_grid[computer_guid].remove(software_url)
return len(self.remaining_software_installation_grid)==0 if len(self.remaining_software_installation_grid[computer_guid])==0:
del self.remaining_software_installation_grid[computer_guid]
# Empty grid means that all softwares are installed
return len(self.remaining_software_installation_grid)==0
def prepareSlapOSForTestSuite(self, node_test_suite): def prepareSlapOSForTestSuite(self, node_test_suite):
""" """
...@@ -124,44 +125,45 @@ class ScalabilityTestRunner(): ...@@ -124,44 +125,45 @@ class ScalabilityTestRunner():
start_time = time.time() start_time = time.time()
# #
if self.testnode.test_suite_portal.isValidatedMaster( if self.testnode.test_suite_portal.isValidatedMaster(
self.testnode.config['test_node_title']): self.testnode.config['test_node_title']):
# Get from ERP5 Master the configuration of the cluster for the test # Get from ERP5 Master the configuration of the cluster for the test
test_configuration = testnodeUtils.deunicodeData( test_configuration = testnodeUtils.deunicodeData(
json.loads( json.loads(self.testnode.test_suite_portal.generateConfiguration(
self.testnode.test_suite_portal.generateConfiguration( node_test_suite.test_suite_title)
node_test_suite.test_suite_title))) )
self.involved_nodes_computer_guid = test_configuration['involved_nodes_computer_guid'] )
self.launchable = test_configuration['launchable'] self.involved_nodes_computer_guid = test_configuration['involved_nodes_computer_guid']
self.error_message = test_configuration['error_message'] self.launchable = test_configuration['launchable']
if not self.launchable: self.error_message = test_configuration['error_message']
self.testnode.log("Test suite %s is not actually launchable with \ if not self.launchable:
the current cluster configuration." %(node_test_suite.test_suite_title,)) self.testnode.log("Test suite %s is not actually launchable with \
self.testnode.log("ERP5 Master indicates : %s" %(self.error_message,)) the current cluster configuration." %(node_test_suite.test_suite_title,))
self.testnode.log("ERP5 Master indicates : %s" %(self.error_message,))
# wich code to return ? # wich code to return ?
return {'status_code' : 1} return {'status_code' : 1}
involved_nodes_computer_guid = test_configuration['involved_nodes_computer_guid'] involved_nodes_computer_guid = test_configuration['involved_nodes_computer_guid']
configuration_list = test_configuration['configuration_list'] configuration_list = test_configuration['configuration_list']
launcher_nodes_computer_guid = test_configuration['launcher_nodes_computer_guid'] launcher_nodes_computer_guid = test_configuration['launcher_nodes_computer_guid']
software_path_list = [] software_path_list = []
# Here add the ipv6 url reachable from master profile # Here add the ipv6 url reachable from master profile
software_path_list.append("http://foo.bar/It_is_a_test_for_scalability_test/My_unreachable_profile.cfg") software_path_list.append("http://foo.bar/It_is_a_test_for_scalability_test/My_unreachable_profile.cfg")
# Ask for softwares installation # Ask for softwares installation
for software_path in software_path_list: for software_path in software_path_list:
for computer_guid in self.involved_nodes_computer_guid: for computer_guid in self.involved_nodes_computer_guid:
self._prepareSlapOS(software_path, computer_guid) self._prepareSlapOS(software_path, computer_guid)
# From the line below we would not supply any more softwares # From the line below we would not supply any more softwares
self.authorize_supply = False self.authorize_supply = False
# Waiting until all softwares are installed # Waiting until all softwares are installed
while ( self.remainSoftwareToInstall() while ( self.remainSoftwareToInstall()
and (max_time <= time.time()-start_time)): and (max_time <= time.time()-start_time)):
self.testnode.log("Master testnode is waiting\ self.testnode.log("Master testnode is waiting\
for the end of all software installation.") for the end of all software installation.")
time.sleep(15) time.sleep(15)
# We were wainting for too long time, that's a failure. # We were wainting for too long time, that's a failure.
if self.remainSoftwareToInstall() : if self.remainSoftwareToInstall() :
return {'status_code' : 1} return {'status_code' : 1}
return {'status_code' : 0} return {'status_code' : 0}
def _cleanUpNodesInformation(self): def _cleanUpNodesInformation(self):
......
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