From: Ondrej Lichtner <olichtne(a)redhat.com>
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(a)redhat.com>
---
test_modules/Multicast.py | 6 ++++--
1 file 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)
--
1.8.3.1
Show replies by date