From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit removes the lnst-ctl argument for remote execution of the
slave application. This option is handy for developers but would cause
problems when the application is installed as a package. The
functionality will be probably replaced by a wrapper script later.
The removal of this option makes a few changes in the NetTestController
file as well.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst-ctl | 22 ++++++++--------------
lnst/Controller/NetTestController.py | 27 +--------------------------
2 files changed, 9 insertions(+), 40 deletions(-)
diff --git a/lnst-ctl b/lnst-ctl
index 5608c01..00413fd 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -36,17 +36,14 @@ def usage():
" network communication
during\n" \
" the test"
print " -h, --help print this message"
- print " -e, --remoteexec transfer and execute\n" \
- " application on slaves"
print " -c, --cleanup perform config cleanup\n"
\
" machines"
print " -x, --result=FILE file to write xml_result"
sys.exit()
-def process_recipe(action, file_path, remoteexec, cleanup, res_serializer,
+def process_recipe(action, file_path, cleanup, res_serializer,
packet_capture, config):
- nettestctl = NetTestController(file_path,
- remoteexec=remoteexec, cleanup=cleanup,
+ nettestctl = NetTestController(file_path, cleanup=cleanup,
res_serializer=res_serializer, config=config)
if action == "run":
return nettestctl.run_recipe(packet_capture)
@@ -68,14 +65,14 @@ def print_summary(summary):
logging.info("*%s* %s" % (res, recipe_file))
logging.info("=====================================================")
-def get_recipe_result(args, file_path, remoteexec, cleanup,
+def get_recipe_result(args, file_path, cleanup,
res_serializer, packet_capture, config):
res_serializer.add_recipe(file_path)
Logs.set_logging_root_path(file_path)
res = None
try:
- res = process_recipe(args, file_path, remoteexec, cleanup,
+ res = process_recipe(args, file_path, cleanup,
res_serializer, packet_capture, config)
except NetTestError as err:
logging.error(err)
@@ -89,8 +86,8 @@ def main():
try:
opts, args = getopt.getopt(
sys.argv[1:],
- "dhr:ecx:p",
- ["debug", "help", "recipe=",
"remoteexec", "cleanup", "result=",
+ "dhr:cx:p",
+ ["debug", "help", "recipe=",
"cleanup", "result=",
"packet_capture"]
)
except getopt.GetoptError as err:
@@ -117,7 +114,6 @@ def main():
debug = 0
recipe_path = None
- remoteexec = False
cleanup = False
result_path = None
packet_capture = False
@@ -126,8 +122,6 @@ def main():
debug += 1
elif opt in ("-h", "--help"):
usage()
- elif opt in ("-e", "--remoteexec"):
- remoteexec = True
elif opt in ("-c", "--cleanup"):
cleanup = True
elif opt in ("-x", "--result"):
@@ -160,13 +154,13 @@ def main():
if re.match(r'^.*\.xml$', recipe_file):
logging.info("Processing recipe file \"%s\"" %
recipe_file)
summary.append(get_recipe_result(action, recipe_file,
- remoteexec, cleanup,
+ cleanup,
res_serializer,
packet_capture,
config))
Logs.set_logging_root_path(clean=False)
else:
- summary.append(get_recipe_result(action, recipe_path, remoteexec,
+ summary.append(get_recipe_result(action, recipe_path,
cleanup, res_serializer,
packet_capture,
config))
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index b6af5ae..340cdea 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -22,7 +22,6 @@ from pprint import pprint, pformat
from lnst.Common.Logs import Logs, log_exc_traceback
from lnst.Common.SshUtils import scp_from_remote
from lnst.Common.XmlRpc import ServerProxy, ServerException
-from lnst.Common.SlaveUtils import prepare_client_session
from lnst.Common.NetUtils import MacPool
from lnst.Common.VirtUtils import VirtNetCtl, VirtDomainCtl, BridgeCtl
from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive
@@ -38,9 +37,8 @@ def ignore_event(**kwarg):
pass
class NetTestController:
- def __init__(self, recipe_path, remoteexec=False, cleanup=False,
+ def __init__(self, recipe_path, cleanup=False,
res_serializer=None, config=None):
- self._remoteexec = remoteexec
self._docleanup = cleanup
self._res_serializer = res_serializer
self._remote_capture_files = {}
@@ -240,9 +238,6 @@ class NetTestController:
domain_ctl = VirtDomainCtl(info["libvirt_domain"])
info["virt_domain_ctl"] = domain_ctl
- if self._remoteexec and not "session" in info:
- self._init_slave_session(machine_id)
-
if not "rpc" in info:
self._init_slave_logging(machine_id)
self._init_slave_rpc(machine_id)
@@ -294,23 +289,6 @@ class NetTestController:
if self._docleanup:
self._rpc_call(machine_id, 'machine_cleanup')
- def _init_slave_session(self, machine_id):
- info = self._get_machineinfo(machine_id)
- hostname = info["hostname"]
- if "rootpass" in info:
- passwd = info["rootpass"]
- else:
- passwd = ''
- logging.info("Executing nettestslave on machine %s", hostname)
-
- port = "22"
- login = "root"
- rpc_port = self._config.get_option('environment', 'rpcport')
- session = prepare_client_session(hostname, port, login, passwd,
- "lnst-slave -p %s" % rpc_port)
- session.add_kill_handler(self._session_die)
- info["session"] = session
-
def _init_slave_rpc(self, machine_id):
info = self._get_machineinfo(machine_id)
hostname = info["hostname"]
@@ -379,9 +357,6 @@ class NetTestController:
return
for machine_id in self._recipe["machines"]:
info = self._get_machineinfo(machine_id)
- if self._remoteexec and "session" in info:
- info["session"].kill()
- info["session"].wait()
def _prepare(self):
# All the perparations are made within the recipe parsing
--
1.7.11.7