Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Module to test PLDM BIOS commands. |
| 4 | |
| 5 | Library Collections |
| 6 | Library String |
| 7 | Library ../lib/pldm_utils.py |
| 8 | Variables ../data/pldm_variables.py |
| 9 | Resource ../lib/openbmc_ffdc.robot |
| 10 | |
| 11 | Test Setup Printn |
| 12 | Test Teardown FFDC On Test Case Fail |
| 13 | Suite Teardown PLDM BIOS Suite Cleanup |
| 14 | |
| 15 | *** Test Cases *** |
| 16 | |
| 17 | Verify GetDateTime |
Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 18 | [Documentation] Verify host date & time. |
| 19 | [Tags] Verify_GetDateTime |
| 20 | |
| 21 | # Example output: |
| 22 | # YYYY-MM-DD HH:MM:SS - 09-02-2020 16:51:23 |
| 23 | |
| 24 | ${pldm_output}= Pldmtool bios GetDateTime |
| 25 | @{date_time}= Split String ${pldm_output} ${SPACE} |
| 26 | @{time}= Split String ${date_time}[1] : |
| 27 | |
| 28 | # verify date & time. |
| 29 | ${current_date_time}= Get Current Date UTC exclude_millis=True |
| 30 | Should Contain ${current_date_time} ${date_time[0]} |
| 31 | Should Contain ${current_date_time} ${time[0]} |
| 32 | |
| 33 | |
| 34 | Verify SetDateTime |
Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 35 | [Documentation] Verify set date & time for the host. |
| 36 | [Tags] Verify_SetDateTime |
| 37 | |
| 38 | # Example output: |
| 39 | # SetDateTime: SUCCESS |
| 40 | |
| 41 | ${current_date_time}= Get Current Date UTC exclude_millis=True |
| 42 | |
| 43 | ${date}= Add Time To Date ${current_date_time} 400 days exclude_millis=True |
| 44 | ${upgrade_date}= Evaluate re.sub(r'-* *:*', "", '${date}') modules=re |
| 45 | |
| 46 | ${time}= Add Time To Date ${current_date_time} 01:01:00 exclude_millis=True |
| 47 | ${upgrade_time}= Evaluate re.sub(r'-* *:*', "", '${time}') modules=re |
| 48 | |
| 49 | # Set date. |
| 50 | ${cmd_set_date}= Evaluate $CMD_SETDATETIME % '${upgrade_date}' |
| 51 | ${pldm_output}= Pldmtool ${cmd_set_date} |
Michael Walsh | 06de1f7 | 2020-02-17 14:28:24 -0600 | [diff] [blame] | 52 | Valid Value pldm_output['setdatetime'] ['SUCCESS'] |
Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 53 | |
| 54 | # Set time. |
| 55 | ${cmd_set_time}= Evaluate $CMD_SETDATETIME % '${upgrade_time}' |
| 56 | ${pldm_output}= Pldmtool ${cmd_set_time} |
Michael Walsh | 06de1f7 | 2020-02-17 14:28:24 -0600 | [diff] [blame] | 57 | Valid Value pldm_output['setdatetime'] ['SUCCESS'] |
Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 58 | |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 59 | |
| 60 | Verify GetBIOSTable For StringTable |
| 61 | [Documentation] Verify GetBIOSTable for table type string table. |
| 62 | [Tags] Verify_GetBIOSTable_For_StringTable |
| 63 | |
Sridevi Ramesh | f60581b | 2020-04-07 05:11:12 -0500 | [diff] [blame] | 64 | # Example pldm_output: |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 65 | # [biosstringhandle]: BIOSString |
| 66 | # [0]: Allowed |
| 67 | # [1]: Disabled |
| 68 | # [2]: Enabled |
| 69 | # [3]: Not Allowed |
| 70 | # [4]: Perm |
| 71 | # [5]: Temp |
| 72 | # [6]: pvm-fw-boot-side |
| 73 | # [7]: pvm-inband-code-update |
| 74 | # [8]: pvm-os-boot-side |
| 75 | # [9]: pvm-pcie-error-inject |
| 76 | # [10]: pvm-surveillance |
| 77 | # [11]: pvm-system-name |
| 78 | # [12]: vmi-if-count |
| 79 | |
Sridevi Ramesh | f60581b | 2020-04-07 05:11:12 -0500 | [diff] [blame] | 80 | ${pldm_output}= Pldmtool bios GetBIOSTable --type StringTable |
| 81 | Valid List pldm_output required_values=${RESPONSE_LIST_GETBIOSTABLE_STRTABLE} |
| 82 | |
| 83 | |
| 84 | Verify GetBIOSTable For AttributeTable |
| 85 | [Documentation] Verify if attribute table content exist for |
| 86 | ... GetBIOSTable with table type attribute table. |
| 87 | [Tags] Verify_GetBIOSTable_For_AttributeTable |
| 88 | |
| 89 | # Example pldm_output: |
| 90 | # [pldm_attributetable]: True |
| 91 | # [attributehandle]: 0 |
| 92 | # [ AttributeNameHandle]: 20(vmi-if1-ipv4-method) |
| 93 | # [ attributetype]: BIOSStringReadOnly |
| 94 | # [ StringType]: 0x01 |
| 95 | # [ minimumstringlength]: 1 |
| 96 | # [ maximumstringlength]: 100 |
| 97 | # [ defaultstringlength]: 15 |
| 98 | # [ defaultstring]: witherspoon-128 |
| 99 | |
| 100 | ${pldm_output}= Pldmtool bios GetBIOSTable --type AttributeTable |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 101 | Rprint Vars pldm_output |
Sridevi Ramesh | f60581b | 2020-04-07 05:11:12 -0500 | [diff] [blame] | 102 | Valid Value pldm_output['pldm_attributetable'] [True] |
| 103 | |
| 104 | |
| 105 | Verify GetBIOSTable For AttributeValueTable |
| 106 | [Documentation] Verify if attribute value table content exist for |
| 107 | ... GetBIOSTable with table type attribute value table. |
| 108 | [Tags] Verify_GetBIOSTable_For_AttributeValueTable |
| 109 | |
| 110 | # Example pldm_output: |
| 111 | # [pldm_attributevaluetable]: True |
| 112 | # [attributehandle]: 0 |
| 113 | # [ attributetype]: BIOSStringReadOnly |
| 114 | # [ currentstringlength]: 15 |
| 115 | # [ currentstring]: witherspoon-128 |
| 116 | |
| 117 | ${pldm_output}= Pldmtool bios GetBIOSTable --type AttributeValueTable |
| 118 | Log To Console ${pldm_output} |
| 119 | Rprint Vars pldm_output |
| 120 | Valid Value pldm_output['pldm_attributevaluetable'] [True] |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 121 | |
Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 122 | *** Keywords *** |
| 123 | |
| 124 | PLDM BIOS Suite Cleanup |
Sridevi Ramesh | 1495bc4 | 2020-02-04 03:13:33 -0600 | [diff] [blame] | 125 | [Documentation] Perform pldm BIOS suite cleanup. |
| 126 | |
| 127 | ${result}= Get Current Date UTC exclude_millis=True |
| 128 | ${current_date_time}= Evaluate re.sub(r'-* *:*', "", '${result}') modules=re |
| 129 | ${cmd_set_date_time}= Evaluate $CMD_SETDATETIME % '${current_date_time}' |
| 130 | ${pldm_output}= Pldmtool ${cmd_set_date_time} |
Michael Walsh | 06de1f7 | 2020-02-17 14:28:24 -0600 | [diff] [blame] | 131 | Valid Value pldm_output['setdatetime'] ['SUCCESS'] |