Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Compare processor speed in turbo and non-turbo modes. |
| 4 | |
| 5 | # Test Parameters: |
| 6 | # OPENBMC_HOST The BMC host name or IP address. |
| 7 | # OS_HOST The OS host name or IP Address. |
| 8 | # OS_USERNAME The OS login userid (usually root). |
| 9 | # OS_PASSWORD The password for the OS login. |
| 10 | |
| 11 | Resource ../syslib/utils_os.robot |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 12 | Library ../syslib/utils_keywords.py |
| 13 | Variables ../data/variables.py |
| 14 | Library ../lib/bmc_ssh_utils.py |
| 15 | Resource ../lib/connection_client.robot |
| 16 | Resource ../lib/resource.txt |
| 17 | Resource ../lib/rest_client.robot |
| 18 | Resource ../lib/utils.robot |
| 19 | |
| 20 | |
| 21 | Test Setup Pre Test Case Execution |
| 22 | Test Teardown Post Test Case Execution |
| 23 | |
| 24 | |
| 25 | *** Test Cases *** |
| 26 | |
| 27 | Turbo And Non-Turbo Processor Speed Test |
| 28 | [Documentation] Compare processor turbo and non-turbo speeds. |
| 29 | [Tags] Turbo_And_Non-Turbo_Processor_Speed_Test |
| 30 | |
| 31 | Set Turbo Setting Via REST True |
| 32 | ${mode}= Read Turbo Setting Via REST |
| 33 | Should Be Equal ${mode} True |
| 34 | ... msg=Issued call to set Turbo mode but it was not set. |
| 35 | |
| 36 | # The OS governor determines the maximum processor speed at boot-up time. |
| 37 | REST Power On stack_mode=skip |
| 38 | ${proc_speed_turbo}= Get Processor Max Speed Setting |
| 39 | |
| 40 | Smart Power Off |
| 41 | |
| 42 | Set Turbo Setting Via REST False |
| 43 | ${mode}= Read Turbo Setting Via REST |
| 44 | Should Be Equal ${mode} False |
| 45 | ... msg=Issued call to disable Turbo mode but it was not disabled. |
| 46 | |
| 47 | REST Power On stack_mode=skip |
| 48 | ${proc_speed_non_turbo}= Get Processor Max Speed Setting |
| 49 | |
| 50 | Rprintn |
| 51 | Rpvars proc_speed_turbo proc_speed_non_turbo |
| 52 | |
| 53 | ${err_msg}= Catenate Reported turbo processor speed should be |
| 54 | ... greater than non-turbo speed. |
| 55 | Should Be True ${proc_speed_turbo} > ${proc_speed_non_turbo} |
| 56 | ... msg=${err_msg} |
| 57 | |
| 58 | |
| 59 | *** Keywords *** |
| 60 | |
| 61 | Get Processor Max Speed Setting |
| 62 | [Documentation] Get processor maximum speed setting from the OS. |
| 63 | # - On the OS run: ppc64_cpu --frequency |
| 64 | # - Return the maximum frequency value reported. |
| 65 | # The command ppc64_cpu is provided in both Ubuntu and RHEL on Power. |
| 66 | |
| 67 | ${command}= Set Variable |
| 68 | ... ppc64_cpu --frequency | grep max | cut -f 2 | cut -d ' ' -f 1 |
| 69 | # The ppc64_cpu --frequency command returns min, max, and average |
| 70 | # cpu frequencies. For example, |
| 71 | # min: 2.500 GHz (cpu 143) |
| 72 | # max: 2.700 GHz (cpu 1) |
| 73 | # avg: 2.600 GHz |
| 74 | # The ${command} selects the max: line, selects only the |
| 75 | # 2.700 GHz (cpu 1) part, then selects the 2.700 number. |
| 76 | |
| 77 | # Get the maximum processor frequency reported. |
| 78 | ${output} ${stderr} ${rc}= OS Execute Command |
| 79 | ... ${command} print_out=${1} |
| 80 | |
| 81 | ${frequency}= Convert To Number ${output} |
| 82 | [Return] ${frequency} |
| 83 | |
| 84 | |
| 85 | Pre Test Case Execution |
| 86 | [Documentation] Do the pre test setup. |
| 87 | # Save the initial system turbo setting. |
| 88 | # Start (setup) console logging. |
| 89 | |
| 90 | ${initial_turbo_setting}= Read Turbo Setting Via REST |
| 91 | Set Suite Variable ${initial_turbo_setting} children=true |
| 92 | Start SOL Console Logging |
| 93 | |
| 94 | |
| 95 | Post Test Case Execution |
| 96 | [Documentation] Do the post test teardown. |
| 97 | # - Restore original turbo setting on the system. |
| 98 | # - Capture FFDC on test failure. |
| 99 | # - Power off the OS and close all open SSH connections. |
| 100 | |
| 101 | Set Turbo Setting Via REST ${initial_turbo_setting} |
| 102 | |
| 103 | FFDC On Test Case Fail |
| 104 | Smart Power Off |
| 105 | Close All Connections |