Towards release 1.0.0 (for O-RAN A)
[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 test_name: test admission control
16
17 stages:
18   - name: test the admission control policy get not there yet
19     request:
20       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy
21       method: GET
22     response:
23       status_code: 404
24
25   - name: test the admission control policy status get not there yet
26     request:
27       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy/status
28       method: GET
29     response:
30       status_code: 404
31
32   - name: test the admission control policy
33     request:
34       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy
35       method: PUT
36       json:
37         enforce: true
38         window_length: 10
39         blocking_rate: 20
40         trigger_threshold: 10
41       headers:
42         content-type: application/json
43     response:
44       status_code: 201
45
46   - name: test the admission control policy get
47     request:
48       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy
49       method: GET
50     response:
51       status_code: 200
52       body:
53         enforce: true
54         window_length: 10
55         blocking_rate: 20
56         trigger_threshold: 10
57
58   - name: test the admission control policy status get
59     delay_before: 3 # give it a few seconds for rmr
60     request:
61       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy/status
62       method: GET
63     response:
64       status_code: 200
65       body:
66         - handler_id: test_receiver
67           status: OK
68
69 ---
70
71 test_name: test the delay receiver
72
73 stages:
74   - name: test the delay policy get not there yet
75     request:
76       url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest
77       method: GET
78     response:
79       status_code: 404
80
81   - name: test the delay policy status get not there yet
82     request:
83       url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status
84       method: GET
85     response:
86       status_code: 404
87
88   - name: test the delay policy
89     request:
90       url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest
91       method: PUT
92       json: {}
93       headers:
94         content-type: application/json
95     response:
96       status_code: 201
97
98   - name: test the delay policy get
99     request:
100       url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest
101       method: GET
102     response:
103       status_code: 200
104       body: {}
105
106   - name: test the admission control policy status get
107     delay_before: 8  # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default
108     request:
109       url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status
110       method: GET
111     response:
112       status_code: 200
113       body:
114         - handler_id: delay_receiver
115           status: OK
116
117
118
119
120 ---
121
122 test_name: bad_requests
123
124 stages:
125
126   - name: bad body for admission control policy
127     request:
128       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy
129       method: PUT
130       json:
131         not: "expected"
132       headers:
133         content-type: application/json
134     response:
135       status_code: 400
136
137   - name: not a json
138     request:
139       url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy
140       method: PUT
141       data: "asdf"
142     response:
143       status_code: 415
144
145   - name: bad body for test policy
146     request:
147       url: http://localhost:10000/a1-p/policytypes/20001/policies/test_policy
148       method: PUT
149       json:
150         not: "welcome"
151     response:
152       status_code: 400