From 0aaf6dfea013c23c0278008324ace3e749ce13bd Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 23 Oct 2026 11:26:45 +0200 Subject: [PATCH] Check metrics aggregate ACK queues and RTO state across paths --- tests/test_control_server.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_control_server.c b/tests/test_control_server.c index 50b9c8db..576d5871 100644 --- a/tests/test_control_server.c +++ b/tests/test_control_server.c @@ -184,7 +184,9 @@ static void test_metrics(void) { struct ll_queue empty = {0}; struct ETCP_CONN conn = {.peer_node_id = 42, .input_queue = &empty, .input_send_q = &empty, .input_wait_ack = &empty, .recv_q = &empty, .output_queue = &empty}; - struct ETCP_LINK links[2] = {{.local_link_id = 7}, {.local_link_id = 8}}; + struct ll_queue ack_queues[2] = {{.count = 1, .total_bytes = 16}, {.count = 2, .total_bytes = 32}}; + struct ETCP_LINK links[2] = {{.local_link_id = 7, .ack_q = &ack_queues[0]}, + {.local_link_id = 8, .ack_q = &ack_queues[1], .retrans_timer = &empty}}; links[0].next = &links[1]; conn.links = links; f.inst.connections = queue_new(f.inst.ua, 16, 0, 8, "test connections"); assert(f.inst.connections); struct ll_entry* entry = queue_entry_new(sizeof(struct conn_queue_entry)); assert(entry); @@ -199,6 +201,9 @@ static void test_metrics(void) { u_check(response->dgram, "metrics bounds", LOCATION); struct etcpmon_msg_header* hdr = (struct etcpmon_msg_header*)response->dgram; assert(hdr->type == ETCPMON_RSP_METRICS && hdr->seq_id == 23 && hdr->size == ETCPMON_METRICS_SIZE(count)); + struct etcpmon_rsp_metrics* rsp = (void*)(response->dgram + sizeof(*hdr)); + assert(rsp->etcp.ack_q_packets == (count == 1 ? 1 : 3) && rsp->etcp.ack_q_bytes == (count == 1 ? 16 : 48)); + assert(rsp->etcp.retrans_timer_active == (count == 2)); struct etcpmon_link_metrics* metrics = (void*)(response->dgram + sizeof(*hdr) + sizeof(struct etcpmon_rsp_metrics)); for (int i = 0; i < count; i++) { assert(metrics[i].local_link_id == 7 + i);