Greatly reduce the size of A1 docker from 1.25GB to 278MB
[ric-plt/a1.git] / integration_tests / test_a1.tavern.yaml
1 # test_a1.tavern.yaml
2
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
13
14 ---
15
16 test_name: test delayed policy
17
18 stages:
19   - name: test the delayed policy
20     request:
21       url: http://localhost:10000/a1-p/policies/test_policy
22       method: PUT
23       json:
24         {}
25       headers:
26         content-type: application/json
27     response:
28       status_code: 200
29       body:
30         ACK_FROM: DELAYED_TEST
31         status: SUCCESS
32
33
34 ---
35
36 test_name: test admission control
37
38 stages:
39   - name: test the admission control policy
40     request:
41       url: http://localhost:10000/a1-p/policies/admission_control_policy
42       method: PUT
43       json:
44         enforce: true
45         window_length: 10
46         blocking_rate: 20
47         trigger_threshold: 10
48       headers:
49         content-type: application/json
50     response:
51       status_code: 200
52       body:
53         ACK_FROM: ADMISSION_CONTROL
54         status: SUCCESS
55
56   - name: test the admission control policy get
57     request:
58       url: http://localhost:10000/a1-p/policies/admission_control_policy
59       method: GET
60     response:
61       status_code: 200
62       body:
63         mock return from FETCH: pretend policy is here
64
65 ---
66
67 test_name: bad_requests
68
69 stages:
70   - name: does not exist
71     request:
72       url: http://localhost:10000/a1-p/policies/darkness
73       method: PUT
74       json:
75         {}
76       headers:
77         content-type: application/json
78     response:
79       status_code: 404
80
81   - name: bad body for admission control policy
82     request:
83       url: http://localhost:10000/a1-p/policies/admission_control_policy
84       method: PUT
85       json:
86         not: "expected"
87       headers:
88         content-type: application/json
89     response:
90       status_code: 400
91
92   - name: not a json
93     request:
94       url: http://localhost:10000/a1-p/policies/admission_control_policy
95       method: PUT
96       data: "asdf"
97     response:
98       status_code: 415
99
100   - name: bad body for test policy
101     request:
102       url: http://localhost:10000/a1-p/policies/test_policy
103       method: PUT
104       json:
105         not: "welcome"
106     response:
107       status_code: 400
108
109   - name: test policy doesnt support fetch
110     request:
111       url: http://localhost:10000/a1-p/policies/test_policy
112       method: GET
113     response:
114       status_code: 400