Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite test various boot types with boot source. |
| 3 | Resource ../../lib/resource.robot |
| 4 | Resource ../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../lib/common_utils.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 7 | Resource ../../lib/ipmi_client.robot |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 8 | |
George Keishing | ac3b095 | 2019-03-11 06:02:28 -0500 | [diff] [blame] | 9 | Test Setup Test Setup Execution |
| 10 | Test Teardown Test Teardown Execution |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 11 | Suite Teardown Suite Teardown Execution |
| 12 | |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 13 | *** Variables *** |
| 14 | # Maps for correlating redfish data values to IPMI data values. |
| 15 | # The redfish values are obtained with Redfish.Get or Redfish.Get Properties. |
| 16 | # The corresponding IPMI values are obtained with the "chassis bootparam get |
| 17 | # 5" IPMI command. |
| 18 | |
| 19 | # This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the |
| 20 | # corresponding IPMI output value. |
| 21 | &{redfish_ipmi_enabled_map} Once=Options apply to only next boot |
| 22 | ... Continuous=Options apply to all future boots |
| 23 | ... Disabled=Options apply to all future boots |
| 24 | |
| 25 | # This dictionary maps the redfish 'BootSourceOverrideTarget' value to the |
| 26 | # corresponding IPMI output value. |
| 27 | &{redfish_ipmi_target_map} Hdd=Force Boot from default Hard-Drive |
| 28 | ... Pxe=Force PXE |
| 29 | ... Diags=Force Boot from default Hard-Drive, request Safe-Mode |
| 30 | ... Cd=Force Boot from CD/DVD |
| 31 | ... BiosSetup=Force Boot into BIOS Setup |
| 32 | ... None=No override |
| 33 | |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 34 | *** Test Cases *** |
| 35 | |
| 36 | Verify BMC Redfish Boot Types With BootSource As Once |
| 37 | [Documentation] Verify BMC Redfish Boot Types With BootSource As Once. |
| 38 | [Tags] Verify_BMC_Redfish_Boot_Types_With_BootSource_As_Once |
| 39 | [Template] Set And Verify BootSource And BootType |
| 40 | |
| 41 | #BootSourceEnableType BootTargetType |
| 42 | Once Hdd |
| 43 | Once Pxe |
| 44 | Once Diags |
| 45 | Once Cd |
| 46 | Once BiosSetup |
| 47 | |
| 48 | Verify BMC Redfish Boot Types With BootSource As Continuous |
| 49 | [Documentation] Verify BMC Redfish Boot Types With BootSource As Continuous. |
| 50 | [Tags] Verify_BMC_Redfish_Boot_Types_With_BootSource_As_Continuous |
| 51 | [Template] Set And Verify BootSource And BootType |
| 52 | |
| 53 | #BootSourceEnable BootTargetType |
| 54 | Continuous Hdd |
| 55 | Continuous Pxe |
| 56 | Continuous Diags |
| 57 | Continuous Cd |
| 58 | Continuous BiosSetup |
| 59 | |
| 60 | *** Keywords *** |
| 61 | |
| 62 | Set And Verify BootSource And BootType |
| 63 | [Documentation] Set And Verify BootSource And BootType. |
| 64 | [Arguments] ${override_enabled} ${override_target} |
| 65 | |
| 66 | # Description of argument(s): |
| 67 | # override_enabled Boot source enable type. |
| 68 | # ('Once', 'Continuous', 'Disabled'). |
| 69 | # override_target Boot target type. |
| 70 | # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None'). |
| 71 | |
| 72 | # Example: |
| 73 | # "Boot": { |
| 74 | # "BootSourceOverrideEnabled": "Disabled", |
| 75 | # "BootSourceOverrideMode": "Legacy", |
| 76 | # "BootSourceOverrideTarget": "None", |
| 77 | # "BootSourceOverrideTarget@Redfish.AllowableValues": [ |
| 78 | # "None", |
| 79 | # "Pxe", |
| 80 | # "Hdd", |
| 81 | # "Cd", |
| 82 | # "Diags", |
| 83 | # "BiosSetup"]} |
| 84 | |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 85 | # The values set using Redfish are verified via IPMI using the command: |
| 86 | # chassis bootparam get 5 |
| 87 | # Option 5 returns the boot parameters. |
| 88 | # |
| 89 | # Sample output: |
| 90 | # Boot parameter version: 1 |
| 91 | # Boot parameter 5 is valid/unlocked |
| 92 | # Boot parameter data: c000000000 |
| 93 | # Boot Flags : |
| 94 | # - Boot Flag Valid |
| 95 | # - Options apply to all future boots |
| 96 | # - BIOS PC Compatible (legacy) boot |
| 97 | # - Boot Device Selector : No override |
| 98 | # - Console Redirection control : System Default |
| 99 | # - BIOS verbosity : Console redirection occurs per BIOS configuration |
| 100 | # setting (default) |
| 101 | # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at |
| 102 | # the end of POST |
| 103 | |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 104 | ${data}= Create Dictionary BootSourceOverrideEnabled=${override_enabled} |
| 105 | ... BootSourceOverrideTarget=${override_target} |
| 106 | ${payload}= Create Dictionary Boot=${data} |
| 107 | |
George Keishing | 01644e6 | 2019-03-26 04:10:17 -0500 | [diff] [blame] | 108 | Redfish.Patch /redfish/v1/Systems/system body=&{payload} |
George Keishing | 036693c | 2019-07-12 06:22:57 -0500 | [diff] [blame] | 109 | ... valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}] |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 110 | |
George Keishing | ac3b095 | 2019-03-11 06:02:28 -0500 | [diff] [blame] | 111 | ${resp}= Redfish.Get /redfish/v1/Systems/system |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 112 | Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideEnabled"]} |
| 113 | ... ${override_enabled} |
| 114 | Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideTarget"]} |
| 115 | ... ${override_target} |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 116 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 117 | Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']} |
| 118 | Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']} |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 119 | |
| 120 | Suite Teardown Execution |
| 121 | [Documentation] Do the post suite teardown. |
| 122 | |
George Keishing | 01644e6 | 2019-03-26 04:10:17 -0500 | [diff] [blame] | 123 | Redfish.Login |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 124 | Set And Verify BootSource And BootType Disabled None |
George Keishing | 01644e6 | 2019-03-26 04:10:17 -0500 | [diff] [blame] | 125 | Redfish.Logout |
George Keishing | ac3b095 | 2019-03-11 06:02:28 -0500 | [diff] [blame] | 126 | |
| 127 | |
| 128 | Test Setup Execution |
| 129 | [Documentation] Do test case setup tasks. |
| 130 | |
| 131 | Redfish.Login |
| 132 | |
| 133 | |
| 134 | Test Teardown Execution |
| 135 | [Documentation] Do the post test teardown. |
| 136 | |
| 137 | FFDC On Test Case Fail |
| 138 | Redfish.Logout |