diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/peer_discovery_dns_SUITE.erl | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/test/peer_discovery_dns_SUITE.erl b/test/peer_discovery_dns_SUITE.erl index 13bf93ca86..80bb2f8de6 100644 --- a/test/peer_discovery_dns_SUITE.erl +++ b/test/peer_discovery_dns_SUITE.erl @@ -48,6 +48,14 @@ suite() -> %% Testsuite setup/teardown. %% ------------------------------------------------------------------- +%% peer_discovery.tests.rabbitmq.net used in the tests below +%% returns three A records two of which fail our resolution process: +%% +%% * One does not resolve to a [typically] non-reachable IP +%% * One does not support reverse lookup queries + +-define(DISCOVERY_ENDPOINT, "peer_discovery.tests.rabbitmq.net"). + init_per_suite(Config) -> rabbit_ct_helpers:log_environment(), rabbit_ct_helpers:run_setup_steps(Config). @@ -55,19 +63,28 @@ init_per_suite(Config) -> end_per_suite(Config) -> rabbit_ct_helpers:run_teardown_steps(Config). +init_per_testcase(_Testcase, Config) -> + %% TODO: support IPv6-only environments + case inet_res:lookup(?DISCOVERY_ENDPOINT, in, a) of + [] -> + {skip, "pre-configured *.rabbitmq.net record does not resolve, skipping"}; + [_ | _] -> + Config + end. + +end_per_testcase(_Testcase, Config) -> + case inet_res:lookup(?DISCOVERY_ENDPOINT, in, a) of + [] -> + {skip, "pre-configured *.rabbitmq.net record does not resolve, skipping"}; + [_ | _] -> + Config + end. + %% ------------------------------------------------------------------- %% Test cases %% ------------------------------------------------------------------- -%% peer_discovery.tests.rabbitmq.net used in the tests below -%% returns three A records two of which fail our resolution process: -%% -%% * One does not resolve to a [typically] non-reachable IP -%% * One does not support reverse lookup queries - --define(DISCOVERY_ENDPOINT, "peer_discovery.tests.rabbitmq.net"). - hostname_discovery_with_long_node_names(_) -> Result = rabbit_peer_discovery_dns:discover_hostnames(?DISCOVERY_ENDPOINT, true), ?assertEqual(["www.rabbitmq.com"], Result). |
