From 3b8cdd68e7468a1dd33b209a172254fb3e58d886 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Tue, 17 Sep 2024 16:21:36 -0400 Subject: [PATCH] Fixes #1594 - Add link-cost to link records in vanflow. --- src/adaptors/amqp/connection_manager.c | 1 + tests/system_tests_vflow.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/adaptors/amqp/connection_manager.c b/src/adaptors/amqp/connection_manager.c index 843292e6b..a12e0b63a 100644 --- a/src/adaptors/amqp/connection_manager.c +++ b/src/adaptors/amqp/connection_manager.c @@ -440,6 +440,7 @@ QD_EXPORT qd_connector_t *qd_dispatch_configure_connector(qd_dispatch_t *qd, qd_ ct->vflow_record = vflow_start_record(VFLOW_RECORD_LINK, 0); vflow_set_string(ct->vflow_record, VFLOW_ATTRIBUTE_NAME, ct->config.name); vflow_set_string(ct->vflow_record, VFLOW_ATTRIBUTE_ROLE, ct->config.role); + vflow_set_uint64(ct->vflow_record, VFLOW_ATTRIBUTE_LINK_COST, ct->config.inter_router_cost); vflow_set_string(ct->vflow_record, VFLOW_ATTRIBUTE_OPER_STATUS, "down"); vflow_set_uint64(ct->vflow_record, VFLOW_ATTRIBUTE_DOWN_COUNT, 0); vflow_set_string(ct->vflow_record, VFLOW_ATTRIBUTE_PROTOCOL, item->scheme); diff --git a/tests/system_tests_vflow.py b/tests/system_tests_vflow.py index 7cd6ec231..e9817a4aa 100644 --- a/tests/system_tests_vflow.py +++ b/tests/system_tests_vflow.py @@ -360,7 +360,7 @@ def setUpClass(cls): 'dataConnectionCount': 4}), ('listener', {'role': 'normal', 'port': cls.tester.get_port()}), - ('connector', {'role': 'inter-router', + ('connector', {'role': 'inter-router', 'cost': 23, 'port': cls.inter_router_port}), ('tcpConnector', {'host': '127.0.0.1', 'port': cls.tcp_connector_port, @@ -471,6 +471,7 @@ def test_01_check_topology(self): 'REASON': ANY_VALUE}), ('LINK', {'OPER_STATUS': 'up', 'ROLE': 'inter-router', + 'LINK_COST': 23, 'DESTINATION_PORT': str(self.inter_router_port)}) ], "INTB": [('ROUTER_ACCESS', {'LINK_COUNT': 1,