aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_mainloop.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-17 13:48:00 -0400
committerNick Mathewson <nickm@torproject.org>2019-04-04 11:48:36 -0400
commitd194f6bedf48410132b03fdab06b679512c14db1 (patch)
treefe698e0a444763f3c4bd0ac99bf6504d3b2d0d95 /src/test/test_mainloop.c
parent1547fd99a68cb22410ed0842267fb0a1f1de925f (diff)
downloadtor-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.c8
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);
}