]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: fix ntp_core unit test to disable source selection
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 1 Aug 2022 14:20:13 +0000 (16:20 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 2 Aug 2022 12:44:05 +0000 (14:44 +0200)
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

index 1d92ebf08a0c4e0839e6b5c93eff503ca762ce73..875731e7192720b6dfd73753db260d7b249222f1 100644 (file)
@@ -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",