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