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 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 17 | ${HOST_SETTINGS} ${SETTINGS_URI}host0 |
| 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 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 24 | [Tags] Set_The_Boot_Device_As_Default_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 25 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 26 | ${bootDevice}= Set Variable Default |
| 27 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 28 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 29 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | Response Should Be Equal Default |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 31 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 32 | Should Be Empty ${stderr} |
| 33 | Should Contain ${output} Default |
| 34 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 35 | Set The Boot Device As Default Using Ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 39 | [Tags] Set_The_Boot_Device_As_Default_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 40 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 41 | Run IPMI command 0x0 0x8 0x05 0x80 0x00 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 42 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 43 | Response Should Be Equal Default |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 44 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 45 | Should Be Empty ${stderr} |
| 46 | Should Contain ${output} Default |
| 47 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 48 | Set The Boot Device As Network Using REST API |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 51 | [Tags] Set_The_Boot_Device_As_Network_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 52 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 53 | ${bootDevice}= Set Variable Network |
| 54 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 55 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 56 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 57 | Response Should Be Equal Network |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 58 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 59 | Should Be Empty ${stderr} |
| 60 | Should Contain ${output} Network |
| 61 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 62 | Set The Boot Device As Network Using Ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 66 | [Tags] Set_The_Boot_Device_As_Network_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 67 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 68 | Run IPMI command 0x0 0x8 0x05 0x80 0x04 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 69 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 70 | Response Should Be Equal Network |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 71 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 72 | Should Be Empty ${stderr} |
| 73 | Should Contain ${output} Network |
| 74 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 75 | Set The Boot Device As Disk Using REST API |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 78 | [Tags] Set_The_Boot_Device_As_Disk_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 79 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 80 | ${bootDevice}= Set Variable Disk |
| 81 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 82 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 83 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 84 | Response Should Be Equal Disk |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 85 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 86 | Should Be Empty ${stderr} |
| 87 | Should Contain ${output} Disk |
| 88 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 89 | Set The Boot Device As Disk Using Ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 93 | [Tags] Set_The_Boot_Device_As_Disk_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 94 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 95 | Run IPMI command 0x0 0x8 0x05 0x80 0x08 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 96 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 97 | Response Should Be Equal Disk |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 98 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 99 | Should Be Empty ${stderr} |
| 100 | Should Contain ${output} Disk |
| 101 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 102 | Set The Boot Device As Safe Using REST API |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 105 | [Tags] Set_The_Boot_Device_As_Safe_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 106 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 107 | ${bootDevice}= Set Variable Safe |
| 108 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 109 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 110 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 111 | Response Should Be Equal Safe |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 112 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 113 | Should Be Empty ${stderr} |
| 114 | Should Contain ${output} Safe |
| 115 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 116 | Set The Boot Device As Safe Using Ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 120 | [Tags] Set_The_Boot_Device_As_Safe_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 121 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 122 | Run IPMI command 0x0 0x8 0x05 0x80 0x0C 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 123 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 124 | Response Should Be Equal Safe |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 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 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 132 | [Tags] Set_The_Boot_Device_As_CDROM_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 133 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 134 | ${bootDevice}= Set Variable CDROM |
| 135 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 136 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 137 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 138 | Response Should Be Equal CDROM |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 139 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 140 | Should Be Empty ${stderr} |
| 141 | Should Contain ${output} CDROM |
| 142 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 143 | Set The Boot Device As CDROM Using Ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 149 | Run IPMI command 0x0 0x8 0x05 0x80 0x14 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 150 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 151 | Response Should Be Equal CDROM |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 152 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 153 | Should Be Empty ${stderr} |
| 154 | Should Contain ${output} CDROM |
| 155 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 156 | Set The Boot Device As Setup Using REST API |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 159 | [Tags] Set_The_Boot_Device_As_Setup_Using_REST_API |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 160 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 161 | ${bootDevice}= Set Variable Setup |
| 162 | ${valueDict}= create dictionary data=${bootDevice} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 163 | Write Attribute ${HOST_SETTINGS} boot_flags data=${valueDict} |
| 164 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 165 | Response Should Be Equal Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 166 | ${output} ${stderr}= Execute Command ${dbuscmd} return_stderr=True |
| 167 | Should Be Empty ${stderr} |
| 168 | Should Contain ${output} Setup |
| 169 | |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 170 | Set The Boot Device As Setup Using Ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [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. |
Sridevi Ramesh | 32c93f4 | 2017-01-19 06:36:54 -0600 | [diff] [blame] | 174 | [Tags] Set_The_Boot_Device_As_Setup_Using_Ipmitool |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 175 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 176 | Run IPMI command 0x0 0x8 0x05 0x80 0x18 0x00 0x00 0x00 |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 177 | Read the Attribute ${HOST_SETTINGS} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 178 | Response Should Be Equal Setup |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 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 |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 186 | [Arguments] ${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 187 | Should Be Equal ${OUTPUT} ${args} |
| 188 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 189 | Read the Attribute |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 190 | [Arguments] ${uri} ${parm} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 191 | ${output}= Read Attribute ${uri} ${parm} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 192 | set test variable ${OUTPUT} ${output} |