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