Fix runtestmanager for CICD deployments
In CICD deployments, there are no workarounds that install
docker.io before using 'runtest' formula.
Add preparation of necessary packages to runtestmanager.
- Refactor RuntestManager to use salt CLI instead of salt API
because salt API dones't allow to catch errors from modules
- Add preparations for docker packages, Neutron private and
public networks based on underlay.yaml address pools, etc.
Change-Id: Iaff8046b9cde6185cd6718a5c2064998ea7dc507
diff --git a/tcp_tests/managers/execute_commands.py b/tcp_tests/managers/execute_commands.py
index adb76dc..193153c 100644
--- a/tcp_tests/managers/execute_commands.py
+++ b/tcp_tests/managers/execute_commands.py
@@ -87,6 +87,7 @@
retry_count = retry.get('count', 1)
retry_delay = retry.get('delay', 1)
skip_fail = step.get('skip_fail', False)
+ timeout = step.get('timeout', None)
with self.__underlay.remote(node_name=node_name) as remote:
@@ -101,7 +102,7 @@
LOG.info("\n\n{0}\n{1}".format(
msg + retry_msg, '=' * len(msg + retry_msg)))
- result = remote.execute(cmd, verbose=True)
+ result = remote.execute(cmd, timeout=timeout, verbose=True)
if return_res:
return result
@@ -148,6 +149,7 @@
retry_count = retry.get('count', 1)
retry_delay = retry.get('delay', 1)
skip_fail = step.get('skip_fail', False)
+ timeout = step.get('timeout', None)
if not bool(state) ^ bool(states):
raise ValueError("You should use state or states in step")
@@ -165,7 +167,7 @@
method = getattr(self._salt, self._salt._map[do])
command_ret = method(tgt=target, state=state or states,
- args=args, kwargs=kwargs)
+ args=args, kwargs=kwargs, timeout=timeout)
command_ret = command_ret if \
isinstance(command_ret, list) else [command_ret]
results = [(r['return'][0], f) for r, f in command_ret]