X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=near-rt-ric-simulator%2Ftests%2Ftest_osc_2_1_0.py;h=deff757a98674c27c4a1f51faf6dabf8d9f5b029;hb=53215b7888bc6f361f998a3960252b733fd46e03;hp=31e70fdb5f976bd76ae9673090bc1728d94da884;hpb=868107297d275a6f50790a5e6d3de6c65cbd4a3e;p=sim%2Fa1-interface.git diff --git a/near-rt-ric-simulator/tests/test_osc_2_1_0.py b/near-rt-ric-simulator/tests/test_osc_2_1_0.py index 31e70fd..deff757 100644 --- a/near-rt-ric-simulator/tests/test_osc_2_1_0.py +++ b/near-rt-ric-simulator/tests/test_osc_2_1_0.py @@ -1,5 +1,5 @@ # ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# Copyright (C) 2021 Nordix Foundation. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ def test_apis(client): # Check used and implemented interfaces response=client.get(SERVER_URL+'container_interfaces') assert response.status_code == 200 - assert response.data == b"Current interface: OSC_2.1.0 All supported A1 interface yamls in this container: ['OSC_2.1.0', 'STD_1.1.3']" + assert response.data == b"Current interface: OSC_2.1.0 All supported A1 interface yamls in this container: ['OSC_2.1.0', 'STD_1.1.3', 'STD_2.0.0']" # Reset simulator instances response=client.post(SERVER_URL+'deleteinstances') @@ -156,11 +156,15 @@ def test_apis(client): res=compare(data_policies_get, result) assert res == True - # API: Create policy instance pi2 (copy of pi1) of type: 1. Shall fail + # API: Create policy instance pi2 (copy of pi1) of type: 1. with open(testdata+'pi1.json') as json_file: policy_2 = json.load(json_file) response=client.put(SERVER_URL+'a1-p/policytypes/1/policies/pi2', headers=header, data=json.dumps(policy_2)) - assert response.status_code == 400 + assert response.status_code == 202 + + # API: DELETE policy instance pi1 + response=client.delete(SERVER_URL+'a1-p/policytypes/1/policies/pi2') + assert response.status_code == 202 # Set force response code 401 response=client.post(SERVER_URL+'forceresponse?code=401') @@ -266,7 +270,7 @@ def test_apis(client): # API: Create policy instance pi2 of type: 2. Missing param, shall fail with open(testdata+'pi2_missing_param.json') as json_file: policy_2 = json.load(json_file) - response=client.put(SERVER_URL+'a1-p/policytypes/2/policies/pi1', headers=header, data=json.dumps(policy_2)) + response=client.put(SERVER_URL+'a1-p/policytypes/2/policies/pi2', headers=header, data=json.dumps(policy_2)) assert response.status_code == 400 # API: Create policy instance pi2 of type: 2 @@ -296,12 +300,6 @@ def test_apis(client): res=compare(data_policies_get, result) assert res == True - # API: Create policy instance pi11 (copy of pi1) of type: 1. Shall fail - with open(testdata+'pi1.json') as json_file: - policy_1 = json.load(json_file) - response=client.put(SERVER_URL+'a1-p/policytypes/1/policies/pi11', headers=header, data=json.dumps(policy_1)) - assert response.status_code == 400 - # Set force response code 409. ===" response=client.post(SERVER_URL+'forceresponse?code=401') assert response.status_code == 200