Move fan tests into library

In preparation of calling fan tests from within an upcoming
Redfish modile, move fan tests to a library.
Update non-Redfish tests (fan_test_os.robot and fan_test.robot) to
use the libary routines.

Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
Change-Id: Iaa2f4137acf8e0fb0e2cc2371674ce7d781a3ac2
diff --git a/tests/test_fans.robot b/tests/test_fans.robot
index 9b05226..f82fb2e 100755
--- a/tests/test_fans.robot
+++ b/tests/test_fans.robot
@@ -13,25 +13,21 @@
 Resource         ../lib/fan_utils.robot
 Resource         ../lib/openbmc_ffdc.robot
 
+Suite Setup      Suite Setup Execution
 Test Teardown    FFDC On Test Case Fail
 
-
 *** Test Cases ***
 
 Fan Base Check Number Of Fans
     [Documentation]  Verify minimum number of fans.
     [Tags]  Fan_Base_Check_Number_Of_Fans
 
-    @{fan_names}  Create List
-    # Populate the list with the names of fans in the system.
-    ${fan_names}=  Get Fan Names  ${fan_names}
-    ${number_of_fans}=  Get Length  ${fan_names}
-
     # Determine if system is water cooled.
-    ${water_coooled}=  Is Water Cooled
+    ${water_cooled}=  Is Water Cooled
+    Rprint Vars  water_cooled
 
     Verify Minimum Number Of Fans With Cooling Type  ${number_of_fans}
-    ...  ${water_coooled}
+    ...  ${water_cooled}
 
 
 Fan Base Check Number Of Fan Monitors
@@ -40,3 +36,9 @@
 
     ${power_state}=  Get Chassis Power State
     Verify Fan Monitors With State  ${power_state}
+
+*** Keywords ***
+
+Suite Setup Execution
+    ${number_of_fans}  ${fan_names}=  Get Fan Count And Names
+    Set Suite Variable  ${number_of_fans}  children=true