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