Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation This testsuite is for testing the Boot Device Functions |
| 4 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 5 | Resource ../lib/rest_client.robot |
| 6 | Resource ../lib/ipmi_client.robot |
| 7 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | ddc605f | 2016-09-15 00:46:32 -0500 | [diff] [blame] | 8 | Resource ../lib/utils.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
George Keishing | 3ce958c | 2017-03-27 01:09:02 -0500 | [diff] [blame] | 10 | Suite Setup Test Suite Setup |
Sweta Potthuri | f93a746 | 2017-03-21 06:38:26 -0500 | [diff] [blame] | 11 | Test Setup Pre Test Case Execution |
| 12 | Test Teardown Post Test Case Execution |
George Keishing | 3ce958c | 2017-03-27 01:09:02 -0500 | [diff] [blame] | 13 | Suite Teardown Close All Connections |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 14 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 15 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 16 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 17 | ${HOST_SETTINGS} ${SETTINGS_URI}host0 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 18 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | *** Test Cases *** |
| 20 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 21 | Set The Boot Device As Default Using REST API |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 22 | [Documentation] This testcase is to set the boot device as default using REST |
| 23 | ... URI. The Boot device is read using REST API and ipmitool. |
| 24 | [Tags] Set_The_Boot_Device_As_Default_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 25 | |
Rahul Maheshwari | 28087e9 | 2017-04-07 07:12:49 -0500 | [diff] [blame] | 26 | ${bootDevice}= Set Variable Default |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 27 | ${valueDict}= Create Dictionary data=${bootDevice} |
| 28 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 29 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Rahul Maheshwari | 28087e9 | 2017-04-07 07:12:49 -0500 | [diff] [blame] | 30 | Response Should Be Equal Default |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 31 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 32 | Should Contain ${output} No override |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 33 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 34 | Set The Boot Device As Default Using Ipmitool |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 35 | [Documentation] This testcase is to set the boot device as default using |
| 36 | ... ipmitool. The Boot device is read using REST API and |
| 37 | ... ipmitool. |
| 38 | [Tags] Set_The_Boot_Device_As_Default_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 39 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 40 | Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00 |
| 41 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Rahul Maheshwari | 28087e9 | 2017-04-07 07:12:49 -0500 | [diff] [blame] | 42 | Response Should Be Equal Default |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 43 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 44 | Should Contain ${output} No override |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 45 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 46 | Set The Boot Device As Network Using REST API |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 47 | [Documentation] This testcase is to set the boot device as Network using REST |
| 48 | ... URI. The Boot device is read using REST API and ipmitool. |
| 49 | [Tags] Set_The_Boot_Device_As_Network_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 50 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 51 | ${bootDevice}= Set Variable Network |
| 52 | ${valueDict}= Create Dictionary data=${bootDevice} |
| 53 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 54 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 55 | Response Should Be Equal Network |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 56 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 57 | Should Contain ${output} Force PXE |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 58 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 59 | Set The Boot Device As Network Using Ipmitool |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 60 | [Documentation] This testcase is to set the boot device as Network using |
| 61 | ... ipmitool. The Boot device is read using REST API and |
| 62 | ... ipmitool. |
| 63 | [Tags] Set_The_Boot_Device_As_Network_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 64 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 65 | Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00 |
| 66 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 67 | Response Should Be Equal Network |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 68 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 69 | Should Contain ${output} Force PXE |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 70 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 71 | Set The Boot Device As Disk Using REST API |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 72 | [Documentation] This testcase is to set the boot device as Disk using REST |
| 73 | ... URI. The Boot device is read using REST API and ipmitool. |
| 74 | [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 75 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 76 | ${bootDevice}= Set Variable Disk |
| 77 | ${valueDict}= Create Dictionary data=${bootDevice} |
| 78 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 79 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 80 | Response Should Be Equal Disk |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 81 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 82 | Should Contain ${output} Force Boot from default Hard-Drive |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 83 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 84 | Set The Boot Device As Disk Using Ipmitool |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 85 | [Documentation] This testcase is to set the boot device as Disk using |
| 86 | ... ipmitool. The Boot device is read using REST API and |
| 87 | ... ipmitool. |
| 88 | [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 89 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 90 | Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00 |
| 91 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 92 | Response Should Be Equal Disk |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 93 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 94 | Should Contain ${output} Force Boot from default Hard-Drive |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 95 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 96 | Set The Boot Device As Safe Using REST API |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 97 | [Documentation] This testcase is to set the boot device as Safe using REST |
| 98 | ... URI. The Boot device is read using REST API and ipmitool. |
| 99 | [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 100 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 101 | ${bootDevice}= Set Variable Safe |
| 102 | ${valueDict}= Create Dictionary data=${bootDevice} |
| 103 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 104 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 105 | Response Should Be Equal Safe |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 106 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 107 | Should Contain ${output} Safe-Mode |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 108 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 109 | Set The Boot Device As Safe Using Ipmitool |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 110 | [Documentation] This testcase is to set the boot device as Safe using |
| 111 | ... ipmitool. The Boot device is read using REST API and |
| 112 | ... ipmitool. |
| 113 | [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 114 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 115 | Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00 |
| 116 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 117 | Response Should Be Equal Safe |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 118 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 119 | Should Contain ${output} Safe-Mode |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 120 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 121 | Set The Boot Device As CDROM Using REST API |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 122 | [Documentation] This testcase is to set the boot device as CDROM using REST |
| 123 | ... URI. The Boot device is read using REST API and ipmitool. |
| 124 | [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 125 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 126 | ${bootDevice}= Set Variable CDROM |
| 127 | ${valueDict}= Create Dictionary data=${bootDevice} |
| 128 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 129 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 130 | Response Should Be Equal CDROM |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 131 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 132 | Should Contain ${output} Force Boot from CD/DVD |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 133 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 134 | Set The Boot Device As CDROM Using Ipmitool |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 135 | [Documentation] This testcase is to set the boot device as CDROM using |
| 136 | ... ipmitool. The Boot device is read using REST API and |
| 137 | ... ipmitool. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 138 | [Tags] Set_The_Boot_Device_As_CDROM_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 139 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 140 | Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00 |
| 141 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 142 | Response Should Be Equal CDROM |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 143 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 144 | Should Contain ${output} Force Boot from CD/DVD |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 145 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 146 | Set The Boot Device As Setup Using REST API |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 147 | [Documentation] This testcase is to set the boot device as Setup using REST |
| 148 | ... URI. The Boot device is read using REST API and ipmitool. |
| 149 | [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 150 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 151 | ${bootDevice}= Set Variable Setup |
| 152 | ${valueDict}= Create Dictionary data=${bootDevice} |
| 153 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 154 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 155 | Response Should Be Equal Setup |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 156 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 157 | Should Contain ${output} Force Boot into BIOS Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 158 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 159 | Set The Boot Device As Setup Using Ipmitool |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 160 | [Documentation] This testcase is to set the boot device as Setup using |
| 161 | ... ipmitool. The Boot device is read using REST API and |
| 162 | ... ipmitool. |
| 163 | [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 164 | |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 165 | Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00 |
| 166 | Read the Attribute ${HOST_SETTINGS} boot_flags |
| 167 | Response Should Be Equal Setup |
Rahul Maheshwari | 56d8675 | 2017-04-07 14:25:01 -0500 | [diff] [blame] | 168 | ${output}= Run IPMI Standard Command chassis bootparam get 5 |
| 169 | Should Contain ${output} Force Boot into BIOS Setup |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 170 | |
| 171 | *** Keywords *** |
| 172 | |
| 173 | Response Should Be Equal |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 174 | [Arguments] ${args} |
| 175 | Should Be Equal ${OUTPUT} ${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 176 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 177 | Read the Attribute |
Rahul Maheshwari | 8dc8a48 | 2017-01-29 21:41:55 -0600 | [diff] [blame] | 178 | [Arguments] ${uri} ${parm} |
| 179 | ${output}= Read Attribute ${uri} ${parm} |
| 180 | Set Test Variable ${OUTPUT} ${output} |
Sweta Potthuri | f93a746 | 2017-03-21 06:38:26 -0500 | [diff] [blame] | 181 | |
| 182 | Pre Test Case Execution |
| 183 | [Documentation] Do the pre test setup. |
| 184 | |
| 185 | Open Connection And Log In |
| 186 | Initialize DBUS cmd "boot_flags" |
| 187 | |
| 188 | Post Test Case Execution |
| 189 | [Documentation] Do the post test teardown. |
| 190 | |
| 191 | FFDC On Test Case Fail |
| 192 | Close All Connections |
George Keishing | 3ce958c | 2017-03-27 01:09:02 -0500 | [diff] [blame] | 193 | |
| 194 | Test Suite Setup |
| 195 | [Documentation] Do the initial suite setup. |
| 196 | ${current_state}= Get Host State |
| 197 | Run Keyword If '${current_state}' == 'Off' |
| 198 | ... Initiate Host Boot |
| 199 | |
| 200 | Wait Until Keyword Succeeds |
| 201 | ... 10 min 10 sec Is OS Starting |