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 |
| 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 / |
George Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 36 | [Tags] CI get_directory_listing |
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 / |
George Keishing | 9e7796f | 2016-09-23 10:15:57 -0500 | [diff] [blame] | 206 | [Tags] get_names |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 207 | ${resp} = openbmc get request /enumerate |
| 208 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 209 | ${json} = to json ${resp.content} |
| 210 | list should contain value ${json['data']} /org/openbmc/inventory |
| 211 | should be equal as strings ${json['status']} ok |
| 212 | |
| 213 | get names /org/ |
George Keishing | 9e7796f | 2016-09-23 10:15:57 -0500 | [diff] [blame] | 214 | [Tags] get_names_org |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 215 | ${resp} = openbmc get request /org/enumerate |
| 216 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 217 | ${json} = to json ${resp.content} |
| 218 | list should contain value ${json['data']} /org/openbmc/inventory |
| 219 | should be equal as strings ${json['status']} ok |
| 220 | |
| 221 | get invalid names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 222 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 223 | ${resp} = openbmc get request /i/dont/exist/enumerate |
| 224 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 225 | ${json} = to json ${resp.content} |
| 226 | should be equal as strings ${json['status']} error |
| 227 | |
| 228 | put names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 229 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 230 | ${resp} = openbmc put request /enumerate |
| 231 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 232 | ${json} = to json ${resp.content} |
| 233 | should be equal as strings ${json['status']} error |
| 234 | |
| 235 | put names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 236 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 237 | ${resp} = openbmc put request /org/enumerate |
| 238 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 239 | ${json} = to json ${resp.content} |
| 240 | should be equal as strings ${json['status']} error |
| 241 | |
| 242 | put invalid names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 243 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 244 | ${resp} = openbmc put request /i/dont/exist/enumerate |
| 245 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 246 | ${json} = to json ${resp.content} |
| 247 | should be equal as strings ${json['status']} error |
| 248 | |
| 249 | post names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 250 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 251 | ${resp} = openbmc post request /enumerate |
| 252 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 253 | ${json} = to json ${resp.content} |
| 254 | should be equal as strings ${json['status']} error |
| 255 | |
| 256 | post names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 257 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 258 | ${resp} = openbmc post request /org/enumerate |
| 259 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 260 | ${json} = to json ${resp.content} |
| 261 | should be equal as strings ${json['status']} error |
| 262 | |
| 263 | post invalid names /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 264 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 265 | ${resp} = openbmc post request /i/dont/exist/enumerate |
| 266 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 267 | ${json} = to json ${resp.content} |
| 268 | should be equal as strings ${json['status']} error |
| 269 | |
| 270 | delete names / |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 271 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 272 | ${resp} = openbmc delete request /enumerate |
| 273 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 274 | ${json} = to json ${resp.content} |
| 275 | should be equal as strings ${json['status']} error |
| 276 | |
| 277 | delete names /org/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 278 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 279 | ${resp} = openbmc delete request /enumerate |
| 280 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 281 | ${json} = to json ${resp.content} |
| 282 | should be equal as strings ${json['status']} error |
| 283 | |
| 284 | delete invalid names /org/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 285 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 286 | ${resp} = openbmc delete request /org/nothere/enumerate |
| 287 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 288 | ${json} = to json ${resp.content} |
| 289 | should be equal as strings ${json['status']} error |
| 290 | |
| 291 | get method org/openbmc/records/events/action/acceptTestMessage |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 292 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 293 | ${resp} = openbmc get request org/openbmc/records/events/action/acceptTestMessage |
| 294 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 295 | ${json} = to json ${resp.content} |
| 296 | should be equal as strings ${json['status']} error |
| 297 | |
| 298 | get invalid method /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 299 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 300 | ${resp} = openbmc get request /i/dont/exist/action/foo |
| 301 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 302 | ${json} = to json ${resp.content} |
| 303 | should be equal as strings ${json['status']} error |
| 304 | |
| 305 | put method org/openbmc/records/events/action/acceptTestMessage |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 306 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 307 | ${resp} = openbmc put request org/openbmc/records/events/action/acceptTestMessage |
| 308 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 309 | ${json} = to json ${resp.content} |
| 310 | should be equal as strings ${json['status']} error |
| 311 | |
| 312 | put invalid method /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 313 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 314 | ${resp} = openbmc put request /i/dont/exist/action/foo |
| 315 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 316 | ${json} = to json ${resp.content} |
| 317 | should be equal as strings ${json['status']} error |
| 318 | |
| 319 | post method power/getPowerState no args |
| 320 | ${fan_uri}= Get Power Control Interface |
| 321 | ${data} = create dictionary data=@{EMPTY} |
| 322 | ${resp} = openbmc post request ${fan_uri}/action/getPowerState data=${data} |
| 323 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 324 | ${json} = to json ${resp.content} |
| 325 | should be equal as strings ${json['status']} ok |
| 326 | |
| 327 | post method org/openbmc/records/events/action/acceptTestMessage invalid args |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 328 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 329 | ${data} = create dictionary foo=bar |
| 330 | ${resp} = openbmc post request org/openbmc/records/events/action/acceptTestMessage data=${data} |
| 331 | should be equal as strings ${resp.status_code} ${HTTP_BAD_REQUEST} |
| 332 | ${json} = to json ${resp.content} |
| 333 | should be equal as strings ${json['status']} error |
| 334 | |
| 335 | post method org/openbmc/sensors/host/BootCount with args |
| 336 | ${uri} = Set Variable /org/openbmc/sensors/host/BootCount |
| 337 | ${COUNT}= Set Variable ${3} |
| 338 | @{count_list} = Create List ${COUNT} |
| 339 | ${data} = create dictionary data=@{count_list} |
| 340 | ${resp} = openbmc post request ${uri}/action/setValue data=${data} |
| 341 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 342 | ${json} = to json ${resp.content} |
| 343 | should be equal as strings ${json['status']} ok |
| 344 | ${content}= Read Attribute ${uri} value |
| 345 | Should Be Equal ${content} ${COUNT} |
| 346 | |
| 347 | delete method org/openbmc/records/events/action/acceptTestMessage |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 348 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 349 | ${resp} = openbmc delete request org/openbmc/records/events/action/acceptTestMessage |
| 350 | should be equal as strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED} |
| 351 | ${json} = to json ${resp.content} |
| 352 | should be equal as strings ${json['status']} error |
| 353 | |
| 354 | delete invalid method /org/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 355 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 356 | ${resp} = openbmc delete request /org/nothere/action/foomethod |
| 357 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 358 | ${json} = to json ${resp.content} |
| 359 | should be equal as strings ${json['status']} error |
| 360 | |
| 361 | post method org/openbmc/records/events/action/acceptTestMessage no args |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 362 | [Tags] CI |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 363 | ${data} = create dictionary data=@{EMPTY} |
| 364 | ${resp} = openbmc post request org/openbmc/records/events/action/acceptTestMessage data=${data} |
| 365 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 366 | ${json} = to json ${resp.content} |
| 367 | should be equal as strings ${json['status']} ok |
| 368 | |
| 369 | ***keywords*** |
| 370 | Get Power Control Interface |
| 371 | ${resp}= OpenBMC Get Request /org/openbmc/control/ |
| 372 | should be equal as strings ${resp.status_code} ${HTTP_OK} msg=Unable to get any controls - /org/openbmc/control/ |
| 373 | ${jsondata}= To Json ${resp.content} |
| 374 | log ${jsondata} |
| 375 | : FOR ${ELEMENT} IN @{jsondata["data"]} |
| 376 | \ log ${ELEMENT} |
| 377 | \ ${found}= Get Lines Matching Pattern ${ELEMENT} *control/power* |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 378 | \ Return From Keyword If '${found}' != '' ${found} |