From 0c2cdd2fb14652b9274a09291452fd22c54d5116 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 1 Aug 2022 16:20:13 +0200 Subject: [PATCH] test: fix ntp_core unit test to disable source selection If the randomly generated timestamps are close to the current time, the source can be selected for synchronization, which causes a crash when logging the source name due to uninitialized ntp_sources. Specify the source with the noselect option to prevent selection. --- test/unit/ntp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/ntp_core.c b/test/unit/ntp_core.c index 1d92ebf..875731e 100644 --- a/test/unit/ntp_core.c +++ b/test/unit/ntp_core.c @@ -385,7 +385,7 @@ add_dummy_auth(NTP_AuthMode auth_mode, uint32_t key_id, NTP_Packet *packet, NTP_ void test_unit(void) { - char source_line[] = "127.0.0.1 maxdelaydevratio 1e6"; + char source_line[] = "127.0.0.1 maxdelaydevratio 1e6 noselect"; char conf[][100] = { "allow", "port 0",