Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 1 | # test_a1.tavern.yaml |
| 2 | |
| 3 | --- |
| 4 | |
| 5 | test_name: test delayed policy |
| 6 | |
| 7 | stages: |
| 8 | - name: test the delayed policy |
| 9 | request: |
| 10 | url: http://localhost:10000/ric/policies/test_policy |
| 11 | method: PUT |
| 12 | json: |
| 13 | {} |
| 14 | headers: |
| 15 | content-type: application/json |
| 16 | response: |
| 17 | status_code: 200 |
| 18 | body: |
| 19 | ACK_FROM: DELAYED_TEST |
| 20 | status: SUCCESS |
| 21 | |
| 22 | |
| 23 | --- |
| 24 | |
| 25 | test_name: test admission control |
| 26 | |
| 27 | stages: |
| 28 | - name: test the admission control policy |
| 29 | request: |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame^] | 30 | url: http://localhost:10000/ric/policies/admission_control_policy |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 31 | method: PUT |
| 32 | json: |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame^] | 33 | enforce: true |
| 34 | window_length: 10 |
| 35 | blocking_rate: 20 |
| 36 | trigger_threshold: 10 |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 37 | headers: |
| 38 | content-type: application/json |
| 39 | response: |
| 40 | status_code: 200 |
| 41 | body: |
| 42 | ACK_FROM: ADMISSION_CONTROL |
| 43 | status: SUCCESS |
| 44 | |
| 45 | --- |
| 46 | |
| 47 | test_name: bad_requests |
| 48 | |
| 49 | stages: |
| 50 | - name: does not exist |
| 51 | request: |
| 52 | url: http://localhost:10000/ric/policies/darkness |
| 53 | method: PUT |
| 54 | json: |
| 55 | {} |
| 56 | headers: |
| 57 | content-type: application/json |
| 58 | response: |
| 59 | status_code: 404 |
| 60 | |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame^] | 61 | - name: bad body for admission control policy |
| 62 | request: |
| 63 | url: http://localhost:10000/ric/policies/admission_control_policy |
| 64 | method: PUT |
| 65 | json: |
| 66 | not: "expected" |
| 67 | headers: |
| 68 | content-type: application/json |
| 69 | response: |
| 70 | status_code: 400 |
| 71 | |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 72 | - name: not a json |
| 73 | request: |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame^] | 74 | url: http://localhost:10000/ric/policies/admission_control_policy |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 75 | method: PUT |
| 76 | data: "asdf" |
| 77 | response: |
| 78 | status_code: 415 |
| 79 | |
Tommy Carpenter | 2451446 | 2019-07-16 11:25:52 -0400 | [diff] [blame^] | 80 | - name: bad body for test policy |
Tommy Carpenter | 5ad8f03 | 2019-05-30 14:33:21 -0400 | [diff] [blame] | 81 | request: |
| 82 | url: http://localhost:10000/ric/policies/test_policy |
| 83 | method: PUT |
| 84 | json: |
| 85 | not: "welcome" |
| 86 | response: |
| 87 | status_code: 400 |