Service not passing unitary tests
Reporters
- Lluis Gifre (CTTC)
Description
Service not passing unitary tests with error DNS resolution failed for pathcompservice:10020
. Seems issue with missing mock pathcomp component in unitary tests running in Docker. Try adding Mock PathComp and required environment variables.
_______ TestServiceHandlers.test_service_update_configure[l3nm_emulated] _______
self = <service.tests.test_unitary.TestServiceHandlers object at 0x7fb9fd529580>
service_id = {'context_id': {'context_uuid': {'uuid': 'admin'}}, 'service_uuid': {'uuid': 'SVC:R1/EP100-R3/EP100'}}
service_descriptor = {'service_config': {'config_rules': []}, 'service_constraints': [], 'service_endpoint_ids': [], 'service_id': {'context_id': {'context_uuid': {'uuid': 'admin'}}, 'service_uuid': {'uuid': 'SVC:R1/EP100-R3/EP100'}}, ...}
service_endpoint_ids = [{'device_id': {'device_uuid': {'uuid': 'R1'}}, 'endpoint_uuid': {'uuid': 'EP100'}}, {'device_id': {'device_uuid': {'uuid': 'R3'}}, 'endpoint_uuid': {'uuid': 'EP100'}}]
service_config_rules = [{'action': 1, 'custom': {'resource_key': '/settings', 'resource_value': '{"address_families": ["IPV4"], "bgp_as": 650...ix": 24, "route_distinguisher": "65000:321", "router_id": "20.20.20.1", "sub_interface_index": 400, "vlan_id": 500}'}}]
service_constraints = [{'custom': {'constraint_type': 'latency_ms', 'constraint_value': '15.2'}}, {'custom': {'constraint_type': 'jitter_us', 'constraint_value': '1.2'}}]
contexts = [{'context_id': {'context_uuid': {'uuid': 'admin'}}, 'service_ids': [], 'topology_ids': []}]
topologies = [{'device_ids': [], 'link_ids': [], 'topology_id': {'context_id': {'context_uuid': {'uuid': 'admin'}}, 'topology_uuid': {'uuid': 'admin'}}}]
devices = [{'device_config': {'config_rules': []}, 'device_drivers': [0], 'device_endpoints': [{'endpoint_id': {'device_id': {'d...point_type': 'optical', 'kpi_sample_types': [101, 102, 201, 202]}], 'device_id': {'device_uuid': {'uuid': 'O1'}}, ...}]
links = [{'link_endpoint_ids': [{'device_id': {'device_uuid': {'uuid': 'R1'}}, 'endpoint_uuid': {'uuid': 'EP1'}}, {'device_id'...evice_uuid': {'uuid': 'O1'}}, 'endpoint_uuid': {'uuid': 'EP3'}}], 'link_id': {'link_uuid': {'uuid': 'R3/EP1-O1/EP3'}}}]
context_client = <context.client.ContextClient.ContextClient object at 0x7fb9fed5e970>
device_client = <device.client.DeviceClient.DeviceClient object at 0x7fb9fed6b5b0>
service_client = <service.client.ServiceClient.ServiceClient object at 0x7fb9fed6bbb0>
def test_service_update_configure(
self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
contexts, topologies, devices, links,
context_client : ContextClient, # pylint: disable=redefined-outer-name
device_client : DeviceClient, # pylint: disable=redefined-outer-name
service_client : ServiceClient): # pylint: disable=redefined-outer-name
service_with_settings = copy.deepcopy(service_descriptor)
service_with_settings['service_endpoint_ids'].extend(service_endpoint_ids)
service_with_settings['service_config']['config_rules'].extend(service_config_rules)
service_with_settings['service_constraints'].extend(service_constraints)
> service_client.UpdateService(Service(**service_with_settings))
service/tests/test_unitary.py:125:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
common/tools/client/RetryDecorator.py:75: in wrapper
return func(self, *args, **kwargs)
service/client/ServiceClient.py:58: in UpdateService
response = self.stub.UpdateService(request)
/usr/local/lib/python3.9/site-packages/grpc/_channel.py:946: in __call__
return _end_unary_response_blocking(state, call, False, None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
state = <grpc._channel._RPCState object at 0x7fb9fd5291c0>
call = <grpc._cython.cygrpc.SegregatedCall object at 0x7fb9fd531f00>
with_call = False, deadline = None
def _end_unary_response_blocking(state, call, with_call, deadline):
if state.code is grpc.StatusCode.OK:
if with_call:
rendezvous = _MultiThreadedRendezvous(state, call, None, deadline)
return state.response, rendezvous
else:
return state.response
else:
> raise _InactiveRpcError(state)
E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E status = StatusCode.INTERNAL
E details = "Giving up... 15 tries failed"
E debug_error_string = "{"created":"@1669213112.106845345","description":"Error received from peer ipv4:127.0.0.1:13030","file":"src/core/lib/surface/call.cc","file_line":966,"grpc_message":"Giving up... 15 tries failed","grpc_status":13}"
E >
/usr/local/lib/python3.9/site-packages/grpc/_channel.py:849: _InactiveRpcError
------------------------------ Captured log call -------------------------------
INFO service.service.ServiceServiceServicerImpl:ServiceServiceServicerImpl.py:94 [UpdateService] begin ; request = {"service_config": {"config_rules": [{"action": "CONFIGACTION_SET", "custom": {"resource_key": "/settings", "resource_value": "{\"address_families\": [\"IPV4\"], \"bgp_as\": 65000, \"bgp_route_target\": \"65000:333\", \"mtu\": 1512}"}}, {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/device[R1]/endpoint[EP100]/settings", "resource_value": "{\"address_ip\": \"3.3.2.1\", \"address_prefix\": 24, \"route_distinguisher\": \"65000:123\", \"router_id\": \"10.10.10.1\", \"sub_interface_index\": 400, \"vlan_id\": 400}"}}, {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/device[R3]/endpoint[EP100]/settings", "resource_value": "{\"address_ip\": \"3.3.1.1\", \"address_prefix\": 24, \"route_distinguisher\": \"65000:321\", \"router_id\": \"20.20.20.1\", \"sub_interface_index\": 400, \"vlan_id\": 500}"}}]}, "service_constraints": [{"custom": {"constraint_type": "latency_ms", "constraint_value": "15.2"}}, {"custom": {"constraint_type": "jitter_us", "constraint_value": "1.2"}}], "service_endpoint_ids": [{"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "EP100"}}, {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "EP100"}}], "service_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "SVC:R1/EP100-R3/EP100"}}, "service_status": {"service_status": "SERVICESTATUS_PLANNED"}, "service_type": "SERVICETYPE_L3NM"}
INFO common.tests.MockServicerImpl_Context:MockServicerImpl_Context.py:264 [GetService] request={"context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "SVC:R1/EP100-R3/EP100"}}
INFO common.tests.MockServicerImpl_Context:MockServicerImpl_Context.py:269 [SetService] request={"service_config": {"config_rules": []}, "service_constraints": [], "service_endpoint_ids": [], "service_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "SVC:R1/EP100-R3/EP100"}}, "service_status": {"service_status": "SERVICESTATUS_PLANNED"}, "service_type": "SERVICETYPE_L3NM"}
INFO service.service.ServiceServiceServicerImpl:ServiceServiceServicerImpl.py:122 pathcomp_request={"services": [{"service_config": {"config_rules": [{"action": "CONFIGACTION_SET", "custom": {"resource_key": "/settings", "resource_value": "{\"address_families\": [\"IPV4\"], \"bgp_as\": 65000, \"bgp_route_target\": \"65000:333\", \"mtu\": 1512}"}}, {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/device[R1]/endpoint[EP100]/settings", "resource_value": "{\"address_ip\": \"3.3.2.1\", \"address_prefix\": 24, \"route_distinguisher\": \"65000:123\", \"router_id\": \"10.10.10.1\", \"sub_interface_index\": 400, \"vlan_id\": 400}"}}, {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/device[R3]/endpoint[EP100]/settings", "resource_value": "{\"address_ip\": \"3.3.1.1\", \"address_prefix\": 24, \"route_distinguisher\": \"65000:321\", \"router_id\": \"20.20.20.1\", \"sub_interface_index\": 400, \"vlan_id\": 500}"}}]}, "service_constraints": [{"custom": {"constraint_type": "latency_ms", "constraint_value": "15.2"}}, {"custom": {"constraint_type": "jitter_us", "constraint_value": "1.2"}}], "service_endpoint_ids": [{"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "EP100"}}, {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "EP100"}}], "service_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "SVC:R1/EP100-R3/EP100"}}, "service_status": {"service_status": "SERVICESTATUS_PLANNED"}, "service_type": "SERVICETYPE_L3NM"}], "shortest_path": {}}
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 1/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 2/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 3/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 4/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 5/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 6/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 7/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 8/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 9/15 after 5.000000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 10/15 after 5.120000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 11/15 after 10.240000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 12/15 after 20.480000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 13/15 after 40.960000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 14/15 after 81.920000 seconds...
INFO common.tools.client.RetryDecorator:RetryDecorator.py:85 Retry 15/15 after 163.840000 seconds...
ERROR service.service.ServiceServiceServicerImpl:Decorator.py:78 UpdateService exception
Traceback (most recent call last):
File "/var/teraflow/common/tools/client/RetryDecorator.py", line 75, in wrapper
return func(self, *args, **kwargs)
File "/var/teraflow/pathcomp/frontend/client/PathCompClient.py", line 51, in Compute
response = self.stub.Compute(request)
File "/usr/local/lib/python3.9/site-packages/grpc/_channel.py", line 946, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/usr/local/lib/python3.9/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "DNS resolution failed for pathcompservice:10020: C-ares status is not ARES_SUCCESS qtype=A name=pathcompservice is_balancer=0: Could not contact DNS servers"
debug_error_string = "{"created":"@1669213112.104995985","description":"DNS resolution failed for pathcompservice:10020: C-ares status is not ARES_SUCCESS qtype=A name=pathcompservice is_balancer=0: Could not contact DNS servers","file":"src/core/lib/transport/error_utils.cc","file_line":167,"grpc_status":14}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/teraflow/common/rpc_method_wrapper/Decorator.py", line 67, in inner_wrapper
reply = func(self, request, grpc_context)
File "/var/teraflow/service/service/ServiceServiceServicerImpl.py", line 123, in UpdateService
pathcomp_reply = pathcomp.Compute(pathcomp_request)
File "/var/teraflow/common/tools/client/RetryDecorator.py", line 81, in wrapper
if given_up: raise Exception('Giving up... {:d} tries failed'.format(max_retries)) from e
Exception: Giving up... 15 tries failed