Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 1 | # test_a1.tavern.yaml |
| 2 | |
Tommy Carpenter | fdf0504 | 2019-07-18 20:21:21 +0000 | [diff] [blame] | 3 | test_name: test healthcheck |
| 4 | |
| 5 | stages: |
| 6 | - name: test the a1 healthcheck |
| 7 | request: |
| 8 | url: http://localhost:10000/a1-p/healthcheck |
| 9 | method: GET |
| 10 | response: |
| 11 | status_code: 200 |
| 12 | |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 13 | --- |
| 14 | |
| 15 | test_name: test admission control |
| 16 | |
| 17 | stages: |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 18 | - name: type not there yet |
| 19 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 20 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 21 | method: GET |
| 22 | response: |
| 23 | status_code: 404 |
| 24 | |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 25 | - name: type list empty |
| 26 | request: |
| 27 | url: http://localhost:10000/a1-p/policytypes |
| 28 | method: GET |
| 29 | response: |
| 30 | status_code: 200 |
| 31 | body: [] |
| 32 | |
| 33 | - name: instance list 404 |
| 34 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 35 | url: http://localhost:10000/a1-p/policytypes/6660666/policies |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 36 | method: GET |
| 37 | response: |
| 38 | status_code: 404 |
| 39 | |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 40 | - name: put the type |
| 41 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 42 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 43 | method: PUT |
| 44 | json: |
| 45 | name: Admission Control |
| 46 | description: various parameters to control admission of dual connection |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 47 | policy_type_id: 6660666 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 48 | create_schema: |
| 49 | "$schema": http://json-schema.org/draft-07/schema# |
| 50 | type: object |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 51 | additionalProperties: false |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 52 | properties: |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 53 | class: |
| 54 | type: integer |
| 55 | minimum: 1 |
| 56 | maximum: 256 |
| 57 | description: integer id representing class to which we are applying policy |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 58 | enforce: |
| 59 | type: boolean |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 60 | description: Whether to enable or disable enforcement of policy on this class |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 61 | window_length: |
| 62 | type: integer |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 63 | minimum: 15 |
| 64 | maximum: 300 |
| 65 | description: Sliding window length in seconds |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 66 | trigger_threshold: |
| 67 | type: integer |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 68 | minimum: 1 |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 69 | blocking_rate: |
| 70 | type: number |
| 71 | minimum: 0 |
| 72 | maximum: 100 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 73 | required: |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 74 | - class |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 75 | - enforce |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 76 | - window_length |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 77 | - trigger_threshold |
| 78 | - blocking_rate |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 79 | response: |
| 80 | status_code: 201 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 81 | |
| 82 | - name: type there now |
| 83 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 84 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 85 | method: GET |
| 86 | response: |
| 87 | status_code: 200 |
| 88 | |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 89 | - name: now in type list |
| 90 | request: |
| 91 | url: http://localhost:10000/a1-p/policytypes |
| 92 | method: GET |
| 93 | response: |
| 94 | status_code: 200 |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 95 | body: [6660666] |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 96 | |
| 97 | - name: instance list 200 but empty |
| 98 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 99 | url: http://localhost:10000/a1-p/policytypes/6660666/policies |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 100 | method: GET |
| 101 | response: |
| 102 | status_code: 200 |
| 103 | body: [] |
| 104 | |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 105 | - name: test the admission control policy get not there yet |
| 106 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 107 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 108 | method: GET |
| 109 | response: |
| 110 | status_code: 404 |
| 111 | |
| 112 | - name: test the admission control policy status get not there yet |
| 113 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 114 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 115 | method: GET |
| 116 | response: |
| 117 | status_code: 404 |
| 118 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 119 | - name: bad body for admission control policy |
| 120 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 121 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 122 | method: PUT |
| 123 | json: |
| 124 | not: "expected" |
| 125 | headers: |
| 126 | content-type: application/json |
| 127 | response: |
| 128 | status_code: 400 |
| 129 | |
| 130 | - name: not a json |
| 131 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 132 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 133 | method: PUT |
| 134 | data: "asdf" |
| 135 | response: |
| 136 | status_code: 415 |
| 137 | |
| 138 | # put it properly |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 139 | - name: put the admission control policy instance |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 140 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 141 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 142 | method: PUT |
| 143 | json: |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 144 | class: 12 |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame] | 145 | enforce: true |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 146 | window_length: 20 |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame] | 147 | blocking_rate: 20 |
| 148 | trigger_threshold: 10 |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 149 | headers: |
| 150 | content-type: application/json |
| 151 | response: |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 152 | status_code: 202 |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 153 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 154 | - name: cant delete type with instances |
| 155 | delay_before: 3 # wait for the type acks to come back first |
| 156 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 157 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 158 | method: DELETE |
| 159 | response: |
| 160 | status_code: 400 |
| 161 | |
Tommy Carpenter | fdf0504 | 2019-07-18 20:21:21 +0000 | [diff] [blame] | 162 | - name: test the admission control policy get |
| 163 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 164 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | fdf0504 | 2019-07-18 20:21:21 +0000 | [diff] [blame] | 165 | method: GET |
| 166 | response: |
| 167 | status_code: 200 |
| 168 | body: |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 169 | class: 12 |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 170 | enforce: true |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 171 | window_length: 20 |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 172 | blocking_rate: 20 |
| 173 | trigger_threshold: 10 |
| 174 | |
Tommy Carpenter | 03a0083 | 2019-11-22 09:15:35 -0500 | [diff] [blame] | 175 | |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 176 | - name: test the admission control policy status get |
| 177 | delay_before: 3 # give it a few seconds for rmr |
| 178 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 179 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 180 | method: GET |
| 181 | response: |
| 182 | status_code: 200 |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 183 | body: |
| 184 | instance_status: "IN EFFECT" |
| 185 | has_been_deleted: False |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 186 | |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 187 | - name: instance list 200 and contains the instance |
| 188 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 189 | url: http://localhost:10000/a1-p/policytypes/6660666/policies |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 190 | method: GET |
| 191 | response: |
| 192 | status_code: 200 |
| 193 | body: |
| 194 | - admission_control_policy |
| 195 | |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 196 | # DELETE the instance and make sure subsequent GETs return properly |
| 197 | - name: delete the instance |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 198 | delay_after: 4 |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 199 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 200 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 201 | method: DELETE |
| 202 | response: |
| 203 | status_code: 202 |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 204 | |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 205 | - name: status should now be not in effect but still there |
| 206 | delay_before: 3 # give it a few seconds for rmr |
| 207 | delay_after: 8 # 3 + 11 > 10; that is, wait until t2 expires |
| 208 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 209 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 210 | method: GET |
| 211 | response: |
| 212 | status_code: 200 |
| 213 | body: |
| 214 | instance_status: "NOT IN EFFECT" |
| 215 | has_been_deleted: True |
| 216 | |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 217 | - name: instance list 200 but no instance |
| 218 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 219 | url: http://localhost:10000/a1-p/policytypes/6660666/policies |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 220 | method: GET |
| 221 | response: |
| 222 | status_code: 200 |
| 223 | body: [] |
| 224 | |
| 225 | - name: cant get instance status |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 226 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 227 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy/status |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 228 | method: GET |
| 229 | response: |
| 230 | status_code: 404 |
| 231 | |
| 232 | - name: cant get instance |
| 233 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 234 | url: http://localhost:10000/a1-p/policytypes/6660666/policies/admission_control_policy |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 235 | method: GET |
| 236 | response: |
| 237 | status_code: 404 |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 238 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 239 | - name: delete ac type |
| 240 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 241 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 242 | method: DELETE |
| 243 | response: |
| 244 | status_code: 204 |
| 245 | |
| 246 | - name: cant delete again |
| 247 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 248 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 249 | method: DELETE |
| 250 | response: |
| 251 | status_code: 404 |
| 252 | |
| 253 | - name: cant get |
| 254 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 255 | url: http://localhost:10000/a1-p/policytypes/6660666 |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 256 | method: DELETE |
| 257 | response: |
| 258 | status_code: 404 |
| 259 | |
| 260 | - name: empty type list |
| 261 | request: |
| 262 | url: http://localhost:10000/a1-p/policytypes |
| 263 | method: GET |
| 264 | response: |
| 265 | status_code: 200 |
| 266 | body: [] |
| 267 | |
| 268 | |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 269 | --- |
| 270 | |
| 271 | test_name: test the delay receiver |
| 272 | |
| 273 | stages: |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 274 | |
| 275 | - name: test the delay policy type not there yet |
| 276 | request: |
| 277 | url: http://localhost:10000/a1-p/policytypes/20001 |
| 278 | method: GET |
| 279 | response: |
| 280 | status_code: 404 |
| 281 | |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 282 | - name: not yet in type list |
| 283 | request: |
| 284 | url: http://localhost:10000/a1-p/policytypes |
| 285 | method: GET |
| 286 | response: |
| 287 | status_code: 200 |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 288 | body: [] |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 289 | |
| 290 | - name: instance list 404 |
| 291 | request: |
| 292 | url: http://localhost:10000/a1-p/policytypes/20001/policies |
| 293 | method: GET |
| 294 | response: |
| 295 | status_code: 404 |
| 296 | |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 297 | - name: put the type |
| 298 | request: |
| 299 | url: http://localhost:10000/a1-p/policytypes/20001 |
| 300 | method: PUT |
| 301 | json: |
| 302 | name: test policy |
| 303 | description: just for testing |
| 304 | policy_type_id: 20001 |
| 305 | create_schema: |
| 306 | "$schema": http://json-schema.org/draft-07/schema# |
| 307 | type: object |
| 308 | properties: |
| 309 | test: |
| 310 | type: string |
| 311 | required: |
| 312 | - test |
| 313 | additionalProperties: false |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 314 | response: |
| 315 | status_code: 201 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 316 | |
| 317 | - name: type there now |
| 318 | request: |
| 319 | url: http://localhost:10000/a1-p/policytypes/20001 |
| 320 | method: GET |
| 321 | response: |
| 322 | status_code: 200 |
| 323 | body: |
| 324 | name: test policy |
| 325 | description: just for testing |
| 326 | policy_type_id: 20001 |
| 327 | create_schema: |
| 328 | "$schema": http://json-schema.org/draft-07/schema# |
| 329 | type: object |
| 330 | properties: |
| 331 | test: |
| 332 | type: string |
| 333 | required: |
| 334 | - test |
| 335 | additionalProperties: false |
| 336 | |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 337 | - name: now in type list |
| 338 | request: |
| 339 | url: http://localhost:10000/a1-p/policytypes |
| 340 | method: GET |
| 341 | response: |
| 342 | status_code: 200 |
| 343 | body: |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 344 | - 20001 |
| 345 | |
| 346 | - name: instance list 200 but empty |
| 347 | request: |
| 348 | url: http://localhost:10000/a1-p/policytypes/20001/policies |
| 349 | method: GET |
| 350 | response: |
| 351 | status_code: 200 |
| 352 | body: [] |
| 353 | |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 354 | - name: test the delay policy instance get not there yet |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 355 | request: |
| 356 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest |
| 357 | method: GET |
| 358 | response: |
| 359 | status_code: 404 |
| 360 | |
| 361 | - name: test the delay policy status get not there yet |
| 362 | request: |
| 363 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status |
| 364 | method: GET |
| 365 | response: |
| 366 | status_code: 404 |
| 367 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 368 | - name: bad body for delaytest |
| 369 | request: |
| 370 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest |
| 371 | method: PUT |
| 372 | json: |
| 373 | not: "welcome" |
| 374 | response: |
| 375 | status_code: 400 |
| 376 | |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 377 | - name: create delay policy instance |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 378 | request: |
| 379 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest |
| 380 | method: PUT |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 381 | json: |
| 382 | test: foo |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 383 | headers: |
| 384 | content-type: application/json |
| 385 | response: |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 386 | status_code: 202 |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 387 | |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 388 | - name: test the delay status get, not in effect yet |
| 389 | request: |
| 390 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status |
| 391 | method: GET |
| 392 | response: |
| 393 | status_code: 200 |
| 394 | body: |
| 395 | instance_status: "NOT IN EFFECT" |
| 396 | has_been_deleted: False |
| 397 | |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 398 | - name: test the delay policy get |
| 399 | request: |
| 400 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest |
| 401 | method: GET |
| 402 | response: |
| 403 | status_code: 200 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 404 | body: |
| 405 | test: foo |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 406 | |
Tommy Carpenter | 30a7bdc | 2019-09-23 09:48:23 -0400 | [diff] [blame] | 407 | - name: instance list 200 and there |
| 408 | request: |
| 409 | url: http://localhost:10000/a1-p/policytypes/20001/policies |
| 410 | method: GET |
| 411 | response: |
| 412 | status_code: 200 |
| 413 | body: |
| 414 | - delaytest |
| 415 | |
Tommy Carpenter | 0a3f676 | 2019-11-06 09:24:16 -0500 | [diff] [blame] | 416 | - name: test the delay status get |
| 417 | max_retries: 3 |
| 418 | delay_before: 6 # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default |
| 419 | request: |
| 420 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status |
| 421 | method: GET |
| 422 | response: |
| 423 | status_code: 200 |
| 424 | body: |
| 425 | instance_status: "IN EFFECT" |
| 426 | has_been_deleted: False |
| 427 | |
| 428 | # DELETE the instance and make sure subsequent GETs return properly |
| 429 | - name: delete the instance |
| 430 | request: |
| 431 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest |
| 432 | method: DELETE |
| 433 | response: |
| 434 | status_code: 202 |
| 435 | |
| 436 | - name: test the delay status get immediately |
| 437 | request: |
| 438 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status |
| 439 | method: GET |
| 440 | response: |
| 441 | status_code: 200 |
| 442 | body: |
| 443 | instance_status: "IN EFFECT" |
| 444 | has_been_deleted: True |
| 445 | |
| 446 | - name: test the delay status get after delay but before timers |
| 447 | delay_before: 7 |
| 448 | request: |
| 449 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status |
| 450 | method: GET |
| 451 | response: |
| 452 | status_code: 200 |
| 453 | body: |
| 454 | instance_status: "NOT IN EFFECT" |
| 455 | has_been_deleted: True |
| 456 | |
| 457 | - name: test the delay status get after delay and after the timers |
| 458 | delay_before: 7 |
| 459 | request: |
| 460 | url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status |
| 461 | method: GET |
| 462 | response: |
| 463 | status_code: 404 |
| 464 | |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 465 | --- |
| 466 | |
Tommy Carpenter | 9d5ad71 | 2019-12-02 11:02:01 -0500 | [diff] [blame] | 467 | test_name: test query |
| 468 | |
| 469 | stages: |
| 470 | - name: type not there yet |
| 471 | request: |
| 472 | url: http://localhost:10000/a1-p/policytypes/1006001 |
| 473 | method: GET |
| 474 | response: |
| 475 | status_code: 404 |
| 476 | |
| 477 | - name: put the type |
| 478 | request: |
| 479 | url: http://localhost:10000/a1-p/policytypes/1006001 |
| 480 | method: PUT |
| 481 | json: |
| 482 | name: query test |
| 483 | description: test |
| 484 | policy_type_id: 1006001 |
| 485 | create_schema: |
| 486 | "$schema": http://json-schema.org/draft-07/schema# |
| 487 | type: object |
| 488 | additionalProperties: false |
| 489 | properties: |
| 490 | foo: |
| 491 | type: string |
| 492 | required: |
| 493 | - foo |
| 494 | response: |
| 495 | status_code: 201 |
| 496 | |
| 497 | - name: type there now |
| 498 | request: |
| 499 | url: http://localhost:10000/a1-p/policytypes/1006001 |
| 500 | method: GET |
| 501 | response: |
| 502 | status_code: 200 |
| 503 | |
| 504 | - name: instance list 200 but empty |
| 505 | request: |
| 506 | url: http://localhost:10000/a1-p/policytypes/1006001/policies |
| 507 | method: GET |
| 508 | response: |
| 509 | status_code: 200 |
| 510 | body: [] |
| 511 | |
| 512 | - name: instance 1 |
| 513 | request: |
| 514 | url: http://localhost:10000/a1-p/policytypes/1006001/policies/qt1 |
| 515 | method: PUT |
| 516 | json: |
| 517 | foo: "bar1" |
| 518 | headers: |
| 519 | content-type: application/json |
| 520 | response: |
| 521 | status_code: 202 |
| 522 | |
| 523 | - name: instance 2 |
| 524 | request: |
| 525 | url: http://localhost:10000/a1-p/policytypes/1006001/policies/qt2 |
| 526 | method: PUT |
| 527 | json: |
| 528 | foo: "bar2" |
| 529 | headers: |
| 530 | content-type: application/json |
| 531 | response: |
| 532 | status_code: 202 |
| 533 | |
| 534 | - name: instance list |
| 535 | request: |
| 536 | url: http://localhost:10000/a1-p/policytypes/1006001/policies |
| 537 | method: GET |
| 538 | response: |
| 539 | status_code: 200 |
| 540 | body: [qt1, qt2] |
| 541 | |
| 542 | # after the query, a1 should send, query receiver should send back, and the policy should be in effect |
| 543 | |
| 544 | - name: test the query status get |
| 545 | max_retries: 3 |
| 546 | delay_before: 6 # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default |
| 547 | request: |
| 548 | url: http://localhost:10000/a1-p/policytypes/1006001/policies/qt1/status |
| 549 | method: GET |
| 550 | response: |
| 551 | status_code: 200 |
| 552 | body: |
| 553 | instance_status: "IN EFFECT" |
| 554 | has_been_deleted: False |
| 555 | |
| 556 | - name: test the query status get 2 |
| 557 | max_retries: 3 |
| 558 | delay_before: 6 # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default |
| 559 | request: |
| 560 | url: http://localhost:10000/a1-p/policytypes/1006001/policies/qt2/status |
| 561 | method: GET |
| 562 | response: |
| 563 | status_code: 200 |
| 564 | body: |
| 565 | instance_status: "IN EFFECT" |
| 566 | has_been_deleted: False |
| 567 | |
| 568 | --- |
| 569 | |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 570 | test_name: test bad routing file endpoint |
| 571 | |
| 572 | stages: |
| 573 | |
| 574 | - name: put the type |
| 575 | request: |
| 576 | url: http://localhost:10000/a1-p/policytypes/20002 |
| 577 | method: PUT |
| 578 | json: |
| 579 | name: test policy |
| 580 | description: just for testing |
| 581 | policy_type_id: 20002 |
| 582 | create_schema: |
| 583 | "$schema": http://json-schema.org/draft-07/schema# |
| 584 | type: object |
| 585 | properties: |
| 586 | test: |
| 587 | type: string |
| 588 | required: |
| 589 | - test |
| 590 | additionalProperties: false |
| 591 | |
| 592 | - name: create policy instance that will go to a broken routing endpoint |
| 593 | request: |
| 594 | url: http://localhost:10000/a1-p/policytypes/20002/policies/brokentest |
| 595 | method: PUT |
| 596 | json: |
| 597 | test: foo |
| 598 | headers: |
| 599 | content-type: application/json |
| 600 | response: |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 601 | status_code: 202 |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 602 | |
| 603 | - name: should be no status |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 604 | request: |
| 605 | url: http://localhost:10000/a1-p/policytypes/20002/policies/brokentest/status |
| 606 | method: GET |
| 607 | response: |
| 608 | status_code: 200 |
| 609 | body: [] |
| 610 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 611 | # this one cant currently be deleted, see the comment in a1/data.py |
Tommy Carpenter | 40caa31 | 2019-09-12 16:24:10 -0400 | [diff] [blame] | 612 | |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 613 | --- |
| 614 | |
| 615 | test_name: bad_requests |
| 616 | |
| 617 | stages: |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 618 | |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 619 | - name: bad type get |
| 620 | request: |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 621 | url: http://localhost:10000/a1-p/policytypes/20666 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 622 | method: GET |
| 623 | response: |
| 624 | status_code: 404 |
| 625 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 626 | - name: bad instance get bad type |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 627 | request: |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 628 | url: http://localhost:10000/a1-p/policytypes/20666/policies/nonono |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 629 | method: GET |
| 630 | response: |
| 631 | status_code: 404 |
| 632 | |
| 633 | - name: bad int range 1 |
| 634 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 635 | url: http://localhost:10000/a1-p/policytypes/0 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 636 | method: PUT |
| 637 | json: |
| 638 | name: test policy |
| 639 | description: just for testing |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 640 | policy_type_id: 0 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 641 | create_schema: |
| 642 | "$schema": http://json-schema.org/draft-07/schema# |
| 643 | type: object |
| 644 | response: |
| 645 | status_code: 400 |
| 646 | |
| 647 | - name: bad int range 2 |
| 648 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 649 | url: http://localhost:10000/a1-p/policytypes/2147483648 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 650 | method: PUT |
| 651 | json: |
| 652 | name: test policy |
| 653 | description: just for testing |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 654 | policy_type_id: 2147483648 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 655 | create_schema: |
| 656 | "$schema": http://json-schema.org/draft-07/schema# |
| 657 | type: object |
| 658 | response: |
| 659 | status_code: 400 |