Check metrics aggregate ACK queues and RTO state across paths
This commit is contained in:
1 parent
9c40b489cf
commit
0aaf6dfea0
1 file changed
+6
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user