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

testnode: ScalabilityTestRunner: Add stop/start instance step

parent 195a2e10
...@@ -294,6 +294,16 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -294,6 +294,16 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
""" """
return {'status_code' : 1} # Unable to continue due to not realizable configuration return {'status_code' : 1} # Unable to continue due to not realizable configuration
return {'status_code' : 0} return {'status_code' : 0}
# Used to simulate slapOS answer
def _waitInstance(self, instance_title):
self.log("Master testnode is waiting for a (dummy) SlapOS Master answer,\
(kill -10 %s) to continue...", str(os.getpid()))
self._prepareDummySlapOSAnswer()
while (not self.isInstanceReady(instance_title)):
time.sleep(5)
pass
self._comeBackFromDummySlapOS()
self.log("Answer received.")
def runTestSuite(self, node_test_suite, portal_url): def runTestSuite(self, node_test_suite, portal_url):
if not self.launchable: if not self.launchable:
...@@ -309,18 +319,19 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) ...@@ -309,18 +319,19 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
count = 0 count = 0
for configuration in configuration_list: for configuration in configuration_list:
# Update instance XML configuration
self._updateInstanceXML(configuration, self.instance_title, self._updateInstanceXML(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 self.log("Waiting for XML updating instance ready..")
self.log("Wait for instance ready to test..") _waitInstance(self.instance_title)
self.log("Master testnode is waiting\ # Stop instance
do (kill -10 %s) to continue...", str(os.getpid())) self.slapos_controler.stopInstance(self.instance_title)
self._prepareDummySlapOSAnswer() self.log("Waiting for instance stop..")
while (not self.isInstanceReady(self.instance_title)): _waitInstance(self.instance_title)
time.sleep(5) # Start instance
pass self.slapos_controler.startInstance(self.instance_title)
self._comeBackFromDummySlapOS() self.log("Waiting for instance start..")
self.log("Answer received.") _waitInstance(self.instance_title)
# 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