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