Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation This testsuite is for testing boot policy function. |
| 4 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 5 | Resource ../lib/rest_client.robot |
| 6 | Resource ../lib/ipmi_client.robot |
| 7 | Resource ../lib/utils.robot |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 8 | Resource ../lib/openbmc_ffdc.robot |
Rahul Maheshwari | ec8bf17 | 2017-02-21 07:41:08 -0600 | [diff] [blame] | 9 | Resource ../lib/state_manager.robot |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 10 | Resource ../lib/boot_utils.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 12 | Suite Setup Suite Setup Execution |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 13 | Test Teardown FFDC On Test Case Fail |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 14 | Suite Teardown Suite Teardown Execution |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | |
George Keishing | 1052aee | 2017-07-14 12:19:53 -0500 | [diff] [blame] | 16 | Force Tags boot_policy_test |
| 17 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 18 | *** Variables *** |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 19 | ${ONETIME} ${1} |
| 20 | ${PERMANENT} ${0} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 21 | |
George Keishing | 162e733 | 2017-10-23 01:16:00 -0500 | [diff] [blame] | 22 | ${stack_mode} skip |
| 23 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | *** Test Cases *** |
| 25 | |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 26 | Set Boot Policy To ONETIME via REST |
| 27 | [Documentation] Set boot policy to ONETIME using REST URI and verify |
| 28 | ... using ipmitool. |
| 29 | [Tags] Set_Boot_Policy_To_ONETIME_via_REST |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 30 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 31 | Set Boot Policy ${ONETIME} |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 32 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 33 | Should Be Equal ${boot} ${ONETIME} |
Rahul Maheshwari | d8d22da | 2017-04-07 09:13:44 -0500 | [diff] [blame] | 34 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 35 | Should Contain ${output} Options apply to only next boot |
| 36 | |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 37 | Set Boot Policy To PERMANENT via REST |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 38 | [Documentation] Set boot policy to PERMANENT using REST URI and verify |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 39 | ... using ipmitool. |
| 40 | [Tags] Set_Boot_Policy_To_PERMANENT_via_REST |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 41 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 42 | Set Boot Policy ${PERMANENT} |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 43 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 44 | Should Be Equal ${boot} ${PERMANENT} |
Rahul Maheshwari | d8d22da | 2017-04-07 09:13:44 -0500 | [diff] [blame] | 45 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 46 | Should Contain ${output} Options apply to all future boots |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 47 | |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 48 | Set Boot Policy To ONETIME via IPMITOOL |
| 49 | [Documentation] Set boot policy to ONETIME via ipmitool and verify |
| 50 | ... using REST URI. |
| 51 | [Tags] Set_Boot_Policy_To_ONETIME_via_IPMITOOL |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 52 | |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 53 | Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00 |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 54 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 55 | Should Be Equal ${boot} ${ONETIME} |
Rahul Maheshwari | d8d22da | 2017-04-07 09:13:44 -0500 | [diff] [blame] | 56 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 57 | Should Contain ${output} Options apply to only next boot |
George Keishing | 314cf85 | 2016-08-26 09:02:16 -0500 | [diff] [blame] | 58 | |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 59 | Set Boot Policy To PERMANENT via IPMITOOL |
| 60 | [Documentation] Set boot policy to PERMANENT via ipmitool and verify |
| 61 | ... using REST URI. |
| 62 | [Tags] Set_Boot_Policy_To_PERMANENT_via_IPMITOOL |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 63 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 64 | Run IPMI command 0x0 0x8 0x05 0xC0 0x00 0x00 0x00 0x0 |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 65 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 66 | Should Be Equal ${boot} ${PERMANENT} |
Rahul Maheshwari | d8d22da | 2017-04-07 09:13:44 -0500 | [diff] [blame] | 67 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 68 | Should Contain ${output} Options apply to all future boots |
| 69 | |
George Keishing | bc7cc58 | 2017-01-23 12:58:34 -0600 | [diff] [blame] | 70 | Test Boot Order via REST |
| 71 | [Documentation] Set boot policy to PERMANENT and boot device to CDROM |
| 72 | ... and verify that the order doesn't change post power on. |
George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 73 | [Tags] Test_Boot_Order_via_REST |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 74 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 75 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 76 | Set Boot Policy ${PERMANENT} |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 77 | Set Boot Source ${BOOT_SOURCE_CDROM} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 78 | |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 79 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 80 | Should Be Equal ${boot} ${PERMANENT} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 81 | |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 82 | ${flag}= Read Attribute ${CONTROL_URI}host0/boot/ BootSource |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 83 | Should Be Equal ${flag} ${BOOT_SOURCE_CDROM} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 84 | |
George Keishing | d320688 | 2016-11-29 04:41:14 -0600 | [diff] [blame] | 85 | Persist ONETIME Boot Policy After Reset |
| 86 | [Documentation] Verify ONETIME boot policy order does not change |
| 87 | ... on warm reset. |
George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 88 | [Tags] Persist_ONETIME_Boot_Policy_After_Reset |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 89 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 90 | Set Boot Policy ${ONETIME} |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 91 | Set Boot Source ${BOOT_SOURCE_NETWORK} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 92 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 93 | OBMC Reboot (off) |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 94 | |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 95 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 96 | Should Be Equal ${boot} ${ONETIME} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 97 | |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 98 | ${flag}= Read Attribute ${CONTROL_URI}host0/boot/ BootSource |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 99 | Should Be Equal ${flag} ${BOOT_SOURCE_NETWORK} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 100 | |
George Keishing | d320688 | 2016-11-29 04:41:14 -0600 | [diff] [blame] | 101 | Persist PERMANENT Boot Policy After Reset |
| 102 | [Documentation] Verify PERMANENT boot policy order does not change |
| 103 | ... on warm reset. |
George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 104 | [Tags] Persist_PERMANENT_Boot_Policy_After_Reset |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 105 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 106 | Set Boot Policy ${PERMANENT} |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 107 | Set Boot Source ${BOOT_SOURCE_CDROM} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 108 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 109 | OBMC Reboot (off) |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 110 | |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 111 | ${boot}= Read Attribute ${CONTROL_URI}host0/boot/one_time Enabled |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 112 | Should Be Equal ${boot} ${PERMANENT} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 113 | |
George Keishing | df3e65f | 2018-12-18 13:06:56 -0600 | [diff] [blame] | 114 | ${flag}= Read Attribute ${CONTROL_URI}host0/boot/ BootSource |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 115 | Should Be Equal ${flag} ${BOOT_SOURCE_CDROM} |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 116 | |
| 117 | Verify Boot Mode Persistency After BMC Reboot |
| 118 | [Documentation] Verify boot mode persistency after BMC reboot. |
| 119 | [Tags] Verify_Boot_Mode_Persistency_After_BMC_Reboot |
| 120 | [Teardown] Run Keywords Restore Bootmode Setting |
| 121 | ... AND FFDC On Test Case Fail |
| 122 | |
| 123 | # Record initial bootmode setting. |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 124 | ${boot_mode}= Read Attribute |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 125 | ... ${CONTROL_HOST_URI}/boot BootMode |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 126 | Set Suite Variable ${initial_boot_mode} ${boot_mode} |
| 127 | |
| 128 | # Set bootmode to non default value. |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 129 | Set Boot Mode ${BOOT_MODE_SAFE} |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 130 | |
George Keishing | a3475c3 | 2017-12-06 04:56:07 -0600 | [diff] [blame] | 131 | OBMC Reboot (off) |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 132 | |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 133 | ${boot_mode_after}= Read Attribute |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 134 | ... ${CONTROL_HOST_URI}/boot BootMode |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 135 | |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 136 | Should Be Equal As Strings |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 137 | ... ${boot_mode_after} ${BOOT_MODE_SAFE} |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 138 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 139 | *** Keywords *** |
| 140 | |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 141 | Set Boot Mode |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 142 | [Documentation] Set the host boot mode via REST. |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 143 | [Arguments] ${args} |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 144 | ${bootmode}= Set Variable ${args} |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 145 | ${valueDict}= Create Dictionary data=${bootmode} |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 146 | Write Attribute ${CONTROL_HOST_URI}/boot/ BootMode data=${valueDict} |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 147 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 148 | Set Boot Policy |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 149 | [Documentation] Set the host boot policy via REST. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 150 | [Arguments] ${args} |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 151 | ${bootpolicy}= Set Variable ${args} |
| 152 | ${valueDict}= Create Dictionary data=${bootpolicy} |
George Keishing | 162e733 | 2017-10-23 01:16:00 -0500 | [diff] [blame] | 153 | Write Attribute |
| 154 | ... ${CONTROL_HOST_URI}/boot/one_time Enabled data=${valueDict} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 155 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 156 | Set Boot Source |
| 157 | [Documentation] Set given boot source. |
| 158 | [Arguments] ${boot_source} |
| 159 | # Description of argument(s): |
| 160 | # boot_source Boot source which need to be set. |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 161 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 162 | ${valueDict}= Create Dictionary data=${boot_source} |
| 163 | Write Attribute ${CONTROL_HOST_URI}/boot/ BootSource data=${valueDict} |
| 164 | |
| 165 | Suite Teardown Execution |
George Keishing | b440019 | 2017-02-01 11:10:30 -0600 | [diff] [blame] | 166 | [Documentation] Restore default settings. |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 167 | Set Boot Policy ${ONETIME} |
| 168 | Set Boot Source ${BOOT_SOURCE_DEFAULT} |
George Keishing | 3ce958c | 2017-03-27 01:09:02 -0500 | [diff] [blame] | 169 | |
Sweta Potthuri | a609452 | 2017-10-12 03:45:22 -0500 | [diff] [blame] | 170 | Suite Setup Execution |
George Keishing | 3ce958c | 2017-03-27 01:09:02 -0500 | [diff] [blame] | 171 | [Documentation] Do the initial suite setup. |
George Keishing | f142668 | 2017-07-12 23:17:17 -0500 | [diff] [blame] | 172 | |
George Keishing | a3475c3 | 2017-12-06 04:56:07 -0600 | [diff] [blame] | 173 | Smart Power Off |
George Keishing | 3ce958c | 2017-03-27 01:09:02 -0500 | [diff] [blame] | 174 | |
Rahul Maheshwari | a001dd2 | 2017-07-23 23:43:35 -0500 | [diff] [blame] | 175 | Restore Bootmode Setting |
| 176 | [Documentation] Restore initial bootmode setting. |
| 177 | |
George Keishing | b8783f1 | 2017-08-05 11:20:16 -0500 | [diff] [blame] | 178 | Set Boot Mode ${initial_boot_mode} |