diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-03-17 13:48:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-04 11:48:36 -0400 |
commit | d194f6bedf48410132b03fdab06b679512c14db1 (patch) | |
tree | fe698e0a444763f3c4bd0ac99bf6504d3b2d0d95 /src/test/test_mainloop.c | |
parent | 1547fd99a68cb22410ed0842267fb0a1f1de925f (diff) | |
download | tor-d194f6bedf48410132b03fdab06b679512c14db1.tar.gz tor-d194f6bedf48410132b03fdab06b679512c14db1.zip |
Implement an DormantCanceledByStartup option
Closes ticket 29357, and comes with appropriate notions of caution.
Diffstat (limited to 'src/test/test_mainloop.c')
-rw-r--r-- | src/test/test_mainloop.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_mainloop.c b/src/test/test_mainloop.c index 2c3449305a..ed6b8a9b66 100644 --- a/src/test/test_mainloop.c +++ b/src/test/test_mainloop.c @@ -317,6 +317,14 @@ test_mainloop_dormant_load_state(void *arg) tt_assert(is_participating_on_network()); tt_i64_op(get_last_user_activity_time(), OP_EQ, start - 123*60); + // If we would start dormant, but DormantCanceledByStartup is set, then + // we start up non-dormant. + state->Dormant = 1; + get_options_mutable()->DormantCanceledByStartup = 1; + netstatus_load_from_state(state, start); + tt_assert(is_participating_on_network()); + tt_i64_op(get_last_user_activity_time(), OP_EQ, start); + done: or_state_free(state); } |