diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2016-11-10 16:43:15 +0300 |
|---|---|---|
| committer | Michael Klishin <mklishin@pivotal.io> | 2016-11-10 16:43:15 +0300 |
| commit | 8defad6fb4620ad61a96c1459b85ebddfdc7d763 (patch) | |
| tree | 66bce730b918366745ae81c20e3ccabc8c17dce1 /src | |
| parent | 4c01ecd27e15da05d2a42abba0ba0ada9d3722d2 (diff) | |
| download | rabbitmq-server-git-8defad6fb4620ad61a96c1459b85ebddfdc7d763.tar.gz | |
Integration tests for rabbit_peer_discovery_dns
As previously discussed with the team, instead of starting a node
with customized resolution strategy (via `kernel.inetrc` [1]) and
a local erl-dns [2] node we rely on pre-configured records in
the rabbitmq.net domain.
For offline environments we will make the test a no-op if it can't
contact rabbitmq.net.
1. http://erlang.org/doc/apps/erts/inet_cfg.html
2. https://github.com/aetrion/erl-dns
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_peer_discovery_dns.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_peer_discovery_dns.erl b/src/rabbit_peer_discovery_dns.erl index 3e9e2d988a..e2b1f57312 100644 --- a/src/rabbit_peer_discovery_dns.erl +++ b/src/rabbit_peer_discovery_dns.erl @@ -21,7 +21,7 @@ -export([list_nodes/0, register/0, unregister/0]). %% for tests --export([discover_nodes/2]). +-export([discover_nodes/2, discover_hostnames/2]). %% %% API @@ -59,10 +59,12 @@ unregister() -> %% discover_nodes(SeedHostname, LongNamesUsed) -> - [rabbit_peer_discovery:append_node_prefix(H) || H <- discover_hostnames(SeedHostname, LongNamesUsed)]. + [rabbit_peer_discovery:append_node_prefix(H) || + H <- discover_hostnames(SeedHostname, LongNamesUsed)]. discover_hostnames(SeedHostname, LongNamesUsed) -> - Hosts = [extract_host(inet_res:gethostbyaddr(A), LongNamesUsed) || A <- inet_res:lookup(SeedHostname, in, a)], + Hosts = [extract_host(inet_res:gethostbyaddr(A), LongNamesUsed) || + A <- inet_res:lookup(SeedHostname, in, a)], lists:filter(fun(E) -> E =/= error end, Hosts). %% long node names are used |
