diff options
author | David Goulet <dgoulet@torproject.org> | 2021-01-12 10:55:21 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-01-12 10:55:21 -0500 |
commit | 9b59ede8d342a11d7949a4793b7d456de2a3ff5d (patch) | |
tree | efa10799bb4d2778b73a82358d9039a48bed1524 /src/test/test_hs_service.c | |
parent | d1f474160638e10478a2ab14fb93b1e8b6a720a2 (diff) | |
parent | b3652f2104c880bf626cb4e97e6088bca5a1571f (diff) | |
download | tor-9b59ede8d342a11d7949a4793b7d456de2a3ff5d.tar.gz tor-9b59ede8d342a11d7949a4793b7d456de2a3ff5d.zip |
Merge branch 'ticket40237_044_01' into ticket40237_045_01
Diffstat (limited to 'src/test/test_hs_service.c')
-rw-r--r-- | src/test/test_hs_service.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index e61d33ecb3..66e8e2f473 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -84,16 +84,18 @@ static networkstatus_t mock_ns; static networkstatus_t * -mock_networkstatus_get_live_consensus(time_t now) +mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor) { (void) now; + (void) flavor; return &mock_ns; } static networkstatus_t * -mock_networkstatus_get_live_consensus_null(time_t now) +mock_networkstatus_get_reasonably_live_consensus_null(time_t now, int flavor) { (void) now; + (void) flavor; return NULL; } @@ -1378,8 +1380,8 @@ test_rotate_descriptors(void *arg) hs_init(); MOCK(get_or_state, get_or_state_replacement); MOCK(circuit_mark_for_close_, mock_circuit_mark_for_close); - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus); /* Descriptor rotation happens with a consensus with a new SRV. */ @@ -1467,7 +1469,7 @@ test_rotate_descriptors(void *arg) hs_free_all(); UNMOCK(get_or_state); UNMOCK(circuit_mark_for_close_); - UNMOCK(networkstatus_get_live_consensus); + UNMOCK(networkstatus_get_reasonably_live_consensus); } /** Test building descriptors: picking intro points, setting up their link @@ -1487,8 +1489,8 @@ test_build_update_descriptors(void *arg) MOCK(get_or_state, get_or_state_replacement); - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus); dummy_state = or_state_new(); @@ -1716,8 +1718,8 @@ test_build_descriptors(void *arg) MOCK(get_or_state, get_or_state_replacement); - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus); dummy_state = or_state_new(); @@ -1817,8 +1819,8 @@ test_upload_descriptors(void *arg) hs_init(); MOCK(get_or_state, get_or_state_replacement); - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus); dummy_state = or_state_new(); @@ -2554,8 +2556,8 @@ test_cannot_upload_descriptors(void *arg) hs_init(); MOCK(get_or_state, get_or_state_replacement); - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus); dummy_state = or_state_new(); @@ -2631,17 +2633,17 @@ test_cannot_upload_descriptors(void *arg) /* 4. Testing missing live consensus. */ { - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus_null); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus_null); setup_full_capture_of_logs(LOG_INFO); run_upload_descriptor_event(now); expect_log_msg_containing( "Service [scrubbed] can't upload its current descriptor: " - "No live consensus"); + "No reasonably live consensus"); teardown_capture_of_logs(); /* Reset. */ - MOCK(networkstatus_get_live_consensus, - mock_networkstatus_get_live_consensus); + MOCK(networkstatus_get_reasonably_live_consensus, + mock_networkstatus_get_reasonably_live_consensus); } /* 5. Test missing minimum directory information. */ @@ -2680,7 +2682,7 @@ test_cannot_upload_descriptors(void *arg) done: hs_free_all(); UNMOCK(count_desc_circuit_established); - UNMOCK(networkstatus_get_live_consensus); + UNMOCK(networkstatus_get_reasonably_live_consensus); UNMOCK(get_or_state); } |