The URL with attributes that contains slashes cause troubles
and ends up with a response status code 400 (invalid request).
- ignore related unittest in functional tests
- adapt test_utils to handle invalid request in these cases
JIRA: NETCONF-1154
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: If03a720fea6b2fcbd2a2089ad88e9580daf5d411
'fec': 'off'},
response['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
'fec': 'off'},
response['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
+ @unittest.skip("attributes that contains slashes seems to give some troubles to the controller")
def test_13_service_path_create_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDRA01", "circuit-packs", "1%2F0%2F1-PLUG-NET")
# FIXME: https://jira.opendaylight.org/browse/TRNSPRTPCE-591
def test_13_service_path_create_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDRA01", "circuit-packs", "1%2F0%2F1-PLUG-NET")
# FIXME: https://jira.opendaylight.org/browse/TRNSPRTPCE-591
response = test_utils.check_node_attribute_request("XPDRA01", "interface", "XPDR1-CLIENT1-ETHERNET")
self.assertEqual(response['status_code'], requests.codes.conflict)
response = test_utils.check_node_attribute_request("XPDRA01", "interface", "XPDR1-CLIENT1-ETHERNET")
self.assertEqual(response['status_code'], requests.codes.conflict)
+ @unittest.skip("attributes that contains slashes seems to give some troubles to the controller")
def test_22_service_path_delete_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDRA01", "circuit-packs", "1%2F0%2F1-PLUG-NET")
self.assertEqual(response['status_code'], requests.codes.ok)
def test_22_service_path_delete_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDRA01", "circuit-packs", "1%2F0%2F1-PLUG-NET")
self.assertEqual(response['status_code'], requests.codes.ok)
**response['interface'][0]['org-openroadm-ethernet-interfaces:ethernet']),
response['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
**response['interface'][0]['org-openroadm-ethernet-interfaces:ethernet']),
response['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
+ @unittest.skip("attributes that contains slashes seems to give some troubles to the controller")
def test_15_service_path_create_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-NET")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn('not-reserved-inuse', response['circuit-packs'][0]['equipment-state'])
# FIXME: https://jira.opendaylight.org/browse/TRNSPRTPCE-591
def test_15_service_path_create_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-NET")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertIn('not-reserved-inuse', response['circuit-packs'][0]['equipment-state'])
# FIXME: https://jira.opendaylight.org/browse/TRNSPRTPCE-591
+ @unittest.skip("attributes that contains slashes seems to give some troubles to the controller")
def test_16_service_path_create_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-CLIENT")
self.assertEqual(response['status_code'], requests.codes.ok)
def test_16_service_path_create_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-CLIENT")
self.assertEqual(response['status_code'], requests.codes.ok)
response = test_utils.check_node_attribute_request("XPDR-A1", "interface", "XPDR1-CLIENT1-ETHERNET")
self.assertEqual(response['status_code'], requests.codes.conflict)
response = test_utils.check_node_attribute_request("XPDR-A1", "interface", "XPDR1-CLIENT1-ETHERNET")
self.assertEqual(response['status_code'], requests.codes.conflict)
+ @unittest.skip("attributes that contains slashes seems to give some troubles to the controller")
def test_28_service_path_delete_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-NET")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertEqual('not-reserved-available', response["circuit-packs"][0]['equipment-state'])
def test_28_service_path_delete_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-NET")
self.assertEqual(response['status_code'], requests.codes.ok)
self.assertEqual('not-reserved-available', response["circuit-packs"][0]['equipment-state'])
+ @unittest.skip("attributes that contains slashes seems to give some troubles to the controller")
def test_29_service_path_delete_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-CLIENT")
self.assertEqual(response['status_code'], requests.codes.ok)
def test_29_service_path_delete_xpdr_check(self):
response = test_utils.check_node_attribute_request("XPDR-A1", "circuit-packs", "1%2F0%2F1-PLUG-CLIENT")
self.assertEqual(response['status_code'], requests.codes.ok)
'draft-bierman02': attribute}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
'draft-bierman02': attribute}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
+ elif 'errors' in res.keys():
response_attribute = res['errors']['error'][0]
response_attribute = res['errors']['error'][0]
+ else:
+ # status code 400 invalid request
+ response_attribute = res['message'] + ' ' + res['url']
+ print(response_attribute)
return {'status_code': response.status_code,
attribute: response_attribute}
return {'status_code': response.status_code,
attribute: response_attribute}