diff --git a/conf_schema.h b/conf_schema.h index 579f202a..769a50fa 100644 --- a/conf_schema.h +++ b/conf_schema.h @@ -246,6 +246,7 @@ ATOM(bool_t, radio_link, 0, boolean,, "") ATOM(bool_t, overlaybuffer, 0, boolean,, "") ATOM(bool_t, overlayframes, 0, boolean,, "") ATOM(bool_t, packets_sent, 0, boolean,, "") +ATOM(bool_t, overlaytick, 0, boolean,, "") ATOM(bool_t, overlayrouting, 0, boolean,, "") ATOM(bool_t, overlayinterfaces, 0, boolean,, "") ATOM(bool_t, broadcasts, 0, boolean,, "") diff --git a/overlay_queue.c b/overlay_queue.c index 3f6b1056..1afce26b 100644 --- a/overlay_queue.c +++ b/overlay_queue.c @@ -586,6 +586,11 @@ int overlay_send_tick_packet(struct network_destination *destination) packet.seq); } overlay_fill_send_packet(&packet, gettime_ms(), debug); + // This debug statement is used for testing; do not remove or alter. + DEBUGF(overlaytick, "TICK name=%s destination=%s seq=%d", + packet.destination->interface->name, + alloca_socket_address(&packet.destination->address), + packet.seq); } return 0; } diff --git a/tests/keyring b/tests/keyring index e5336ed1..74b0d19d 100755 --- a/tests/keyring +++ b/tests/keyring @@ -39,6 +39,7 @@ setup_instances() { for arg; do set_instance $arg executeOk_servald config \ + set rhizome.enable off \ set log.console.level debug \ set debug.keyring on executeOk_servald keyring list @@ -177,9 +178,11 @@ test_KeyringPinIdentityPin() { assert_keyring_list 0 } -doc_KeyringAutoCreate="Starting a server with no interfaces does not create an identity" +doc_KeyringAutoCreate="Server with no interfaces does not create an identity" test_KeyringAutoCreate() { - executeOk_servald config set debug.mdprequests on + executeOk_servald config \ + set debug.mdprequests on \ + set debug.overlaytick on configure_servald_server() { : } @@ -196,13 +199,21 @@ teardown_KeyringAutoCreate() { teardown_servald } -doc_KeyringNoAutoCreate="Starting a server with interface creates an in-memory identity" +has_sent_mdp_tick_to() { + $GREP "TICK name=$1 " $instance_servald_log || return 1 + return 0 +} + +doc_KeyringNoAutoCreate="Server creates an in-memory identity on the first interface tick" test_KeyringNoAutoCreate() { - executeOk_servald config set debug.mdprequests on + executeOk_servald config \ + set debug.mdprequests on \ + set debug.overlaytick on configure_servald_server() { add_servald_interface } start_servald_server + wait_until has_sent_mdp_tick_to "dummy1/$instance_name" executeOk_servald keyring list assert_keyring_list 0 executeOk_servald id self