aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-06-16 13:09:54 +0200
committerpespin <pespin@sysmocom.de>2023-06-20 09:05:24 +0000
commit64c241be5d9d9c5836d96041cf84c5fcaa98a06d (patch)
tree5d61e2beb48f566c47e4ffec1a2b23964423ca2b /tests
parent14c1df98811165d3085de6be1244569137d59844 (diff)
stream: Allow setting name printed during logging
Diffstat (limited to 'tests')
-rw-r--r--tests/stream/stream_test.c3
-rw-r--r--tests/stream/stream_test.err10
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/stream/stream_test.c b/tests/stream/stream_test.c
index 36a222e..1b82d1a 100644
--- a/tests/stream/stream_test.c
+++ b/tests/stream/stream_test.c
@@ -214,6 +214,7 @@ static struct osmo_stream_cli *make_client(void *ctx, const char *host, unsigned
printf("Prepare %s stream client...\n", ASTR(autoreconnect));
+ osmo_stream_cli_set_name(cli, "cli_test");
osmo_stream_cli_set_addr(cli, host);
osmo_stream_cli_set_port(cli, port);
osmo_stream_cli_set_connect_cb(cli, connect_cb_cli);
@@ -323,6 +324,7 @@ static int accept_cb_srv(struct osmo_stream_srv_link *lnk, int fd)
LOGLNK(lnk, "error while creating connection\n");
return -EINVAL;
}
+ osmo_stream_srv_set_name(srv, "srv_test");
return 0;
}
@@ -390,6 +392,7 @@ int main(void)
return EXIT_FAILURE;
}
+ osmo_stream_srv_link_set_name(srv, "srv_link_test");
osmo_stream_srv_link_set_addr(srv, host);
osmo_stream_srv_link_set_port(srv, port);
osmo_stream_srv_link_set_accept_cb(srv, accept_cb_srv);
diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err
index ca98c82..9fba03e 100644
--- a/tests/stream/stream_test.err
+++ b/tests/stream/stream_test.err
@@ -12,15 +12,15 @@
{2.000006} autoreconnecting test step 6 [client OK, server OK], FD reg 1
{2.000007} autoreconnecting test step 5 [client OK, server OK], FD reg 1
-[CONNECTED] osmo_stream_cli_recv(): connection closed with srv
-[WAIT_RECONNECT] osmo_stream_cli_reconnect(): retrying in 9 seconds...
+CLICONN(cli_test){CONNECTED} connection closed with srv
+CLICONN(cli_test){WAIT_RECONNECT} retrying reconnect in 9 seconds...
{11.000008} autoreconnecting test step 4 [client OK, server OK], FD reg 0
{11.000009} autoreconnecting test step 3 [client OK, server OK], FD reg 1
{11.000010} autoreconnecting test step 2 [client OK, server OK], FD reg 0
-connection closed with client
+SRVCONN(srv_test) connection closed with client
{11.000011} autoreconnecting test step 1 [client OK, server NA], FD reg 0
@@ -37,7 +37,7 @@ connection closed with client
{11.000017} non-reconnecting test step 2 [client OK, server OK], FD reg 1
{11.000018} non-reconnecting test step 1 [client OK, server OK], FD reg 1
-[CONNECTED] osmo_stream_cli_recv(): connection closed with srv
-[CLOSED] osmo_stream_cli_reconnect(): not reconnecting, disabled
+CLICONN(cli_test){CONNECTED} connection closed with srv
+CLICONN(cli_test){CLOSED} not reconnecting, disabled
{20.000019} non-reconnecting test step 0 [client OK, server OK], FD reg 0