Commit 6b7b86fe authored by Benjamin Blanc's avatar Benjamin Blanc

util: testnode: use dummy slapos answer with signal for getting instance state

parent f3e17cc8
...@@ -68,6 +68,7 @@ class ScalabilityTestRunner(): ...@@ -68,6 +68,7 @@ class ScalabilityTestRunner():
self.authorize_request = False self.authorize_request = False
# Used to simulate SlapOS answer (used as a queue) # Used to simulate SlapOS answer (used as a queue)
self.last_slapos_answer = [] self.last_slapos_answer = []
self.last_slapos_answer_request = []
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
...@@ -169,6 +170,15 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -169,6 +170,15 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
# this simulate a SlapOS answer # this simulate a SlapOS answer
return self.simulateSlapOSAnswer() return self.simulateSlapOSAnswer()
def isInstanceReady(self, instance_title):
"""
Return true if the specified instance is ready.
This method should communicates with SlapOS Master.
"""
# TODO : implement -> communication with SlapOS master
# this simulate a SlapOS answer
return self.simulateSlapOSAnswer()
def remainSoftwareToInstall(self): def remainSoftwareToInstall(self):
""" """
Return True if it remains softwares to install, otherwise return False Return True if it remains softwares to install, otherwise return False
...@@ -304,9 +314,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -304,9 +314,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self._updateInstanceXML(self.reachable_profile, configuration, self.instance_title, self._updateInstanceXML(self.reachable_profile, configuration, self.instance_title,
node_test_suite.test_result, node_test_suite.test_suite) node_test_suite.test_result, node_test_suite.test_suite)
# Wait for ready status from slapos # Wait for ready status from slapos
self.log("Wait for instance ready to test. Sleep for 300s.") self.log("Wait for instance ready to test..")
time.sleep(300) self.log("Master testnode is waiting\
self.log("300s elapsed.") do (kill -10 %s) to continue...", str(os.getpid()))
while (not self.isSoftwareReleaseReady(self.instance_title)):
time.sleep(5)
pass
self.log("Answer received.")
# Start only the current test # Start only the current test
exclude_list=[x for x in test_list if x!=test_list[count]] exclude_list=[x for x in test_list if x!=test_list[count]]
......
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