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 | |
| 467 | test_name: test bad routing file endpoint |
| 468 | |
| 469 | stages: |
| 470 | |
| 471 | - name: put the type |
| 472 | request: |
| 473 | url: http://localhost:10000/a1-p/policytypes/20002 |
| 474 | method: PUT |
| 475 | json: |
| 476 | name: test policy |
| 477 | description: just for testing |
| 478 | policy_type_id: 20002 |
| 479 | create_schema: |
| 480 | "$schema": http://json-schema.org/draft-07/schema# |
| 481 | type: object |
| 482 | properties: |
| 483 | test: |
| 484 | type: string |
| 485 | required: |
| 486 | - test |
| 487 | additionalProperties: false |
| 488 | |
| 489 | - name: create policy instance that will go to a broken routing endpoint |
| 490 | request: |
| 491 | url: http://localhost:10000/a1-p/policytypes/20002/policies/brokentest |
| 492 | method: PUT |
| 493 | json: |
| 494 | test: foo |
| 495 | headers: |
| 496 | content-type: application/json |
| 497 | response: |
Tommy Carpenter | bfa4614 | 2019-09-26 11:14:16 -0400 | [diff] [blame] | 498 | status_code: 202 |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 499 | |
| 500 | - name: should be no status |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 501 | request: |
| 502 | url: http://localhost:10000/a1-p/policytypes/20002/policies/brokentest/status |
| 503 | method: GET |
| 504 | response: |
| 505 | status_code: 200 |
| 506 | body: [] |
| 507 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 508 | # 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] | 509 | |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 510 | --- |
| 511 | |
| 512 | test_name: bad_requests |
| 513 | |
| 514 | stages: |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 515 | |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 516 | - name: bad type get |
| 517 | request: |
Tommy Carpenter | 148e269 | 2019-09-20 10:09:01 -0400 | [diff] [blame] | 518 | url: http://localhost:10000/a1-p/policytypes/20666 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 519 | method: GET |
| 520 | response: |
| 521 | status_code: 404 |
| 522 | |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 523 | - name: bad instance get bad type |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 524 | request: |
Tommy Carpenter | f87c857 | 2019-10-07 11:15:45 -0400 | [diff] [blame] | 525 | url: http://localhost:10000/a1-p/policytypes/20666/policies/nonono |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 526 | method: GET |
| 527 | response: |
| 528 | status_code: 404 |
| 529 | |
| 530 | - name: bad int range 1 |
| 531 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 532 | url: http://localhost:10000/a1-p/policytypes/0 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 533 | method: PUT |
| 534 | json: |
| 535 | name: test policy |
| 536 | description: just for testing |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 537 | policy_type_id: 0 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 538 | create_schema: |
| 539 | "$schema": http://json-schema.org/draft-07/schema# |
| 540 | type: object |
| 541 | response: |
| 542 | status_code: 400 |
| 543 | |
| 544 | - name: bad int range 2 |
| 545 | request: |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 546 | url: http://localhost:10000/a1-p/policytypes/2147483648 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 547 | method: PUT |
| 548 | json: |
| 549 | name: test policy |
| 550 | description: just for testing |
Tommy Carpenter | a7672bf | 2019-11-21 10:49:56 -0500 | [diff] [blame] | 551 | policy_type_id: 2147483648 |
Tommy Carpenter | 91ae889 | 2019-09-18 10:45:50 -0400 | [diff] [blame] | 552 | create_schema: |
| 553 | "$schema": http://json-schema.org/draft-07/schema# |
| 554 | type: object |
| 555 | response: |
| 556 | status_code: 400 |
| 557 | |
| 558 | |