Closed ArturoQuintana closed 3 years ago
The action to patch the Evc backup_links attribute returns a code error 500, forbidding modifying that attribute.
def test_145_patch_backup_links(self): api_url = KYTOS_API + '/mef_eline/v2/evc/' payload = { "name": "my evc1", "enabled": True, "uni_a": { "interface_id": "00:00:00:00:00:00:00:01:1", "tag": { "tag_type": 1, "value": 101 } }, "uni_z": { "interface_id": "00:00:00:00:00:00:00:03:1", "tag": { "tag_type": 1, "value": 101 } }, "primary_path": [ {"endpoint_a": {"id": "00:00:00:00:00:00:00:01:3"}, "endpoint_b": {"id": "00:00:00:00:00:00:00:02:2"}}, {"endpoint_a": {"id": "00:00:00:00:00:00:00:02:3"}, "endpoint_b": {"id": "00:00:00:00:00:00:00:03:2"}} ], "backup_links": [ {"endpoint_a": {"id": "00:00:00:00:00:00:00:01:4"}, "endpoint_b": {"id": "00:00:00:00:00:00:00:03:3"}}], } response = requests.post(api_url, data=json.dumps(payload), headers={'Content-type': 'application/json'}) data = response.json() evc1 = data['circuit_id'] time.sleep(10) payload2 = { "backup_links": [ {"endpoint_a": {"id": "00:00:00:00:00:00:00:01:3"}, "endpoint_b": {"id": "00:00:00:00:00:00:00:02:2"}}, {"endpoint_a": {"id": "00:00:00:00:00:00:00:02:3"}, "endpoint_b": {"id": "00:00:00:00:00:00:00:03:2"}} ] } # It sets a new circuit's backup_links response = requests.patch(api_url + evc1, data=json.dumps(payload2), headers={'Content-type': 'application/json'}) assert response.status_code == 200 time.sleep(10) # It verifies EVC's data response = requests.get(api_url + evc1) data = response.json() paths = [] for _path in data['backup_links']: paths.append({"endpoint_a": {"id": _path['endpoint_a']['id']}, "endpoint_b": {"id": _path['endpoint_b']['id']}}) assert paths == payload2["backup_links"] assert data['active'] is True
See example: Source
Repeated and more descriptive in issue #82
The action to patch the Evc backup_links attribute returns a code error 500, forbidding modifying that attribute.
See example: Source