In servo-stat, restrict the allowed lid_open status values.
It turns out that some broken devices report errors in place of
one of the expected three values of "yes", "no" and "not_applicable".
So, change the test from "anything that isn't no is working" to
"only yes and not_applicable mean working."
BUG=None
TEST=None
Change-Id: I4c761b4cf033d9a0a445beb6a526a706c2f7beab
Reviewed-on: https://chromium-review.googlesource.com/220912
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Troy Kensinger <tkensinger@chromium.org>
diff --git a/contrib/servo-stat b/contrib/servo-stat
index d407162..46864e8 100755
--- a/contrib/servo-stat
+++ b/contrib/servo-stat
@@ -71,7 +71,7 @@
else
echo -n "C"
LID=$(dut_control -s $SERVO lid_open 2>&1)
- if [ "$LID" = "lid_open:no" ]
+ if [ "$LID" != "lid_open:yes" -a "$LID" != "lid_open:not_applicable" ]
then
STATUS=("${STATUS[@]}" "lid_open is '$LID'")
fi