commit 72ae9d71138ada03e0e1e82534a12929602df756 Author: Ondrej Lichtner olichtne@redhat.com Date: Fri Oct 4 16:14:51 2013 +0200
Multicast: fix result data format
The Multicast test module was using names that couldn't be transformed into valid xml element names which resulted in the test failing. This commit fixes that by replacing spaces with underscores.
I also fixed the regular expression- the left part of it sometimes contained '-' or '.' which resulted in some lines not being correctly parsed.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com Signed-off-by: Jiri Pirko jiri@resnulli.us
test_modules/Multicast.py | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) --- diff --git a/test_modules/Multicast.py b/test_modules/Multicast.py index 4865957..b366c9b 100644 --- a/test_modules/Multicast.py +++ b/test_modules/Multicast.py @@ -115,7 +115,7 @@ class Multicast(TestGeneric):
# line format matches name=value pairs with optional # double quotes around the value - line_format_r = r"([a-zA-Z0-9_ ]+)="?([a-zA-Z0-9_ ]*)"?" + line_format_r = r"([a-zA-Z0-9_ -.]+)="?([a-zA-Z0-9_ ]*)"?"
for line in data_stdout.split("\n"): match = re.search(line_format_r, line) @@ -123,8 +123,10 @@ class Multicast(TestGeneric): name = match.group(1).strip() value = match.group(2).strip()
- res[name] = value logging.info("Test result: {0} = {1}".format(name, value)) + + name = name.replace(' ', '_') + res[name] = value if not self._evaluate_result(name, value): res["msg"] = "Conditions not met!" return self.set_fail(res)
lnst-developers@lists.fedorahosted.org