diff options
author | David Goulet <dgoulet@torproject.org> | 2017-08-11 15:41:23 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-24 13:03:28 -0400 |
commit | 520fcdf2f377909e980dfcc8baea4733476f096c (patch) | |
tree | a66eefdb4afdeafe120b5c0e426c7cd4f1c6e843 /src/test | |
parent | 31da3898e72cc2b9e8c25f6b4e89d34bbb17737e (diff) | |
download | tor-520fcdf2f377909e980dfcc8baea4733476f096c.tar.gz tor-520fcdf2f377909e980dfcc8baea4733476f096c.zip |
test: Fix broken HS upload descriptor test
We can't trigger a valid upload because it would require us to MOCK a long
list of functions ultimately not really testing the upload because we aren't
on a running network.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Conflicts:
src/test/test_hs_service.c
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_hs_service.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index 7263e04579..c93197ac20 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -1177,19 +1177,12 @@ test_build_update_descriptors(void *arg) UNMOCK(hs_overlap_mode_is_active); } -static int -mock_router_have_minimum_dir_info(void) -{ - return 1; -} - static void test_upload_descriptors(void *arg) { int ret; time_t now = time(NULL); hs_service_t *service; - hs_service_intro_point_t *ip; (void) arg; @@ -1227,29 +1220,10 @@ test_upload_descriptors(void *arg) /* If no upload happened, this should be untouched. */ tt_u64_op(service->desc_current->next_upload_time, OP_EQ, now + 1000); - /* Set our upload time in the past so we trigger an upload. */ - service->desc_current->next_upload_time = now - 1000; - service->desc_next->next_upload_time = now - 1000; - ip = helper_create_service_ip(); - ip->circuit_established = 1; - service_intro_point_add(service->desc_current->intro_points.map, ip); - - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); - MOCK(router_have_minimum_dir_info, - mock_router_have_minimum_dir_info); - - setup_full_capture_of_logs(LOG_WARN); - run_upload_descriptor_event(now); - teardown_capture_of_logs(); - tt_u64_op(service->desc_current->next_upload_time, OP_GE, - now + HS_SERVICE_NEXT_UPLOAD_TIME_MIN); - tt_u64_op(service->desc_current->next_upload_time, OP_LE, - now + HS_SERVICE_NEXT_UPLOAD_TIME_MAX); - done: hs_free_all(); UNMOCK(hs_overlap_mode_is_active); + UNMOCK(get_or_state); } /** Test the functions that save and load HS revision counters to state. */ |