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