LNST was failing in case the pass_result was false. In that case the
"err_msg" was not set properly. This patch fixes the problem.
Additionaly, I added a FIXME comment there, because this (in my opinion)
should be done earlier on the slave rather than here. This way, the
slave prints ERROR as if the command failed (because it had in fact
failed on the slave), but the controller knows it was expected and
puts PASS to the summary. This is confusing.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst/Controller/Machine.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 1847adf..3fc5c4f 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -186,8 +186,12 @@ class Machine(object):
signal.alarm(0)
signal.signal(signal.SIGALRM, prev_handler)
+ # FIXME: This shouldn't be here!
if "pass_result" in command:
cmd_res["passed"] = cmd_res["passed"] ==
command["pass_result"]
+ if not cmd_res["passed"]:
+ msg = "The result differs from what was expected."
+ cmd_res["err_msg"] = msg
return cmd_res
--
1.8.3.1