X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=integration_tests%2Ftest_a1.tavern.yaml;h=55a8937d551abe707adeceeb4c1f42c349b5a200;hb=f87c8579c3ed3e2dbf531c4c4c7e3b15489c7bdb;hp=47662ca133e47ecd0738f641c65fd9ceff501b17;hpb=a0876efd819b43b870ba2254b34676b1a03ad326;p=ric-plt%2Fa1.git diff --git a/integration_tests/test_a1.tavern.yaml b/integration_tests/test_a1.tavern.yaml index 47662ca..55a8937 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 @@ -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