diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-10-03 08:57:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-10-04 08:03:19 -0400 |
commit | fdfb4b196b7c38f45f2d37f73fcc96d746816cc3 (patch) | |
tree | 55083aa1c31c9234f860f7a88c8f981ee75ef534 /src/test/test_hs_config.c | |
parent | 4a0749596cc21198dd853bb0c631e9658db7fe2d (diff) | |
download | tor-fdfb4b196b7c38f45f2d37f73fcc96d746816cc3.tar.gz tor-fdfb4b196b7c38f45f2d37f73fcc96d746816cc3.zip |
Use {mock,unmock}_hostname_resolver() in relevant tests
These tests all invoke the hostname resolver in one way or another,
and therefore potentially block if our DNS server is missing,
absent, or extremely slow. Closes ticket 31841.
Diffstat (limited to 'src/test/test_hs_config.c')
-rw-r--r-- | src/test/test_hs_config.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/test_hs_config.c b/src/test/test_hs_config.c index 2b3afbb6e9..71e1529216 100644 --- a/src/test/test_hs_config.c +++ b/src/test/test_hs_config.c @@ -12,6 +12,7 @@ #include "test/test.h" #include "test/test_helpers.h" #include "test/log_test_helpers.h" +#include "test/resolve_test_helpers.h" #include "app/config/config.h" #include "feature/hs/hs_common.h" @@ -272,6 +273,7 @@ test_valid_service_v2(void *arg) int ret; (void) arg; + mock_hostname_resolver(); /* Valid complex configuration. Basic client authorization. */ { @@ -314,7 +316,7 @@ test_valid_service_v2(void *arg) } done: - ; + unmock_hostname_resolver(); } static void @@ -392,6 +394,7 @@ test_valid_service_v3(void *arg) int ret; (void) arg; + mock_hostname_resolver(); /* Valid complex configuration. */ { @@ -448,7 +451,7 @@ test_valid_service_v3(void *arg) } done: - ; + unmock_hostname_resolver(); } static void @@ -623,4 +626,3 @@ struct testcase_t hs_config_tests[] = { END_OF_TESTCASES }; - |