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