summaryrefslogtreecommitdiff
path: root/src/test/test_hs_common.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-08-24 16:17:26 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-08-25 14:41:06 +0300
commitc980be951157b68e6bd658ce01850e96ce97d422 (patch)
treebb4a27b22019fa2292ea91bd86b45ab67e3a7155 /src/test/test_hs_common.c
parent8b8e39e04b365eefd7d69a488c04405cd6371645 (diff)
downloadtor-c980be951157b68e6bd658ce01850e96ce97d422.tar.gz
tor-c980be951157b68e6bd658ce01850e96ce97d422.zip
prop224: Refactor descriptor reupload logic.
We refactor the descriptor reupload logic to be similar to the v2 logic where we update a global 'consider_republishing_rend_descriptors' flag and then we use that to check for hash ring changes during the global hidden service callbacks. This fixes bugs where we would inspect the hash ring immediately as we receive new dirinfo (e.g. consensus) but before running the hidden service housekeeping events. That was leaving us in an inconsistent state wrt hsdir indices and causing bugs all around.
Diffstat (limited to 'src/test/test_hs_common.c')
-rw-r--r--src/test/test_hs_common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index ec938ff5d1..b1e47adf24 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -626,12 +626,11 @@ test_desc_reupload_logic(void *arg)
curr_hsdir_index, nickname, 1);
}
- /* Now call router_dir_info_changed() again and see that it detected the hash
- ring change and updated the upload time */
+ /* Now call service_desc_hsdirs_changed() and see that it detected the hash
+ ring change */
time_t now = approx_time();
tt_assert(now);
- router_dir_info_changed();
- tt_int_op(desc->next_upload_time, OP_EQ, now);
+ tt_int_op(service_desc_hsdirs_changed(service, desc), OP_EQ, 1);
/* Now pretend that the descriptor changed, and order a reupload to all
HSDirs. Make sure that the set of previous HSDirs was cleared. */