import subprocess
import time
+from threading import Timer
import pkg_resources
import prettytable
from ruamel.yaml import YAML
visibility = 'public'
shared_network = True
allow_no_fip = True
+ task_timeout = 3600
def __init__(self, **kwargs):
"""Initialize RallyBase object."""
self.run_cmd = ''
self.network_extensions = []
self.services = []
+ self.task_aborted = False
def _build_task_args(self, test_file_name):
"""Build arguments for the Rally task."""
else:
LOGGER.info('Test scenario: "%s" Failed.', test_name)
+ def kill_task(self, proc):
+ """ Kill a task."""
+ proc.kill()
+ self.task_aborted = True
+
def run_task(self, test_name):
"""Run a task."""
LOGGER.info('Starting test scenario "%s" ...', test_name)
LOGGER.debug('running command: %s', self.run_cmd)
proc = subprocess.Popen(self.run_cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
+ self.task_aborted = False
+ timer = Timer(self.task_timeout, self.kill_task, [proc])
+ timer.start()
output = proc.communicate()[0]
-
+ if self.task_aborted:
+ LOGGER.error("Failed to complete task")
+ raise Exception("Failed to complete task")
+ timer.cancel()
task_id = self.get_task_id(output)
LOGGER.debug('task_id : %s', task_id)
if task_id is None:
class RallyFull(RallyBase):
"""Rally full testcase implementation."""
+ task_timeout = 7200
+
def __init__(self, **kwargs):
"""Initialize RallyFull object."""
if "case_name" not in kwargs:
"""Rally OpenStack CI testcase implementation."""
stests = ["neutron"]
+ task_timeout = 7200
def __init__(self, **kwargs):
"""Initialize RallyJobs object."""