Commit 714db6c4 authored by Benjamin Blanc's avatar Benjamin Blanc

Major up

parent bdd5177c
...@@ -68,7 +68,7 @@ class ScalabilityTestRunner(): ...@@ -68,7 +68,7 @@ class ScalabilityTestRunner():
def _prepareSlapOS(self, software_path, computer_guid, create_partition=0): def _prepareSlapOS(self, software_path, computer_guid, create_partition=0):
# create_partition is kept for compatibility # create_partition is kept for compatibility
""" """
A proxy to supply : Install software 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 == True : if self.authorize_supply == True :
...@@ -90,85 +90,73 @@ class ScalabilityTestRunner(): ...@@ -90,85 +90,73 @@ class ScalabilityTestRunner():
self.testnode.config['test_node_title']): self.testnode.config['test_node_title']):
# software_path_list = [] # software_path_list = []
# software_path_list.append(self.testnode.config.get("software_list")) # software_path_list.append(self.testnode.config.get("software_list"))
# for software_path in software_path_list: return {'status_code' : 0}
# for launcher_node in self.????_nodes:
# self._prepareSlapOS(software_path, launcher_node['computer_id'])
# TODO : change the line below
return {'status_code' : 0}
else:
return {'status_code' : 0}
def isRemainingSoftwareToInstall(self): def remainSoftwareToInstall(self):
# Check SlapOS Master to know if softwares are ready
# and remove from self.remaining_software_installation_grid
# installed softwares.
print self.remaining_software_installation_grid print self.remaining_software_installation_grid
return True
return False
# Here we can
def prepareSlapOSForTestSuite(self, node_test_suite): def prepareSlapOSForTestSuite(self, node_test_suite):
""" """
Install all testsuite's software Install testsuite softwares
""" """
# In fact we just need to extract (by knowing the ipv6) # Define how many time this method can take
# softwares ipv6-url ( created during constructProfile(...) ) max_time = 3600*10 # 10 hours
#software_path_list = _extractSoftwarePathList(software_path_list) start_time = time.time()
# TODO : extract software paths (ipv6+local suite path+password?) from node_test_suite #
print "...isValidatedMaster(..):" if self.testnode.test_suite_portal.isValidatedMaster(
print 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
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)))
print "test_configuration:" self.involved_nodes_computer_guid = test_configuration['involved_nodes_computer_guid']
print test_configuration 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 self.launchable == False:
self.error_message = test_configuration['error_message'] self.testnode.log("Test suite %s is not actually launchable with \
the current cluster configuration." %(node_test_suite.test_suite_title,))
if self.launchable == False: self.testnode.log("ERP5 Master indicates : %s" %(self.error_message,))
self.testnode.log("Test suite %s is not actually launchable with \
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 = []
software_path_list.append("http://foo.bar/It_is_a_test_for_scalability_test/My_unreachable_profile.cfg") # Here add the ipv6 url reachable from master profile
for software_path in software_path_list: software_path_list.append("http://foo.bar/It_is_a_test_for_scalability_test/My_unreachable_profile.cfg")
for computer_guid in self.involved_nodes_computer_guid: # Ask for softwares installation
self._prepareSlapOS(software_path, computer_guid) for software_path in software_path_list:
# From the line below we would not supply any more softwares for computer_guid in self.involved_nodes_computer_guid:
self.authorize_supply = False self._prepareSlapOS(software_path, computer_guid)
# Here a loop while softwares are not all installed # From the line below we would not supply any more softwares
while self.isRemainingSoftwareToInstall() == False: self.authorize_supply = False
self.testnode.log("Master testnode is waiting\ # Waiting until all softwares are installed
for the end of all software installation.") while (self.remainSoftwareToInstall() == True)
time.sleep(15) and (max_time <= time.time()-start_time):
self.testnode.log("Master testnode is waiting\
for the end of all software installation.")
time.sleep(15)
# We were wainting for too long time, that's a failure.
if self.isRemainingSoftwareToInstall() == False:
return {'status_code' : 1}
return {'status_code' : 0} return {'status_code' : 0}
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 = []
def _generateConfigurationList(self, test_suite):
# TODO : implement it
return []
# TODO : define methods to check if involved nodes are okay etc..
# And if it's not end ans invalidate everything and retry/reloop
def runTestSuite(self, node_test_suite, portal_url, log=None): def runTestSuite(self, node_test_suite, portal_url, log=None):
# TODO : write code # TODO : write code
SlapOSControler.createFolder(node_test_suite.test_suite_directory, SlapOSControler.createFolder(node_test_suite.test_suite_directory,
clean=True) clean=True)
# create ResultLine for each loop # create ResultLine for each loop
pass pass
def getRelativePathUsage(self): def getRelativePathUsage(self):
......
...@@ -8,6 +8,8 @@ def deunicodeData(data): ...@@ -8,6 +8,8 @@ def deunicodeData(data):
new_data = data new_data = data
elif isinstance(data, str): elif isinstance(data, str):
new_data = data new_data = data
elif isinstance(data, bool):
new_data = data
elif isinstance(data, list): elif isinstance(data, list):
new_data = [] new_data = []
for sub_data in data: for sub_data in data:
......
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