summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2019-09-18 11:40:10 -0400
committerDavid Goulet <dgoulet@torproject.org>2019-10-08 17:02:47 -0400
commit7c1b2fceb7d46aed8945d86806dc791f97c47125 (patch)
treed9b1402043837cc7e41e44ccb985ea272a441deb
parentf50de3a91872014f03856cf4c889f029ec5a1892 (diff)
downloadtor-7c1b2fceb7d46aed8945d86806dc791f97c47125.tar.gz
tor-7c1b2fceb7d46aed8945d86806dc791f97c47125.zip
test: New behavior on IP retry for HSv3
Unit test for #31652 where if we are over the retry limit for the IP but we have an established circuit, we don't remove the IP. Part of #31652
-rw-r--r--src/test/test_hs_service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index a2594ed6af..efe4166bf9 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -1298,6 +1298,11 @@ test_service_event(void *arg)
run_housekeeping_event(now);
tt_int_op(digest256map_size(service->desc_current->intro_points.map),
OP_EQ, 1);
+ /* No removal if we have an established circuit after retries. */
+ ip->circuit_retries = MAX_INTRO_POINT_CIRCUIT_RETRIES + 1;
+ run_housekeeping_event(now);
+ tt_int_op(digest256map_size(service->desc_current->intro_points.map),
+ OP_EQ, 1);
/* Remove the IP object at once for the next test. */
ip->circuit_retries = MAX_INTRO_POINT_CIRCUIT_RETRIES + 1;
ip->circuit_established = 0;