X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=integration_tests%2Ftest_a1.tavern.yaml;h=b4ccd6287d61b89f80d2e5fd7c0bbcb2e5a0f741;hb=8bcc51a6d44d40a1a338fb6a721b5ee8f992f323;hp=47662ca133e47ecd0738f641c65fd9ceff501b17;hpb=bfa46147cce23a46a49fb53dfae8a790b0fe34e4;p=ric-plt%2Fa1.git diff --git a/integration_tests/test_a1.tavern.yaml b/integration_tests/test_a1.tavern.yaml index 47662ca..b4ccd62 100644 --- a/integration_tests/test_a1.tavern.yaml +++ b/integration_tests/test_a1.tavern.yaml @@ -115,7 +115,26 @@ stages: response: status_code: 404 - # PUT the instance and make sure subsequent GETs return properly + - name: bad body for admission control policy + request: + url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy + method: PUT + json: + not: "expected" + headers: + content-type: application/json + response: + status_code: 400 + + - name: not a json + request: + url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy + method: PUT + data: "asdf" + response: + status_code: 415 + + # put it properly - name: put the admission control policy instance request: url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy @@ -130,6 +149,14 @@ stages: response: status_code: 202 + - name: cant delete type with instances + delay_before: 3 # wait for the type acks to come back first + request: + url: http://localhost:10000/a1-p/policytypes/20000 + method: DELETE + response: + status_code: 400 + - name: test the admission control policy get request: url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy @@ -162,6 +189,7 @@ stages: # DELETE the instance and make sure subsequent GETs return properly - name: delete the instance + delay_after: 3 # give it a few seconds for rmr request: url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy method: DELETE @@ -177,7 +205,6 @@ stages: body: [] - name: cant get instance status - delay_before: 3 # give it a few seconds for rmr request: url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy/status method: GET @@ -191,6 +218,36 @@ stages: response: status_code: 404 + - name: delete ac type + request: + url: http://localhost:10000/a1-p/policytypes/20000 + method: DELETE + response: + status_code: 204 + + - name: cant delete again + request: + url: http://localhost:10000/a1-p/policytypes/20000 + method: DELETE + response: + status_code: 404 + + - name: cant get + request: + url: http://localhost:10000/a1-p/policytypes/20000 + method: DELETE + response: + status_code: 404 + + - name: empty type list + request: + url: http://localhost:10000/a1-p/policytypes + method: GET + response: + status_code: 200 + body: [] + + --- test_name: test the delay receiver @@ -210,7 +267,7 @@ stages: method: GET response: status_code: 200 - body: [20000] + body: [] - name: instance list 404 request: @@ -266,7 +323,6 @@ stages: response: status_code: 200 body: - - 20000 - 20001 - name: instance list 200 but empty @@ -291,6 +347,15 @@ stages: response: status_code: 404 + - name: bad body for delaytest + request: + url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest + method: PUT + json: + not: "welcome" + response: + status_code: 400 + - name: create delay policy instance request: url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest @@ -311,9 +376,9 @@ stages: body: test: foo - - name: test the admission control policy status get + - name: test the delay status get max_retries: 3 - delay_before: 5 # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default + delay_before: 6 # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default request: url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest/status method: GET @@ -366,7 +431,6 @@ stages: status_code: 202 - name: should be no status - delay_before: 5 # give it a few seconds for rmr ; delay reciever sleeps for 5 seconds by default request: url: http://localhost:10000/a1-p/policytypes/20002/policies/brokentest/status method: GET @@ -374,6 +438,7 @@ stages: status_code: 200 body: [] + # this one cant currently be deleted, see the comment in a1/data.py --- @@ -388,10 +453,9 @@ stages: response: status_code: 404 - - - name: bad instance get + - name: bad instance get bad type request: - url: http://localhost:10000/a1-p/policytypes/20000/policies/darkness + url: http://localhost:10000/a1-p/policytypes/20666/policies/nonono method: GET response: status_code: 404 @@ -425,32 +489,3 @@ stages: status_code: 400 - - - - name: bad body for admission control policy - request: - url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy - method: PUT - json: - not: "expected" - headers: - content-type: application/json - response: - status_code: 400 - - - name: not a json - request: - url: http://localhost:10000/a1-p/policytypes/20000/policies/admission_control_policy - method: PUT - data: "asdf" - response: - status_code: 415 - - - name: bad body for delaytest - request: - url: http://localhost:10000/a1-p/policytypes/20001/policies/delaytest - method: PUT - json: - not: "welcome" - response: - status_code: 400