]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
test: New behavior on IP retry for HSv3
authorNeel Chauhan <neel@neelc.org>
Wed, 18 Sep 2019 15:40:10 +0000 (11:40 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 8 Oct 2019 21:02:47 +0000 (17:02 -0400)
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

src/test/test_hs_service.c

index a2594ed6afc6bf9313630fa1f60a9026c48bfa28..efe4166bf9a81e025feef66a7dcd0eeaccf193f0 100644 (file)
@@ -1296,6 +1296,11 @@ test_service_event(void *arg)
     service_intro_point_add(service->desc_current->intro_points.map, ip);
     ip->circuit_established = 1;  /* We'll test that, it MUST be 0 after. */
     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. */