Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 2 | Documentation This suite will verifiy all OpenBMC rest interfaces |
| 3 | ... Details of valid interfaces can be found here... |
| 4 | ... https://github.com/openbmc/docs/blob/master/rest-api.md |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 5 | |
George Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 6 | Resource ../lib/rest_client.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 7 | Resource ../lib/openbmc_ffdc.robot |
| 8 | Test Teardown Log FFDC |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
| 10 | |
| 11 | *** Variables *** |
| 12 | |
| 13 | |
| 14 | *** Test Cases *** |
| 15 | Good connection for testing |
George Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 16 | [Tags] CI Good_connection_for_testing |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | ${content}= Read Properties / |
| 18 | ${c}= get from List ${content} 0 |
| 19 | Should Be Equal ${c} /org |
| 20 | |
| 21 | Get an object with no properties |
| 22 | ${content}= Read Properties /org/openbmc/inventory |
| 23 | Should Be Empty ${content} |
| 24 | |
| 25 | Get a Property |
Rahul Maheshwari | bb20f73 | 2016-10-24 06:27:14 -0500 | [diff] [blame^] | 26 | [Tags] Get_a_Property |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 27 | ${resp}= Read Attribute /org/openbmc/inventory/system/chassis/motherboard/cpu0 is_fru |
| 28 | Should Be Equal ${resp} ${1} |
| 29 | |
| 30 | Get a null Property |
| 31 | ${resp} = OpenBMC Get Request /org/openbmc/inventory/attr/is_fru |
| 32 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 33 | ${jsondata}= To Json ${resp.content} |
| 34 | Should Be Equal ${jsondata['data']['description']} The specified property cannot be found: ''is_fru'' |
| 35 | |
| 36 | get directory listing / |
George Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 37 | [Tags] CI get_directory_listing |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 38 | ${resp} = openbmc get request / |
| 39 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 40 | ${json} = to json ${resp.content} |
| 41 | list should contain value ${json['data']} /org |
| 42 | should be equal as strings ${json['status']} ok |
| 43 | |
| 44 | get directory listing /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 45 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 46 | ${resp} = openbmc get request /org/ |
| 47 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 48 | ${json} = to json ${resp.content} |
| 49 | list should contain value ${json['data']} /org/openbmc |
| 50 | should be equal as strings ${json['status']} ok |
| 51 | |
| 52 | get invalid directory listing /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 53 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 54 | ${resp} = openbmc get request /i/dont/exist/ |
| 55 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 56 | ${json} = to json ${resp.content} |
| 57 | should be equal as strings ${json['status']} error |
| 58 | |
| 59 | put directory listing / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 60 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 61 | ${resp} = openbmc put request / |
| 62 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 63 | ${json} = to json ${resp.content} |
| 64 | should be equal as strings ${json['status']} error |
| 65 | |
| 66 | put directory listing /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 67 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 68 | ${resp} = openbmc put request /org/ |
| 69 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 70 | ${json} = to json ${resp.content} |
| 71 | should be equal as strings ${json['status']} error |
| 72 | |
| 73 | put invalid directory listing /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 74 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 75 | ${resp} = openbmc put request /i/dont/exist/ |
| 76 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 77 | ${json} = to json ${resp.content} |
| 78 | should be equal as strings ${json['status']} error |
| 79 | |
| 80 | post directory listing / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 81 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 82 | ${resp} = openbmc post request / |
| 83 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 84 | ${json} = to json ${resp.content} |
| 85 | should be equal as strings ${json['status']} error |
| 86 | |
| 87 | post directory listing /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 88 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 89 | ${resp} = openbmc post request /org/ |
| 90 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 91 | ${json} = to json ${resp.content} |
| 92 | should be equal as strings ${json['status']} error |
| 93 | |
| 94 | post invalid directory listing /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 95 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 96 | ${resp} = openbmc post request /i/dont/exist/ |
| 97 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 98 | ${json} = to json ${resp.content} |
| 99 | should be equal as strings ${json['status']} error |
| 100 | |
| 101 | delete directory listing / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 102 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 103 | ${resp} = openbmc delete request / |
| 104 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 105 | ${json} = to json ${resp.content} |
| 106 | should be equal as strings ${json['status']} error |
| 107 | |
| 108 | delete directory listing /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 109 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 110 | ${resp} = openbmc delete request / |
| 111 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 112 | ${json} = to json ${resp.content} |
| 113 | should be equal as strings ${json['status']} error |
| 114 | |
| 115 | delete invalid directory listing /org/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 116 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 117 | ${resp} = openbmc delete request /org/nothere/ |
| 118 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 119 | ${json} = to json ${resp.content} |
| 120 | should be equal as strings ${json['status']} error |
| 121 | |
| 122 | get list names / |
| 123 | ${resp} = openbmc get request /list |
| 124 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 125 | ${json} = to json ${resp.content} |
| 126 | list should contain value ${json['data']} /org/openbmc/inventory |
| 127 | should be equal as strings ${json['status']} ok |
| 128 | |
| 129 | get list names /org/ |
| 130 | ${resp} = openbmc get request /org/list |
| 131 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 132 | ${json} = to json ${resp.content} |
| 133 | list should contain value ${json['data']} /org/openbmc/inventory |
| 134 | should be equal as strings ${json['status']} ok |
| 135 | |
| 136 | get invalid list names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 137 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 138 | ${resp} = openbmc get request /i/dont/exist/list |
| 139 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 140 | ${json} = to json ${resp.content} |
| 141 | should be equal as strings ${json['status']} error |
| 142 | |
| 143 | put list names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 144 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 145 | ${resp} = openbmc put request /list |
| 146 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 147 | ${json} = to json ${resp.content} |
| 148 | should be equal as strings ${json['status']} error |
| 149 | |
| 150 | put list names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 151 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 152 | ${resp} = openbmc put request /org/list |
| 153 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 154 | ${json} = to json ${resp.content} |
| 155 | should be equal as strings ${json['status']} error |
| 156 | |
| 157 | put invalid list names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 158 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 159 | ${resp} = openbmc put request /i/dont/exist/list |
| 160 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 161 | ${json} = to json ${resp.content} |
| 162 | should be equal as strings ${json['status']} error |
| 163 | |
| 164 | post list names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 165 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 166 | ${resp} = openbmc post request /list |
| 167 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 168 | ${json} = to json ${resp.content} |
| 169 | should be equal as strings ${json['status']} error |
| 170 | |
| 171 | post list names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 172 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 173 | ${resp} = openbmc post request /org/list |
| 174 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 175 | ${json} = to json ${resp.content} |
| 176 | should be equal as strings ${json['status']} error |
| 177 | |
| 178 | post invalid list names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 179 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 180 | ${resp} = openbmc post request /i/dont/exist/list |
| 181 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 182 | ${json} = to json ${resp.content} |
| 183 | should be equal as strings ${json['status']} error |
| 184 | |
| 185 | delete list names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 186 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 187 | ${resp} = openbmc delete request /list |
| 188 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 189 | ${json} = to json ${resp.content} |
| 190 | should be equal as strings ${json['status']} error |
| 191 | |
| 192 | delete list names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 193 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 194 | ${resp} = openbmc delete request /list |
| 195 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 196 | ${json} = to json ${resp.content} |
| 197 | should be equal as strings ${json['status']} error |
| 198 | |
| 199 | delete invalid list names /org/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 200 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 201 | ${resp} = openbmc delete request /org/nothere/list |
| 202 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 203 | ${json} = to json ${resp.content} |
| 204 | should be equal as strings ${json['status']} error |
| 205 | |
| 206 | get names / |
George Keishing | 9e7796f | 2016-09-23 10:15:57 -0500 | [diff] [blame] | 207 | [Tags] get_names |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 208 | ${resp} = openbmc get request /enumerate |
| 209 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 210 | ${json} = to json ${resp.content} |
| 211 | list should contain value ${json['data']} /org/openbmc/inventory |
| 212 | should be equal as strings ${json['status']} ok |
| 213 | |
| 214 | get names /org/ |
George Keishing | 9e7796f | 2016-09-23 10:15:57 -0500 | [diff] [blame] | 215 | [Tags] get_names_org |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 216 | ${resp} = openbmc get request /org/enumerate |
| 217 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 218 | ${json} = to json ${resp.content} |
| 219 | list should contain value ${json['data']} /org/openbmc/inventory |
| 220 | should be equal as strings ${json['status']} ok |
| 221 | |
| 222 | get invalid names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 223 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 224 | ${resp} = openbmc get request /i/dont/exist/enumerate |
| 225 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 226 | ${json} = to json ${resp.content} |
| 227 | should be equal as strings ${json['status']} error |
| 228 | |
| 229 | put names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 230 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 231 | ${resp} = openbmc put request /enumerate |
| 232 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 233 | ${json} = to json ${resp.content} |
| 234 | should be equal as strings ${json['status']} error |
| 235 | |
| 236 | put names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 237 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 238 | ${resp} = openbmc put request /org/enumerate |
| 239 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 240 | ${json} = to json ${resp.content} |
| 241 | should be equal as strings ${json['status']} error |
| 242 | |
| 243 | put invalid names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 244 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 245 | ${resp} = openbmc put request /i/dont/exist/enumerate |
| 246 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 247 | ${json} = to json ${resp.content} |
| 248 | should be equal as strings ${json['status']} error |
| 249 | |
| 250 | post names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 251 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 252 | ${resp} = openbmc post request /enumerate |
| 253 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 254 | ${json} = to json ${resp.content} |
| 255 | should be equal as strings ${json['status']} error |
| 256 | |
| 257 | post names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 258 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 259 | ${resp} = openbmc post request /org/enumerate |
| 260 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 261 | ${json} = to json ${resp.content} |
| 262 | should be equal as strings ${json['status']} error |
| 263 | |
| 264 | post invalid names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 265 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 266 | ${resp} = openbmc post request /i/dont/exist/enumerate |
| 267 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 268 | ${json} = to json ${resp.content} |
| 269 | should be equal as strings ${json['status']} error |
| 270 | |
| 271 | delete names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 272 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 273 | ${resp} = openbmc delete request /enumerate |
| 274 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 275 | ${json} = to json ${resp.content} |
| 276 | should be equal as strings ${json['status']} error |
| 277 | |
| 278 | delete names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 279 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 280 | ${resp} = openbmc delete request /enumerate |
| 281 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 282 | ${json} = to json ${resp.content} |
| 283 | should be equal as strings ${json['status']} error |
| 284 | |
| 285 | delete invalid names /org/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 286 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 287 | ${resp} = openbmc delete request /org/nothere/enumerate |
| 288 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 289 | ${json} = to json ${resp.content} |
| 290 | should be equal as strings ${json['status']} error |
| 291 | |
| 292 | get method org/openbmc/records/events/action/acceptTestMessage |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 293 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 294 | ${resp} = openbmc get request org/openbmc/records/events/action/acceptTestMessage |
| 295 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 296 | ${json} = to json ${resp.content} |
| 297 | should be equal as strings ${json['status']} error |
| 298 | |
| 299 | get invalid method /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 300 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 301 | ${resp} = openbmc get request /i/dont/exist/action/foo |
| 302 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 303 | ${json} = to json ${resp.content} |
| 304 | should be equal as strings ${json['status']} error |
| 305 | |
| 306 | put method org/openbmc/records/events/action/acceptTestMessage |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 307 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 308 | ${resp} = openbmc put request org/openbmc/records/events/action/acceptTestMessage |
| 309 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 310 | ${json} = to json ${resp.content} |
| 311 | should be equal as strings ${json['status']} error |
| 312 | |
| 313 | put invalid method /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 314 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 315 | ${resp} = openbmc put request /i/dont/exist/action/foo |
| 316 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 317 | ${json} = to json ${resp.content} |
| 318 | should be equal as strings ${json['status']} error |
| 319 | |
| 320 | post method power/getPowerState no args |
| 321 | ${fan_uri}= Get Power Control Interface |
| 322 | ${data} = create dictionary data=@{EMPTY} |
| 323 | ${resp} = openbmc post request ${fan_uri}/action/getPowerState data=${data} |
| 324 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 325 | ${json} = to json ${resp.content} |
| 326 | should be equal as strings ${json['status']} ok |
| 327 | |
| 328 | post method org/openbmc/records/events/action/acceptTestMessage invalid args |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 329 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 330 | ${data} = create dictionary foo=bar |
| 331 | ${resp} = openbmc post request org/openbmc/records/events/action/acceptTestMessage data=${data} |
| 332 | should be equal as strings ${resp.status_code} ${HTTP_BAD_REQUEST} |
| 333 | ${json} = to json ${resp.content} |
| 334 | should be equal as strings ${json['status']} error |
| 335 | |
| 336 | post method org/openbmc/sensors/host/BootCount with args |
| 337 | ${uri} = Set Variable /org/openbmc/sensors/host/BootCount |
| 338 | ${COUNT}= Set Variable ${3} |
| 339 | @{count_list} = Create List ${COUNT} |
| 340 | ${data} = create dictionary data=@{count_list} |
| 341 | ${resp} = openbmc post request ${uri}/action/setValue data=${data} |
| 342 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 343 | ${json} = to json ${resp.content} |
| 344 | should be equal as strings ${json['status']} ok |
| 345 | ${content}= Read Attribute ${uri} value |
| 346 | Should Be Equal ${content} ${COUNT} |
| 347 | |
| 348 | delete method org/openbmc/records/events/action/acceptTestMessage |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 349 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 350 | ${resp} = openbmc delete request org/openbmc/records/events/action/acceptTestMessage |
| 351 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 352 | ${json} = to json ${resp.content} |
| 353 | should be equal as strings ${json['status']} error |
| 354 | |
| 355 | delete invalid method /org/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 356 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 357 | ${resp} = openbmc delete request /org/nothere/action/foomethod |
| 358 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 359 | ${json} = to json ${resp.content} |
| 360 | should be equal as strings ${json['status']} error |
| 361 | |
| 362 | post method org/openbmc/records/events/action/acceptTestMessage no args |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 363 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 364 | ${data} = create dictionary data=@{EMPTY} |
| 365 | ${resp} = openbmc post request org/openbmc/records/events/action/acceptTestMessage data=${data} |
| 366 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 367 | ${json} = to json ${resp.content} |
| 368 | should be equal as strings ${json['status']} ok |
| 369 | |
| 370 | ***keywords*** |
| 371 | Get Power Control Interface |
| 372 | ${resp}= OpenBMC Get Request /org/openbmc/control/ |
| 373 | should be equal as strings ${resp.status_code} ${HTTP_OK} msg=Unable to get any controls - /org/openbmc/control/ |
| 374 | ${jsondata}= To Json ${resp.content} |
| 375 | log ${jsondata} |
| 376 | : FOR ${ELEMENT} IN @{jsondata["data"]} |
| 377 | \ log ${ELEMENT} |
| 378 | \ ${found}= Get Lines Matching Pattern ${ELEMENT} *control/power* |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 379 | \ Return From Keyword If '${found}' != '' ${found} |