[lnst trac] #55: XML Schema Definition for LNST Recipe Syntax
by fedora-badges
#55: XML Schema Definition for LNST Recipe Syntax
----------------------+------------------
Reporter: rpazdera | Owner:
Type: task | Status: new
Priority: major | Milestone:
Component: lnst-ctl | Version:
Keywords: | Blocked By:
Blocking: |
----------------------+------------------
It would be great if we had a scheme definition for recipes and machine
configs. It could be used for preliminary validation. Also VIM >= 7 should
support syntax checking and even completion based on this definitions!
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/55>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 8 months
[lnst trac] #50: Wiki article: How to Structure LNST Recipes
by fedora-badges
#50: Wiki article: How to Structure LNST Recipes
----------------------+------------------------------------------
Reporter: rpazdera | Owner:
Type: task | Status: new
Priority: major | Milestone: Complete Wiki Documentation
Component: wiki | Version:
Keywords: | Blocked By:
Blocking: |
----------------------+------------------------------------------
This article should cover everything about lnst recipe creation from a
point of view of an inexperienced LNST user.
It should be easy to understand and not too technical. It doesn't have to
cover the topic completely, but it should give enough information for a
newcomer.
This article should incorporate the topic in the 4th section of the LNST
Intro document.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/50>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 8 months
[lnst trac] #52: Wiki article: Machine Config XML Reference
by fedora-badges
#52: Wiki article: Machine Config XML Reference
----------------------+------------------------------------------
Reporter: rpazdera | Owner:
Type: task | Status: new
Priority: major | Milestone: Complete Wiki Documentation
Component: wiki | Version:
Keywords: | Blocked By:
Blocking: |
----------------------+------------------------------------------
There should be a separate reference for the XML format of machine configs
that belong to a pool directory. It should be a brief enumeration of
values for advanced users (the guide for beginners will be placed
separately).
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/52>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 8 months
[lnst trac] #73: Coloured output to terminal
by fedora-badges
#73: Coloured output to terminal
-------------------------+-----------------------------
Reporter: rpazdera | Owner: rpazdera
Type: enhancement | Status: new
Priority: minor | Milestone: Stable Release
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
-------------------------+-----------------------------
It would be nice, if the terminal output of LNST was coloured. LNST prints
out lots of messages and colouring would make them much easier to read.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/73>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 10 months
[PATCH] NetTestResultSerializer: fix output of options
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The serializer function we use transforms dict objects directly to xml.
For this it uses the keys as tag names. This however results in invalid
tags for system_config options which begin with a '/' character. This
commit fixes that by detecting if the parent tag is named 'options'.
This is not a very universal way to do this as these special characters
can theoretically appear anywhere, but a nice universal solution
probably doesnt exist without defining a strict result data interface,
which we currently don't have.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/NetTestResultSerializer.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py
index 57577e7..7e83759 100644
--- a/lnst/Controller/NetTestResultSerializer.py
+++ b/lnst/Controller/NetTestResultSerializer.py
@@ -18,7 +18,11 @@ import logging
def serialize_obj(obj, dom, el, upper_name="unnamed"):
if isinstance(obj, dict):
for key in obj:
- new_el = dom.createElement(key)
+ if upper_name == "options":
+ new_el = dom.createElement("option")
+ new_el.setAttribute("name", key)
+ else:
+ new_el = dom.createElement(key)
el.appendChild(new_el)
serialize_obj(obj[key], dom, new_el, upper_name=key)
elif isinstance(obj, list):
@@ -203,12 +207,12 @@ class NetTestResultSerializer:
result_data_node = result_data_nodes[0]
options_nodes = result_data_node.getElementsByTagName("options")
for options_node in options_nodes:
- for option in options_node.childNodes:
+ for option in options_node.getElementsByTagName("option"):
previous_node = option.getElementsByTagName("previous_val")[0]
current_node = option.getElementsByTagName("current_val")[0]
previous_val = get_node_val(previous_node)
current_val = get_node_val(current_node)
- opt_left = 12*" "+"%s" % option.tagName
+ opt_left = 12*" "+"%s" % option.getAttribute("name")
opt_right = "previous: %s current: %s" \
% (previous_val, current_val)
output_pairs.append((opt_left, opt_right))
--
1.8.1.4
10 years, 11 months
[lnst] NetTestResultSerializer: fix output of options
by Jiří Pírko
commit be77f657244e2c13699e45989b2696fac8b571f3
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri May 31 15:48:30 2013 +0200
NetTestResultSerializer: fix output of options
The serializer function we use transforms dict objects directly to xml.
For this it uses the keys as tag names. This however results in invalid
tags for system_config options which begin with a '/' character. This
commit fixes that by detecting if the parent tag is named 'options'.
This is not a very universal way to do this as these special characters
can theoretically appear anywhere, but a nice universal solution
probably doesnt exist without defining a strict result data interface,
which we currently don't have.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestResultSerializer.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py
index 57577e7..7e83759 100644
--- a/lnst/Controller/NetTestResultSerializer.py
+++ b/lnst/Controller/NetTestResultSerializer.py
@@ -18,7 +18,11 @@ import logging
def serialize_obj(obj, dom, el, upper_name="unnamed"):
if isinstance(obj, dict):
for key in obj:
- new_el = dom.createElement(key)
+ if upper_name == "options":
+ new_el = dom.createElement("option")
+ new_el.setAttribute("name", key)
+ else:
+ new_el = dom.createElement(key)
el.appendChild(new_el)
serialize_obj(obj[key], dom, new_el, upper_name=key)
elif isinstance(obj, list):
@@ -203,12 +207,12 @@ class NetTestResultSerializer:
result_data_node = result_data_nodes[0]
options_nodes = result_data_node.getElementsByTagName("options")
for options_node in options_nodes:
- for option in options_node.childNodes:
+ for option in options_node.getElementsByTagName("option"):
previous_node = option.getElementsByTagName("previous_val")[0]
current_node = option.getElementsByTagName("current_val")[0]
previous_val = get_node_val(previous_node)
current_val = get_node_val(current_node)
- opt_left = 12*" "+"%s" % option.tagName
+ opt_left = 12*" "+"%s" % option.getAttribute("name")
opt_right = "previous: %s current: %s" \
% (previous_val, current_val)
output_pairs.append((opt_left, opt_right))
10 years, 11 months
recipe result format change
by Ondrej Lichtner
Hi everyone,
I've started working on changing the format of our recipe results. The
current format is not sufficient as it only reports the cumulative
result of the entire recipe. When the recipe contains several command
sequences the cumulative result is not very helpful, also when a single
command fails it would be nice to know which one it was without blindly
searching all the logs produced.
With this in mind I have the first draft of how I would like the result
output look like. I'm attaching an example file to this email.
The new format gives you information about every command launched, and
show where command sequences start. I decided it wouldn't be very clean
if too much information was given so I'm limiting the output to only
show the type and value of the comand. Additionally it displays the
background id of a command if it has one (so that we can match the
corresponding wait/intr/kill command).
In case the command failed an error message is printed on the next line.
This relies on the fact that the command will return a result dictionary
that contains a field named 'err_msg'.
I haven't decided how to print 'system_config' commands yet but I have a
basic idea. If anyone has any ideas on what they would like to see for
system_configs I will be pleased to hear them.
Let me know what you think about this format, and if you have any ideas
for improvement, please share. The most important part is if I'm not
missing any important parts of commands. It is a summary so I don't want
to print everything (that can be seen in the xml output of option -x).
Thank you for your answers.
-Ondrej
10 years, 11 months
[PATCH 1/2] NetTestSlave: fix restoration of system configuration
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
When the NetTestController code was refactored and several methods were
moved to the new class Machine, part of the code of run_command was
forgotten.
The system configuration data was moved to be stored in the slave
application, however for that the method _update_system_config has to be
called and that wasn't happening.
This commit fixes that. The fix also changes the behaviour of the
system_config command- it will not be running in the background anymore,
instead it is run in the main lnst-slave application, just like the
wait/intr/kill commands.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/NetTestCommand.py | 5 +++--
lnst/Slave/NetTestSlave.py | 11 +++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py
index 527764e..8dc9562 100644
--- a/lnst/Common/NetTestCommand.py
+++ b/lnst/Common/NetTestCommand.py
@@ -80,7 +80,8 @@ class NetTestCommand:
return self._finished
def run(self):
- if isinstance(self._cmd_cls, NetTestCommandControl):
+ if isinstance(self._cmd_cls, NetTestCommandControl) or \
+ isinstance(self._cmd_cls, NetTestCommandSystemConfig):
return self._cmd_cls.run()
self._read_pipe, self._write_pipe = multiprocessing.Pipe()
@@ -321,7 +322,7 @@ class NetTestCommandSystemConfig(NetTestCommandGeneric):
res = {"passed": True}
res["res_data"] = res_data
- self.set_result(res)
+ return res
class NetTestCommandControl(NetTestCommandGeneric):
def __init__(self, command_context, command):
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 9b39c0a..d2dd484 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -207,6 +207,7 @@ class SlaveMethods:
logging.warn("Unable to restore '%s' config option!", option)
return False
+ self._system_config = {}
return True
def run_command(self, command):
@@ -218,6 +219,16 @@ class SlaveMethods:
res = cmd.run()
if not cmd.forked():
self._command_context.del_cmd(cmd)
+
+ if command["type"] == "system_config":
+ if res["passed"]:
+ self._update_system_config(res["res_data"]["options"],
+ command["persistent"])
+ else:
+ err = "Error occured while setting system "\
+ "configuration (%s)" % res["err_msg"]
+ logging.error(err)
+
return res
except:
log_exc_traceback()
--
1.8.1.4
10 years, 11 months
[PATCHv2 0/3] Summary output format change
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The bug with recipe result initialization is fixed in this version.
Previous message:
Hi everyone,
yesterday I posted an email containing the first version of how I am
reimplementing the summary output. Today I bring you the, hopefully, finished
version in the following patches.
The slightly changed format now looks like this:
2013-05-30 15:09:07| (127.0.0.1)| INFO: ========================================= SUMMARY =========================================
2013-05-30 15:09:07| (127.0.0.1)| INFO: recipes/smoke/tests/recipe-bond-bond.xml PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: cmd_seq: 1
2013-05-30 15:09:07| (127.0.0.1)| INFO: test IcmpPing bg_id: 1 PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: ctl_wait 5s PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: intr id: 1 PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: cmd_seq: 2
2013-05-30 15:09:07| (127.0.0.1)| INFO: exec [ `ip -o link | grep t_bond0 | wc -l` -gt 0 ] PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: cmd_seq: 3
2013-05-30 15:09:07| (127.0.0.1)| INFO: test IcmpPing PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: cmd_seq: 4
2013-05-30 15:09:07| (127.0.0.1)| INFO: system_config PASS
2013-05-30 15:09:07| (127.0.0.1)| INFO: /proc/sys/net/ipv4/igmp_max_memberships previous: 20 current: 8
2013-05-30 15:09:07| (127.0.0.1)| INFO: ===========================================================================================
Ondrej Lichtner (3):
NetTestResultSerializer: add support for command_sequences
NetTestResultSerializer: add method print_summary
lnst-ctl: use the new print_summary method
lnst-ctl | 12 +--
lnst/Controller/NetTestController.py | 1 +
lnst/Controller/NetTestResultSerializer.py | 167 ++++++++++++++++++++++++++++-
3 files changed, 168 insertions(+), 12 deletions(-)
--
1.8.1.4
10 years, 11 months
[PATCH] Fix bracket typo
by Jan Tluka
I accidentally wrote incorrect brackets that results in crash of the
controller application. This commit fixes it.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst-ctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst-ctl b/lnst-ctl
index 1ed3515..5701518 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -145,7 +145,7 @@ def main():
action = args.pop()
- if not action in {'run', 'dump', 'config_only', 'match_setup'}:
+ if not action in ['run', 'dump', 'config_only', 'match_setup']:
logging.error("No action command passed")
usage();
--
1.7.11.7
10 years, 11 months