[lnst trac] #64: Add Support for Configuration via NetworkManager
by fedora-badges
#64: Add Support for Configuration via NetworkManager
-------------------------------------+------------------
Reporter: rpazdera | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: lnst-ctl and lnst-slave | Version: git
Keywords: | Blocked By:
Blocking: |
-------------------------------------+------------------
LNST at the moment doesn't work well with NetworkManager, which must be
disabled in order for LNST to operate properly.
Based on discussions with Pavlix, the problems we've been having with NM
should be all solved now, so it would be nice to add support for network
manager as well.
The options are to use libnm-glib or the dbus interface directly from
python.
However, we need to support older RHEL6 versions as well, so we need to
keep the current configuration routines as a fallback.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/64>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 8 months
[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, 9 months
[PATCH v2 0/5] Terminal Output Colouring
by Radek Pazdera
Hi everyone,
I'm sending the colouring patches again. In this update, I added the
support for the extended colours (up to 256 colours can be used
instead of the original 8/16). I also added options to disable the
colouring from CLI and also permanently from the configuration file.
Now, the colouring should be done.
Cheers,
Radek
Radek Pazdera (5):
Common: Adding Colours module
Logs: Adding support for terminal output colouring
Colouring: Make the colour presets configurable
NetTestResultSerializer: Coloured summary
lnst-ctl, lnst-slave: Disabling colours
lnst-ctl | 13 ++-
lnst-slave | 11 ++-
lnst/Common/Colours.py | 187 ++++++++++++++++++++++++++++
lnst/Common/Config.py | 31 +++++
lnst/Common/Logs.py | 118 +++++++++---------
lnst/Controller/NetTestResultSerializer.py | 29 +++--
6 files changed, 318 insertions(+), 71 deletions(-)
create mode 100644 lnst/Common/Colours.py
--
1.7.7.6
10 years, 10 months
[PATCH 1/4] Common: Adding Colours module
by Radek Pazdera
This patch adds a new module with helper functions for colouring
terminal output of LNST to the lnst.Common package.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst/Common/Colours.py | 101 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
create mode 100644 lnst/Common/Colours.py
diff --git a/lnst/Common/Colours.py b/lnst/Common/Colours.py
new file mode 100644
index 0000000..a3321c4
--- /dev/null
+++ b/lnst/Common/Colours.py
@@ -0,0 +1,101 @@
+"""
+Terminal colouring functions
+
+Copyright 2013 Red Hat, Inc.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+rpazdera(a)redhat.com (Radek Pazdera)
+"""
+
+import logging
+import os
+import re
+from lnst.Common.Utils import bool_it
+
+COLOURS = {
+ "black": 0,
+ "red": 1,
+ "green": 2,
+ "yellow": 3,
+ "blue": 4,
+ "magenta": 5,
+ "cyan": 6,
+ "white": 7
+}
+
+PRESETS = {
+ "default": [None, None, False],
+ "faded": ["yellow", None, False],
+ "alert": ["red", None, True],
+ "highlight": ["yellow", None, True],
+
+ "pass": ["green", None, True],
+ "fail": ["red", None, True],
+
+ "info": ["green", None, True],
+ "debug": ["blue", None, True],
+ "warning": ["yellow", None, True],
+ "error": ["red", None, True],
+ "log_header": ["white", None, False]
+}
+
+def name_to_fg_colour(name):
+ """ Convert name to foreground colour code.
+ Returns None if the colour name isn't supported. """
+
+ if not COLOURS.has_key(name):
+ return None
+
+ return COLOURS[name] + 30
+
+def name_to_bg_colour(name):
+ """ Convert name to background color code.
+ Returns None if the colour name isn't supported. """
+
+ if not COLOURS.has_key(name):
+ return None
+
+ return COLOURS[name] + 40
+
+
+def colourize(text, fg_name=None, bg_name=None, bold=False):
+ """ Paint text with foreground/background COLOURS. """
+
+ fg = name_to_fg_colour("white")
+ if fg_name != None:
+ fg = name_to_fg_colour(fg_name)
+
+ if bg_name != None:
+ bg = name_to_bg_colour(bg_name)
+ return "\033[%d;%d;%dm%s\033[0m" % (int(bold), fg, bg, text)
+ else:
+ return "\033[%d;%dm%s\033[0m" % (int(bold), fg, text)
+
+def decorate_string(string, preset):
+ p = PRESETS[preset]
+ return colourize(string, p[0], p[1], p[2])
+
+def strip_colours(text):
+ return re.sub("\033\[[01](;[0-9]{2}(;[0-9]{2})?)?m", "", text)
+
+def load_presets_from_config(config):
+ for preset_name in PRESETS:
+ preset = config.get_option("colours", preset_name)
+ if preset == None:
+ continue
+ fg, bg, bf = preset
+
+ if re.match("[Nn]one", fg):
+ fg = None
+ elif fg not in COLOURS.keys():
+ raise Exception("Colour '%s' not supported" % fg)
+
+ if re.match("[Nn]one", bg):
+ bg = None
+ elif bg not in COLOURS.keys():
+ raise Exception("Colour '%s' not supported" % bg)
+
+ PRESETS[preset_name] = [fg, bg, bool_it(bf)]
--
1.7.7.6
10 years, 10 months
[PATCH] NetTestSlave: Removing double exception handling
by Radek Pazdera
Due to several changes in the communication channel between controller
and the slaves, the NetTestSlave class was handling (and logging)
exceptions twice.
This patch removes the first unnecessary processing, so only a single
traceback is logged.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst/Slave/NetTestSlave.py | 44 ++++++++++++++++++--------------------------
1 files changed, 18 insertions(+), 26 deletions(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index d2dd484..f3a321a 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -211,32 +211,24 @@ class SlaveMethods:
return True
def run_command(self, command):
- try:
- cmd = NetTestCommand(self._command_context, command,
- self._resource_table, self._log_ctl)
- self._command_context.add_cmd(cmd)
-
- 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()
- cmd_type = command["type"]
- m_id = command["machine_id"]
- msg = "Execution of %s command on machine %s failed" \
- % (cmd_type, m_id)
- raise CommandException(msg)
+ cmd = NetTestCommand(self._command_context, command,
+ self._resource_table, self._log_ctl)
+ self._command_context.add_cmd(cmd)
+
+ 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
def machine_cleanup(self):
NetConfigDeviceAllCleanup()
--
1.7.7.6
10 years, 10 months