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/saltmanager.py b/tcp_tests/managers/saltmanager.py
index b5d5f04..6fad0e4 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -104,11 +104,12 @@
self.__session_start = login()
return self.__api
- def local(self, tgt, fun, args=None, kwargs=None):
- return self.api.local(tgt, fun, args, kwargs, expr_form='compound')
+ def local(self, tgt, fun, args=None, kwargs=None, timeout=None):
+ return self.api.local(tgt, fun, args, kwargs, timeout=timeout,
+ expr_form='compound')
- def local_async(self, tgt, fun, args=None, kwargs=None):
- return self.api.local_async(tgt, fun, args, kwargs)
+ def local_async(self, tgt, fun, args=None, kwargs=None, timeout=None):
+ return self.api.local_async(tgt, fun, args, kwargs, timeout=timeout)
def lookup_result(self, jid):
return self.api.lookup_jid(jid)
@@ -138,25 +139,27 @@
return fails if fails else None
- def enforce_state(self, tgt, state, args=None, kwargs=None):
- r = self.local(tgt=tgt, fun='state.sls', args=state)
+ def enforce_state(self, tgt, state, args=None, kwargs=None, timeout=None):
+ r = self.local(tgt=tgt, fun='state.sls', args=state, timeout=timeout)
f = self.check_result(r)
return r, f
- def enforce_states(self, tgt, state, args=None, kwargs=None):
+ def enforce_states(self, tgt, state, args=None, kwargs=None, timeout=None):
rets = []
for s in state:
- r = self.enforce_state(tgt=tgt, state=s)
+ r = self.enforce_state(tgt=tgt, state=s, timeout=timeout)
rets.append(r)
return rets
- def run_state(self, tgt, state, args=None, kwargs=None):
- return self.local(tgt=tgt, fun=state, args=args, kwargs=kwargs), None
+ def run_state(self, tgt, state, args=None, kwargs=None, timeout=None):
+ return self.local(tgt=tgt, fun=state, args=args, kwargs=kwargs,
+ timeout=timeout), None
- def run_states(self, tgt, state, args=None, kwargs=None):
+ def run_states(self, tgt, state, args=None, kwargs=None, timeout=None):
rets = []
for s in state:
- r = self.run_state(tgt=tgt, state=s, args=args, kwargs=kwargs)
+ r = self.run_state(tgt=tgt, state=s, args=args, kwargs=kwargs,
+ timeout=timeout)
rets.append(r)
return rets