Methods cleanup_slaves(), start_packet_capture() call the same named methods
in NetTestController object.
packet_capture() is getter for a flag indicating whether packet capture
is enabled or not.
add_host() adds newly created host (HostAPI object) to ControllerAPI's list of
hosts.
init_hosts() will initialize all the hosts and its interfaces - meaning
it will bind Machine objects to HostAPI objects and for each host all of
its Interface objects to InterfaceAPI objects.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/Task.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index df2ecaa..c2284d8 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -39,7 +39,11 @@ class ControllerAPI(object):
def __init__(self, ctl, hosts):
self._ctl = ctl
+ self.run_mode = ctl.run_mode
self._result = True
+ self.first_run = True
+ self._m_id_seq = 0
+ self.mreq = {}
self._perf_repo_api = PerfRepoAPI()
@@ -47,6 +51,29 @@ class ControllerAPI(object):
for host_id, host in hosts.iteritems():
self._hosts[host_id] = HostAPI(self, host_id, host)
+ def get_mreq(self):
+ return self.mreq
+
+ def cleanup_slaves(self):
+ self._ctl._cleanup_slaves()
+
+ def packet_capture(self):
+ return self._ctl._packet_capture
+
+ def start_packet_capture(self):
+ self._ctl._start_packet_capture()
+
+ def gen_m_id(self):
+ self._m_id_seq += 1
+ return "m_id_%s" % self._m_id_seq
+
+ def add_host(self, host_id, handle):
+ self._hosts[host_id] = handle
+
+ def init_hosts(self, hosts):
+ for host_id, host in hosts.iteritems():
+ self._hosts[host_id].init_host(host)
+
def _run_command(self, command):
"""
An internal wrapper that allows keeping track of the
--
2.4.11