[lnst trac] #58: TestIperf
by fedora-badges
#58: TestIperf
----------------------+------------------
Reporter: olichtne | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: lnst-ctl | Version:
Keywords: | Blocked By:
Blocking: |
----------------------+------------------
Option '''bind''' for this test is mandatory but, if it is not specified
value "None" is used making the corresponding iperf command incorrect and
failing.
Either the default value should be changed or, in my opinion better, this
option should be mandatory seeing as you will probably want to use this on
a testing interface which will most probably not be the default bind
interface.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/58>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 7 months
[lnst trac] #57: TestPacketAssert: Make the 'filter' parameter optional
by fedora-badges
#57: TestPacketAssert: Make the 'filter' parameter optional
----------------------+------------------
Reporter: rpazdera | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
----------------------+------------------
The `filter` option of the test module is mandatory at the moment and an
empty string is allowed to indicate that no filtering should be done.
A better solution would be to make the parameter optional and use the
empty string as default value.
Reported-by: Ondrej Lichtner <olichtne(a)redhat.com>
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/57>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 7 months
[lnst trac] #63: replace xml-rpc with our own protocol
by fedora-badges
#63: replace xml-rpc with our own protocol
-------------------------------------+-----------------------------
Reporter: olichtne | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: Stable Release
Component: lnst-ctl and lnst-slave | Version:
Keywords: | Blocked By:
Blocking: |
-------------------------------------+-----------------------------
Today we agreed that our current communication through xml-rpc is not
ideal for our purposes. Instead we want to implement our own communication
protocol that can be used for calling methods on slaves, and transmit data
between the controller and the slaves.
We want to have a separate class that will handle all the connections on
the controller and provide an abstraction over them. The lower level
implementation will probably be based on sending python pickles over
through tcp sockets.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/63>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 7 months
[lnst trac] #65: Create a class for representing slave machines in LNST
by fedora-badges
#65: Create a class for representing slave machines in LNST
-------------------------+-----------------------------
Reporter: rpazdera | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: Stable Release
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
-------------------------+-----------------------------
The `NetTestController` class has got quite big over the last year of
development. There are lots of things mixed together, which makes it quite
hard to maintain.
This piece of code needs to be divided into several parts. The first stage
of this is to separate the routines that are tied to machine
initialisation to a new class -- `SlaveMachine`.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/65>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 7 months
[lnst trac] #62: lnst-ctl error reporting doesn't work at all
by fedora-badges
#62: lnst-ctl error reporting doesn't work at all
----------------------+------------------
Reporter: rpazdera | Owner:
Type: defect | Status: new
Priority: blocker | Milestone:
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
----------------------+------------------
I have been working with `lnst-ctl` in a sort-of unusual way for the last
couple of days and what I discovered is, that if something goes wrong, the
controller will print a completely unrelated error message. This happens
in like 70% of cases. Usually, when the parser is involved.
We certainly need to be more careful in this aspect, because it could
seriously drive any potential users off.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/62>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 7 months
[lnst trac] #68: Regression: Recipe sets don't work
by fedora-badges
#68: Regression: Recipe sets don't work
----------------------+-----------------------------
Reporter: rpazdera | Owner:
Type: defect | Status: new
Priority: major | Milestone: Stable Release
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
----------------------+-----------------------------
lnst-ctl crashes after the first recipe in the set.
This bug is easily reproducible using the smoke tests in git.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/68>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 7 months
[lnst] NetTestController: fix slave cleanup
by Jiří Pírko
commit b59f287af66a2350979ea86a32458e227e71ba8e
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Mar 29 14:03:22 2013 +0100
NetTestController: fix slave cleanup
This commit moves the rpc_call of method "bye" so that it is the last
method called when communicating with the slave. It also adds a call of
the new "kill_cmds" method.
Finally I fixed the disconnect_slave method because it wasn't doing
anything usefull (the code was deleted somewhere in git history), now it
will properly disconnect the slaves.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
lnst/Controller/NetTestController.py | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 89470fb..645ed78 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -323,10 +323,14 @@ class NetTestController:
return
for machine_id in self._recipe["machines"]:
info = self._get_machineinfo(machine_id)
- if "configured_interfaces" not in info:
+
+ if self._msg_dispatcher.get_connection(machine_id):
+ self._rpc_call(machine_id, "kill_cmds")
+ else:
continue
- self._rpc_call(machine_id, "bye")
+ if "configured_interfaces" not in info:
+ continue
for if_id in reversed(info["configured_interfaces"]):
self._rpc_call(machine_id, 'deconfigure_interface', if_id)
@@ -353,8 +357,11 @@ class NetTestController:
def _disconnect_slaves(self):
if 'machines' not in self._recipe:
return
+
for machine_id in self._recipe["machines"]:
- info = self._get_machineinfo(machine_id)
+ if self._msg_dispatcher.get_connection(machine_id):
+ self._rpc_call(machine_id, "bye")
+ self._msg_dispatcher.disconnect_slave(machine_id)
def _prepare(self):
# All the perparations are made within the recipe parsing
@@ -693,3 +700,8 @@ class MessageDispatcher(ConnectionHandler):
log_record['address'] = '(' + address + ')'
record = logging.makeLogRecord(log_record)
logger.handle(record)
+
+ def disconnect_slave(self, machine_id):
+ del self._slaves[machine_id]
+ soc = self.get_connection(machine_id)
+ self.remove_connection(soc)
10 years, 8 months
[lnst] NetTestSlave: add kill_cmds method and cleanup
by Jiří Pírko
commit 5905439c5153e938a87f6c0f219d25b05ec7c69d
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Mar 29 14:03:21 2013 +0100
NetTestSlave: add kill_cmds method and cleanup
This commit adds a new slave method kill_cmds that will perform a
cleanup on the command context. This should be used by the controller
during slave cleanup phase, so that there are no leftover commands
running.
I also added a few calls of command context cleanup to the slave server
so that if a connection from controller is lost we also cleanup all
running commands.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
lnst/Slave/NetTestSlave.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index c35e6af..be85da4 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -80,6 +80,11 @@ class SlaveMethods:
self._remove_capture_files()
return "bye"
+ def kill_cmds(self):
+ logging.info("Killing all forked processes.")
+ self._command_context.cleanup()
+ return "Commands killed"
+
def get_devices_by_hwaddr(self, hwaddr):
name_scan = scan_netdevs()
netdevs = []
@@ -346,6 +351,7 @@ class NetTestSlave:
self._server_handler.accept_connection()
except socket.error:
continue
+ self._cmd_context.cleanup()
self._log_ctl.set_connection(
self._server_handler.get_ctl_sock())
@@ -355,6 +361,7 @@ class NetTestSlave:
self._process_msg(msg[1])
if self._server_handler.get_ctl_sock() == None:
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
self._cmd_context.cleanup()
@@ -380,14 +387,17 @@ class NetTestSlave:
if result != None:
response = {"type": "result", "result": result}
if not self._server_handler.send_data_to_ctl(response):
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
else:
err = "Method not found: %s" % msg["method_name"]
response = {"type": "error", "err": err}
if not self._server_handler.send_data_to_ctl(response):
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
elif msg["type"] == "log":
if not self._server_handler.send_data_to_ctl(msg):
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
elif msg["type"] == "exception":
if msg["cmd_id"] != None:
@@ -400,11 +410,13 @@ class NetTestSlave:
cmd.join()
self._cmd_context.del_cmd(cmd)
if not self._server_handler.send_data_to_ctl(msg):
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
elif msg["type"] == "result":
if msg["cmd_id"] == None:
del msg["cmd_id"]
if not self._server_handler.send_data_to_ctl(msg):
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
cmd = self._cmd_context.get_cmd(None)
cmd.join()
@@ -416,6 +428,7 @@ class NetTestSlave:
if cmd.finished():
if not self._server_handler.send_data_to_ctl(msg):
+ self._cmd_context.cleanup()
self._log_ctl.cancel_connection()
self._cmd_context.del_cmd(cmd)
else:
10 years, 8 months
[lnst] NetTestController: add handling for exception messages
by Jiří Pírko
commit bf53d34fcf53b4c967aad0314abf9370e4745fda
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Mar 29 14:03:20 2013 +0100
NetTestController: add handling for exception messages
This commit adds handling of exception messages recieved from slaves. In
these cases the recipe execution should be stopped and slaves cleaned
up.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
lnst/Controller/NetTestController.py | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index e84c658..89470fb 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -27,7 +27,7 @@ from lnst.Common.VirtUtils import VirtNetCtl, VirtDomainCtl, BridgeCtl
from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive
from lnst.Common.Utils import check_process_running
from lnst.Common.NetTestCommand import NetTestCommandContext, NetTestCommand
-from lnst.Common.NetTestCommand import str_command
+from lnst.Common.NetTestCommand import str_command, CommandException
from lnst.Controller.NetTestParse import NetTestParse
from lnst.Controller.SlavePool import SlavePool
from lnst.Common.ConnectionHandler import send_data, recv_data
@@ -467,7 +467,12 @@ class NetTestController:
overall_res = True
for sequence in self._recipe["sequences"]:
- res = self._run_command_sequence(sequence)
+ try:
+ res = self._run_command_sequence(sequence)
+ except CommandException as exc:
+ logging.debug(exc)
+ overall_res = False
+ break
for machine_id in self._recipe["machines"]:
self._restore_system_config(machine_id)
@@ -673,6 +678,9 @@ class MessageDispatcher(ConnectionHandler):
elif message[1]["type"] == "result":
msg = "Recieved result message from different slave %s" % message[0]
logging.debug(msg)
+ elif message[1]["type"] == "exception":
+ msg = "Recieved an exception from slave: %s" % message[0]
+ raise CommandException(msg)
else:
msg = "Unknown message type: %s" % message[1]["type"]
raise NetTestError(msg)
10 years, 8 months
[lnst] NetTestSlave: catch exceptions from methods
by Jiří Pírko
commit 7e9247a9bfc7993bbd7358879042490685dc97e9
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Mar 29 14:03:19 2013 +0100
NetTestSlave: catch exceptions from methods
This commit adds handling of exceptions raised during execution of slave
methods.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
lnst/Slave/NetTestSlave.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 677fe6b..c35e6af 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -14,6 +14,7 @@ jpirko(a)redhat.com (Jiri Pirko)
import signal
import select, logging
import os
+import sys, traceback
import datetime
import socket
from time import sleep
@@ -362,7 +363,19 @@ class NetTestSlave:
if msg["type"] == "command":
method = getattr(self._methods, msg["method_name"], None)
if method != None:
- result = method(*msg["args"])
+ try:
+ result = method(*msg["args"])
+ except:
+ log_exc_traceback()
+ type, value, tb = sys.exc_info()
+ exc_trace = ''.join(traceback.format_exception(type,
+ value, tb))
+ response = {"type": "exception",
+ "Exception": exc_trace}
+ if not self._server_handler.send_data_to_ctl(response):
+ self._cmd_context.cleanup()
+ self._log_ctl.cancel_connection()
+ return
if result != None:
response = {"type": "result", "result": result}
10 years, 8 months