From 0eae5317060a126dbc81b421ef690bf57e2f942b Mon Sep 17 00:00:00 2001 From: evgeny Date: Sun, 11 Oct 2026 16:48:53 +0200 Subject: [PATCH] Include local BGP presence and make queue diagnostics opt-in --- tests/Makefile.am | 3 +-- tests/stream_netns/node.c | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index afc8eec6..382d6a25 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -191,13 +191,12 @@ EXTRA_PROGRAMS += stream_netns/stream_lab_node stream_netns_stream_lab_node_SOURCES = stream_netns/node.c stream_netns_stream_lab_node_LDADD = $(LIBUTUN) $(CRYPTO_LIBS) $(COMMON_LIBS) -.PHONY: check-stream-netns check-stream-netns: stream_netns/stream_lab_node$(EXEEXT) python3 "$(srcdir)/stream_netns/run.py" --binary "$(abs_builddir)/stream_netns/stream_lab_node$(EXEEXT)" $(STREAM_NETNS_ARGS) endif # Разрывы двух узлов и race трёх SQLite-баз; не входит в all/check/check.sh. -.PHONY: check-merkle-sync-stress +.PHONY: check-merkle-sync-stress check-stream-netns check-merkle-sync-stress: test_merkle_sync_stress$(EXEEXT) ./test_merkle_sync_stress$(EXEEXT) diff --git a/tests/stream_netns/node.c b/tests/stream_netns/node.c index d0706387..f427a2a3 100644 --- a/tests/stream_netns/node.c +++ b/tests/stream_netns/node.c @@ -140,12 +140,15 @@ static uint64_t percentile(const struct lab_stream *stream, unsigned percent) { return LAB_HISTOGRAM - 1; } -static void statistics(struct lab *lab, uint64_t id) { +static void statistics(struct lab *lab, uint64_t id, int loads) { struct TOPO_GROUP *group = topo_groups_find(lab->inst->topo_groups, lab->group); printf("{\"id\":%" PRIu64 ",\"rc\":0,\"node\":\"%" PRIu64 "\",\"group\":\"%" PRIu64 "\",\"errors\":%d,\"online\":[", id, lab->inst->node_id, lab->group, lab->errors); int separator = 0; - for (struct ll_entry *e = group ? group->nodes->head : NULL; e; e = e->next) { + if (stream_member_online(lab->inst, lab->group, lab->inst->node_id)) { + printf("\"%" PRIu64 "\"", lab->inst->node_id); separator = 1; + } + for (struct ll_entry *e = loads && group ? group->nodes->head : NULL; e; e = e->next) { struct TOPO_GROUP_NODE *node = (struct TOPO_GROUP_NODE *)e; if (stream_member_online(lab->inst, lab->group, node->node_id)) { printf("%s\"%" PRIu64 "\"", separator++ ? "," : "", node->node_id); @@ -220,7 +223,7 @@ static void command(struct lab *lab, const char *json) { DEBUG_ERROR(DEBUG_CATEGORY_STREAM, "lab: invalid RPC"); reply(id, -1); return; } DEBUG_INFO(DEBUG_CATEGORY_STREAM, "lab: RPC id=%" PRIu64 " op=%s", id, operation); - if (!strcmp(operation, "stats")) { statistics(lab, id); return; } + if (!strcmp(operation, "stats")) { number(json, "loads", &value); statistics(lab, id, value != 0); return; } if (!strcmp(operation, "quit")) { stopping = 1; reply(id, 0); return; } if (!strcmp(operation, "create")) { if (lab->group) { reply(id, -1); return; }