Commit 67309098 authored by Benjamin Blanc's avatar Benjamin Blanc

testnode: update

parent 2b4a5b6b
...@@ -46,8 +46,10 @@ from erp5.util import taskdistribution ...@@ -46,8 +46,10 @@ from erp5.util import taskdistribution
# for dummy slapos answer # for dummy slapos answer
import signal import signal
MAX_INSTANCE_TIME = 60*60 # 1 hour # max time to instance changing state: 1 hour
MAX_CREATION_INSTANCE_TIME = 60*5 # 5 minutes MAX_INSTANCE_TIME = 60*60
# max time to register instance to slapOSMaster: 5 minutes
MAX_CREATION_INSTANCE_TIME = 60*5
class ScalabilityTestRunner(): class ScalabilityTestRunner():
def __init__(self, testnode): def __init__(self, testnode):
...@@ -355,12 +357,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -355,12 +357,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
count += 1 count += 1
test_result_line_proxy = test_result_proxy.start(exclude_list) test_result_line_proxy = test_result_proxy.start(exclude_list)
if test_result_line_proxy == None : if test_result_line_proxy == None :
self.log("Already tested.") #self.log("Already tested.")
error = ValueError("Test already tested.") #error = ValueError("Test already tested.")
self.log("Warning::Test already tested.")
break; break;
# TODO: use only isAlive() and change test_result workflow on ERP5 Master side for the scalability case # TODO: use only isAlive() and change test_result workflow on ERP5 Master side for the scalability case
self.log("Test for count : %d is in a running state." %count) sel)f.log("Test for count : %d is in a running state." %count)
while test_result_line_proxy.isRunning() and test_result_proxy.isAlive(): while test_result_line_proxy.isRunning() and test_result_proxy.isAlive():
time.sleep(15) time.sleep(15)
pass pass
...@@ -394,7 +397,9 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -394,7 +397,9 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
error = ValueError("Test case is in an undeterminated state") error = ValueError("Test case is in an undeterminated state")
break; break;
# Destroy instance
self.slapos_controler.destroyInstance(self.instance_title) self.slapos_controler.destroyInstance(self.instance_title)
self._waitInstance(self.instance_title, 'destroyed')
if error: if error:
test_result_proxy.fail() test_result_proxy.fail()
......
...@@ -150,7 +150,7 @@ class SlapOSControler(object): ...@@ -150,7 +150,7 @@ class SlapOSControler(object):
'kvm.cfg', 'cluster', { "_" : "{'toto' : 'titi'}" } ) 'kvm.cfg', 'cluster', { "_" : "{'toto' : 'titi'}" } )
""" """
self.log('SlapOSControler : request') self.log('SlapOSControler : request-->SlapOSMaster')
current_intance_config = {'software_type':software_type, current_intance_config = {'software_type':software_type,
'software_configuration':software_configuration, 'software_configuration':software_configuration,
'computer_guid':computer_guid, 'computer_guid':computer_guid,
......
...@@ -55,14 +55,14 @@ class SlapOSMasterCommunicator(object): ...@@ -55,14 +55,14 @@ class SlapOSMasterCommunicator(object):
def _getConnection(self,certificate_path, key_path, url): def _getConnection(self,certificate_path, key_path, url):
api_scheme, api_netloc, api_path, api_query, api_fragment = urlparse.urlsplit(url) api_scheme, api_netloc, api_path, api_query, api_fragment = urlparse.urlsplit(url)
self.log("HTTPS Connection with: %s, cert=%s, key=%s" %(api_netloc,key_path,certificate_path)) #self.log("HTTPS Connection with: %s, cert=%s, key=%s" %(api_netloc,key_path,certificate_path))
return httplib.HTTPSConnection(api_netloc, key_file=key_path, cert_file=certificate_path) return httplib.HTTPSConnection(api_netloc, key_file=key_path, cert_file=certificate_path)
def _curl(self, link): def _curl(self, link):
""" """
'link' must look like : {'href':url,'type':content_type} 'link' must look like : {'href':url,'type':content_type}
""" """
self.log("_curl with: url:%s content_type:%s" %(link['href'], link['type'])) #.log("_curl with: url:%s content_type:%s" %(link['href'], link['type']))
api_scheme, api_netloc, api_path, api_query, api_fragment = urlparse.urlsplit(link['href']) api_scheme, api_netloc, api_path, api_query, api_fragment = urlparse.urlsplit(link['href'])
# Try to use existing conection # Try to use existing conection
try: try:
...@@ -184,4 +184,12 @@ class SlapOSMasterCommunicator(object): ...@@ -184,4 +184,12 @@ class SlapOSMasterCommunicator(object):
if self.hosting_subcriptions_dict.get(hosting_subscription_title): if self.hosting_subcriptions_dict.get(hosting_subscription_title):
return True return True
return False return False
def getAliveHostingSubscription(self, prefix_title):
"""
Return list of dict information of alive hosting subscrtion
"""
return []
\ No newline at end of file
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