Allow to setup custom sleep time between resiliency tests.

parent d769e37e
...@@ -42,6 +42,7 @@ class ResiliencyTestSuite(object): ...@@ -42,6 +42,7 @@ class ResiliencyTestSuite(object):
computer_id, partition_id, software, computer_id, partition_id, software,
namebase, namebase,
root_instance_name, root_instance_name,
sleep_time_between_test=600,
total_instance_count="3"): total_instance_count="3"):
self.server_url = server_url self.server_url = server_url
self.key_file = key_file self.key_file = key_file
...@@ -52,6 +53,7 @@ class ResiliencyTestSuite(object): ...@@ -52,6 +53,7 @@ class ResiliencyTestSuite(object):
self.namebase = namebase self.namebase = namebase
self.total_instance_count = total_instance_count self.total_instance_count = total_instance_count
self.root_instance_name = root_instance_name self.root_instance_name = root_instance_name
self.sleep_time_between_test = sleep_time_between_test
slap = slapos.slap.slap() slap = slapos.slap.slap()
slap.initializeConnection(server_url, key_file, cert_file) slap.initializeConnection(server_url, key_file, cert_file)
...@@ -151,12 +153,12 @@ class ResiliencyTestSuite(object): ...@@ -151,12 +153,12 @@ class ResiliencyTestSuite(object):
# Test each clone # Test each clone
while current_clone <= clone_count: while current_clone <= clone_count:
# Wait for XX minutes so that replication is done # Wait for XX minutes so that replication is done
sleep_time = 60 * 15#2 * 60 * 60
self.logger.info('Sleeping for %s seconds before testing clone %s.' % ( self.logger.info('Sleeping for %s seconds before testing clone %s.' % (
sleep_time, self.sleep_time_between_test,
current_clone current_clone
)) ))
time.sleep(sleep_time) time.sleep(self.sleep_time_between_test)
self._doTakeover(current_clone) self._doTakeover(current_clone)
self.logger.info('Testing %s%s instance.' % (self.namebase, current_clone)) self.logger.info('Testing %s%s instance.' % (self.namebase, current_clone))
success = self.checkDataOnCloneInstance() success = self.checkDataOnCloneInstance()
......
...@@ -59,7 +59,8 @@ class SlaprunnerTestSuite(ResiliencyTestSuite): ...@@ -59,7 +59,8 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
server_url, key_file, cert_file, server_url, key_file, cert_file,
computer_id, partition_id, software, computer_id, partition_id, software,
namebase, namebase,
slaprunner_rootinstance_name slaprunner_rootinstance_name,
300
) )
def _connectToSlaprunner(self, resource, data=None): def _connectToSlaprunner(self, resource, data=None):
......
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