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 | |
George Keishing | f699f55 | 2023-09-14 19:05:01 +0530 | [diff] [blame] | 13 | Force Tags Boot_Devices |
| 14 | |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 15 | *** Variables *** |
| 16 | # Maps for correlating redfish data values to IPMI data values. |
| 17 | # The redfish values are obtained with Redfish.Get or Redfish.Get Properties. |
| 18 | # The corresponding IPMI values are obtained with the "chassis bootparam get |
| 19 | # 5" IPMI command. |
| 20 | |
| 21 | # This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the |
| 22 | # corresponding IPMI output value. |
| 23 | &{redfish_ipmi_enabled_map} Once=Options apply to only next boot |
| 24 | ... Continuous=Options apply to all future boots |
Konstantin Aladyshev | 61d2250 | 2021-06-18 15:47:53 +0300 | [diff] [blame] | 25 | ... Disabled=Boot Flag Invalid |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 26 | |
| 27 | # This dictionary maps the redfish 'BootSourceOverrideTarget' value to the |
| 28 | # corresponding IPMI output value. |
| 29 | &{redfish_ipmi_target_map} Hdd=Force Boot from default Hard-Drive |
| 30 | ... Pxe=Force PXE |
| 31 | ... Diags=Force Boot from default Hard-Drive, request Safe-Mode |
| 32 | ... Cd=Force Boot from CD/DVD |
| 33 | ... BiosSetup=Force Boot into BIOS Setup |
| 34 | ... None=No override |
| 35 | |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 36 | # This dictionary maps the redfish 'BootSourceOverrideMode' value to the |
| 37 | # corresponding IPMI output value. |
| 38 | &{redfish_ipmi_mode_map} Legacy=BIOS PC Compatible (legacy) boot |
| 39 | ... UEFI=BIOS EFI boot |
| 40 | |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 41 | *** Test Cases *** |
| 42 | |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 43 | Verify BMC Redfish Boot Source Override with Enabled Mode As Once |
| 44 | [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Once. |
| 45 | [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Once |
| 46 | [Template] Set And Verify Boot Source Override |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 47 | |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 48 | #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode |
| 49 | Once Hdd UEFI |
| 50 | Once Pxe UEFI |
| 51 | Once Diags UEFI |
| 52 | Once Cd UEFI |
| 53 | Once BiosSetup UEFI |
Konstantin Aladyshev | 61d2250 | 2021-06-18 15:47:53 +0300 | [diff] [blame] | 54 | Once None UEFI |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 55 | Once Hdd Legacy |
| 56 | Once Pxe Legacy |
| 57 | Once Diags Legacy |
| 58 | Once Cd Legacy |
| 59 | Once BiosSetup Legacy |
Konstantin Aladyshev | 61d2250 | 2021-06-18 15:47:53 +0300 | [diff] [blame] | 60 | Once None Legacy |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 61 | |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 62 | |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 63 | Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous |
| 64 | [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Continuous. |
| 65 | [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Continuous |
| 66 | [Template] Set And Verify Boot Source Override |
| 67 | |
| 68 | #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode |
| 69 | Continuous Hdd UEFI |
| 70 | Continuous Pxe UEFI |
| 71 | Continuous Diags UEFI |
| 72 | Continuous Cd UEFI |
| 73 | Continuous BiosSetup UEFI |
Konstantin Aladyshev | 61d2250 | 2021-06-18 15:47:53 +0300 | [diff] [blame] | 74 | Continuous None UEFI |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 75 | Continuous Hdd Legacy |
| 76 | Continuous Pxe Legacy |
| 77 | Continuous Diags Legacy |
| 78 | Continuous Cd Legacy |
| 79 | Continuous BiosSetup Legacy |
Konstantin Aladyshev | 61d2250 | 2021-06-18 15:47:53 +0300 | [diff] [blame] | 80 | Continuous None Legacy |
| 81 | |
| 82 | |
| 83 | Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled |
| 84 | [Documentation] Verify BMC Redfish Boot Source Override with Enabled Mode As Disabled. |
| 85 | [Tags] Verify_BMC_Redfish_Boot_Source_Override_with_Enabled_Mode_As_Disabled |
| 86 | [Template] Set And Verify Boot Source Override |
| 87 | |
| 88 | #BootSourceOverrideEnabled BootSourceOverrideTarget BootSourceOverrideMode |
| 89 | Disabled Hdd UEFI |
| 90 | Disabled Pxe UEFI |
| 91 | Disabled Diags UEFI |
| 92 | Disabled Cd UEFI |
| 93 | Disabled BiosSetup UEFI |
| 94 | Disabled None UEFI |
| 95 | Disabled Hdd Legacy |
| 96 | Disabled Pxe Legacy |
| 97 | Disabled Diags Legacy |
| 98 | Disabled Cd Legacy |
| 99 | Disabled BiosSetup Legacy |
| 100 | Disabled None Legacy |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 101 | |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 102 | |
| 103 | *** Keywords *** |
| 104 | |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 105 | Set And Verify Boot Source Override |
| 106 | [Documentation] Set and Verify Boot source override |
| 107 | [Arguments] ${override_enabled} ${override_target} ${override_mode}=UEFI |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 108 | |
| 109 | # Description of argument(s): |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 110 | # override_enabled Boot source override enable type. |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 111 | # ('Once', 'Continuous', 'Disabled'). |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 112 | # override_target Boot source override target. |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 113 | # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None'). |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 114 | # override_mode Boot source override mode (relevant only for x86 arch). |
| 115 | # ('Legacy', 'UEFI'). |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 116 | |
| 117 | # Example: |
| 118 | # "Boot": { |
| 119 | # "BootSourceOverrideEnabled": "Disabled", |
| 120 | # "BootSourceOverrideMode": "Legacy", |
| 121 | # "BootSourceOverrideTarget": "None", |
| 122 | # "BootSourceOverrideTarget@Redfish.AllowableValues": [ |
| 123 | # "None", |
| 124 | # "Pxe", |
| 125 | # "Hdd", |
| 126 | # "Cd", |
| 127 | # "Diags", |
| 128 | # "BiosSetup"]} |
| 129 | |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 130 | # The values set using Redfish are verified via IPMI using the command: |
| 131 | # chassis bootparam get 5 |
| 132 | # Option 5 returns the boot parameters. |
| 133 | # |
| 134 | # Sample output: |
| 135 | # Boot parameter version: 1 |
| 136 | # Boot parameter 5 is valid/unlocked |
| 137 | # Boot parameter data: c000000000 |
| 138 | # Boot Flags : |
| 139 | # - Boot Flag Valid |
| 140 | # - Options apply to all future boots |
| 141 | # - BIOS PC Compatible (legacy) boot |
| 142 | # - Boot Device Selector : No override |
| 143 | # - Console Redirection control : System Default |
| 144 | # - BIOS verbosity : Console redirection occurs per BIOS configuration |
| 145 | # setting (default) |
| 146 | # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at |
| 147 | # the end of POST |
| 148 | |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 149 | Redfish Set Boot Default ${override_enabled} ${override_target} ${override_mode} |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 150 | |
Anusha Dathatri | 02a0bb3 | 2019-04-05 00:50:38 -0500 | [diff] [blame] | 151 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 152 | Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']} |
| 153 | Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']} |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 154 | Run Keyword If '${PLATFORM_ARCH_TYPE}' == 'x86' |
| 155 | ... Should Contain ${output} ${redfish_ipmi_mode_map['${override_mode}']} |
| 156 | |
Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 157 | |
| 158 | Suite Teardown Execution |
| 159 | [Documentation] Do the post suite teardown. |
| 160 | |
George Keishing | 01644e6 | 2019-03-26 04:10:17 -0500 | [diff] [blame] | 161 | Redfish.Login |
Konstantin Aladyshev | 0043fc5 | 2021-04-15 12:07:29 +0300 | [diff] [blame] | 162 | Set And Verify Boot Source Override Disabled None UEFI |
George Keishing | 01644e6 | 2019-03-26 04:10:17 -0500 | [diff] [blame] | 163 | Redfish.Logout |
George Keishing | ac3b095 | 2019-03-11 06:02:28 -0500 | [diff] [blame] | 164 | |
| 165 | |
| 166 | Test Setup Execution |
| 167 | [Documentation] Do test case setup tasks. |
| 168 | |
| 169 | Redfish.Login |
| 170 | |
| 171 | |
| 172 | Test Teardown Execution |
| 173 | [Documentation] Do the post test teardown. |
| 174 | |
| 175 | FFDC On Test Case Fail |
| 176 | Redfish.Logout |