Processor Turbo Test

Add processor turbo mode test back into the robot test library.
Processor turbo mode was not supported until recently.

Resolves openbmc/openbmc-test-automation#1354
Change-Id: I7971c21fc666e8adb1fcea50a1bb4faf08bcff9b
Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 885afa2..b1aa8da 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -1395,18 +1395,17 @@
     [Return]  ${turbo_setting}
 
 
-
 Set Turbo Setting Via REST
     [Documentation]  Set turbo setting via REST.
-    [Arguments]  ${setting}
+    [Arguments]  ${setting}  ${verify}=${False}
 
     # Description of argument(s):
-    # setting  Value which needs to be set.(i.e. False or True).
+    # setting  State to set TurboAllowed, 1=allowed, 0=not allowed.
+    # verify   If True, read the TurboAllowed setting to confirm.
 
     ${data}=  Create Dictionary  data=${${setting}}
-    Write Attribute   ${CONTROL_HOST_URI}turbo_allowed  TurboAllowed
-    ...  data=${data}
-
+    Write Attribute  ${CONTROL_HOST_URI}turbo_allowed  TurboAllowed
+    ...  verify=${verify}  data=${data}
 
 
 Set Control Boot Mode
diff --git a/systest/proc_turbo_freq_check.robot b/systest/proc_turbo_freq_check.robot
new file mode 100755
index 0000000..8f140e3
--- /dev/null
+++ b/systest/proc_turbo_freq_check.robot
@@ -0,0 +1,68 @@
+*** Settings ***
+
+Documentation  Compare processor speed in turbo and non-turbo modes.
+
+# Test Parameters:
+# OPENBMC_HOST   The BMC host name or IP address.
+# OS_HOST        The OS host name or IP Address.
+# OS_USERNAME    The OS login userid (usually root).
+# OS_PASSWORD    The password for the OS login.
+
+# Approximate run time:  8 minutes.
+
+Resource         ../syslib/utils_os.robot
+Resource         ../lib/rest_client.robot
+
+
+Test Setup       Test Setup Execution
+Test Teardown    Test Teardown Execution
+
+
+*** Test Cases ***
+
+Test Turbo Processor Speed
+    [Documentation]  Compare turbo and non-turbo speed.
+    [Tags]  Turbo_Processor_Speed_Test
+
+    # Disable turbo mode.
+    Set Turbo Setting Via REST  0  verify=${True}
+
+    Start SOL Console Logging
+    REST Power On  stack_mode=normal
+    Tool Exist  ppc64_cpu
+
+    ${proc_speed_non_turbo}=  Get CPU Max Frequency
+
+    Rest Power Off
+
+    # Enable turbo mode.
+    Set Turbo Setting Via REST  1  verify=${True}
+
+    REST Power On  stack_mode=normal
+    ${proc_speed_turbo}=  Get CPU Max Frequency
+
+    Rprintn
+    Rpvars   proc_speed_non_turbo  proc_speed_turbo
+
+    ${err_msg}=  Catenate  Reported turbo processor speed should be
+    ...  greater than non-turbo speed.
+    Should Be True  ${proc_speed_turbo} > ${proc_speed_non_turbo}
+    ...  msg=${err_msg}
+
+
+*** Keywords ***
+
+Test Setup Execution
+    [Documentation]  Do the pre-test setup.
+
+    REST Power Off  stack_mode=skip
+
+
+Test Teardown Execution
+    [Documentation]  Do the post-test teardown.
+
+    FFDC On Test Case Fail
+
+    ${keyword_buf}=  Catenate  Stop SOL Console Logging
+    ...  \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
+    Run Key  ${keyword_buf}