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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 18 | Should Be Equal ${c} /xyz |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 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} |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 45 | list should contain value ${json['data']} /xyz |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 46 | should be equal as strings ${json['status']} ok |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 47 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 48 | get directory listing /xyz/ |
| 49 | [Tags] get_directory_listing_xyz |
| 50 | ${resp}= openbmc get request /xyz/ |
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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 54 | ... ${json['data']} /xyz/openbmc_project |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 72 | put directory listing /xyz/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 73 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 74 | ${resp}= openbmc put request /xyz/ |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 95 | post directory listing /xyz/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 96 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 97 | ${resp}= openbmc post request /xyz/ |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 118 | delete directory listing /xyz/ |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 126 | delete invalid directory listing /xyz/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 127 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 128 | ${resp}= openbmc delete request /xyz/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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 138 | ... ${json['data']} /xyz/openbmc_project/inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 139 | should be equal as strings ${json['status']} ok |
| 140 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 141 | get list names /xyz/ |
| 142 | ${resp}= openbmc get request /xyz/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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 146 | ... ${json['data']} /xyz/openbmc_project/inventory |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 164 | put list names /xyz/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 165 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 166 | ${resp}= openbmc put request /xyz/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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 187 | post list names /xyz/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 188 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 189 | ${resp}= openbmc post request /xyz/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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 210 | delete list names /xyz/ |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 218 | delete invalid list names /xyz/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 219 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 220 | ${resp}= openbmc delete request /xyz/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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 231 | ... ${json['data']} /xyz/openbmc_project/inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 232 | should be equal as strings ${json['status']} ok |
| 233 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 234 | get names /xyz/ |
| 235 | [Tags] get_names_xyz |
| 236 | ${resp}= openbmc get request /xyz/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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 240 | ... ${json['data']} /xyz/openbmc_project/inventory |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 258 | put names /xyz/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 259 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 260 | ${resp}= openbmc put request /xyz/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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 281 | post names /xyz/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 282 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 283 | ${resp}= openbmc post request /xyz/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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 304 | delete names /xyz/ |
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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 312 | delete invalid names /xyz/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 313 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 314 | ${resp}= openbmc delete request /xyz/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 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 319 | get method xyz/openbmc_project/logging/entry |
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 |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 322 | ... xyz/openbmc_project/logging/entry |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 323 | should be equal as strings |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 324 | ... ${resp.status_code} ${HTTP_NOT_FOUND} |
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 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 335 | |
| 336 | put invalid method /i/dont/exist/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 337 | [Tags] CI |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 338 | ${resp}= openbmc put request /i/dont/exist/action/foo |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 339 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 340 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 341 | should be equal as strings ${json['status']} error |
| 342 | |
| 343 | post method power/getPowerState no args |
| 344 | ${fan_uri}= Get Power Control Interface |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 345 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 346 | ${resp}= openbmc post request |
| 347 | ... ${fan_uri}/action/getPowerState data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 348 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 349 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 350 | should be equal as strings ${json['status']} ok |
| 351 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 352 | post method xyz/openbmc_project/sensors/host/BootCount with args |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 353 | ${uri}= Set Variable ${SENSORS_URI}host/BootCount |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 354 | ${COUNT}= Set Variable ${3} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 355 | @{count_list}= Create List ${COUNT} |
| 356 | ${data}= create dictionary data=@{count_list} |
| 357 | ${resp}= openbmc post request ${uri}/action/setValue data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 358 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 359 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 360 | should be equal as strings ${json['status']} ok |
| 361 | ${content}= Read Attribute ${uri} value |
| 362 | Should Be Equal ${content} ${COUNT} |
| 363 | |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 364 | delete invalid method /xyz/nothere/ |
Chris Austen | 859be60 | 2016-07-07 16:46:31 -0500 | [diff] [blame] | 365 | [Tags] CI |
Sweta Potthuri | c959ece | 2017-02-27 04:52:30 -0600 | [diff] [blame] | 366 | ${resp}= openbmc delete request /xyz/nothere/action/foomethod |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 367 | should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 368 | ${json}= to json ${resp.content} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 369 | should be equal as strings ${json['status']} error |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 370 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 371 | *** Keywords *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 372 | Get Power Control Interface |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 373 | ${resp}= OpenBMC Get Request ${CONTROL_URI} |
| 374 | should be equal as strings |
| 375 | ... ${resp.status_code} ${HTTP_OK} |
| 376 | ... msg=Unable to get any controls - ${CONTROL_URI} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 377 | ${jsondata}= To Json ${resp.content} |
| 378 | log ${jsondata} |
| 379 | : FOR ${ELEMENT} IN @{jsondata["data"]} |
| 380 | \ log ${ELEMENT} |
George Keishing | 7230bbc | 2016-12-14 07:02:48 -0600 | [diff] [blame] | 381 | \ ${found}= Get Lines Matching Pattern ${ELEMENT} *control/power* |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 382 | \ Return From Keyword If '${found}' != '' ${found} |