Allow for non-populated fans in watercooled systems
Absent fans may have a "Present" attribute but
no "Functional" attribute. Need to update the fan test code
that derermines the number of installed fans in the system
to allow for this. That is, do not count a fan unless it is
both "Present" and "Functional".
Resolves openbmc/openbmc-test-automation#1454
Change-Id: I83fc14d858ba8cb9770c7c92e635f205c7859a39
Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
diff --git a/lib/fan_utils.robot b/lib/fan_utils.robot
index 43fcddc..dca4206 100755
--- a/lib/fan_utils.robot
+++ b/lib/fan_utils.robot
@@ -30,7 +30,8 @@
\ ${fan_properties}= Read Properties ${fan_uri}
\ ${fan_present}= Get Variable Value ${fan_properties['Present']} 0
- \ Continue For Loop If ${fan_present} != 1
+ \ ${fan_functional}= Get Variable Value ${fan_properties['Functional']} 0
+ \ Continue For Loop If ${fan_present} == 0 or ${fan_functional} == 0
\ ${remaining_uri} ${fan_name}= Split Path ${fan_uri}
\ Append To List ${fan_names} ${fan_name}
diff --git a/tests/test_fans_os.robot b/tests/test_fans_os.robot
index 04f70e1..b0546d5 100755
--- a/tests/test_fans_os.robot
+++ b/tests/test_fans_os.robot
@@ -133,8 +133,6 @@
${stdout} ${stderr} ${rc}=
... BMC Execute Command ${cmd}
- Rpvars fan_speeds_from_BMC_file_system
-
# Convert output to integer values.
${speeds}= Evaluate map(int, $stdout.split(${\n}))
Rpvars speeds
@@ -152,7 +150,7 @@
# Re-enable the fan daemon
Set Fan Daemon State restart
- Run Keyword If ${fail_test} Fail
+ Run Keyword If ${fail_test} > ${0} Fail
... msg=hwmon did not properly report fan speeds.
# Wait for the daemon to take control and gracefully set fan speeds