The pass_result was changed to expect. Additionaly, LNST was failing in
case the pass_result was false. In that case the "err_msg" was not set
properly. This patch also fixes the problem.
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 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 8fd8a40..76e35b5 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)
- if "pass_result" in command:
- cmd_res["passed"] = cmd_res["passed"] ==
command["pass_result"]
+ # FIXME: This shouldn't be here!
+ if "expect" in command:
+ cmd_res["passed"] = cmd_res["passed"] ==
command["expect"]
+ 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