diff --git a/deps/rabbitmq_peer_discovery_consul/test/system_SUITE.erl b/deps/rabbitmq_peer_discovery_consul/test/system_SUITE.erl index 99080862509c..194d6b2e4132 100644 --- a/deps/rabbitmq_peer_discovery_consul/test/system_SUITE.erl +++ b/deps/rabbitmq_peer_discovery_consul/test/system_SUITE.erl @@ -197,10 +197,24 @@ start_consul(Config) -> ct:pal("Starting Consul daemon"), ConsulBin = ?config(consul_bin, Config), ConsulConfDir = ?config(consul_conf_dir, Config), - Cmd = [ConsulBin, "agent", "-config-dir", ConsulConfDir], - ConsulPid = spawn(fun() -> rabbit_ct_helpers:exec(Cmd) end), + PrivDir = ?config(priv_dir, Config), + LogFile = filename:join(PrivDir, "consul.log"), + Cmd = [ConsulBin, "agent", + "-config-dir", ConsulConfDir, + "-log-file", LogFile], + ConsulPid = spawn(fun() -> do_start_consul(Cmd) end), rabbit_ct_helpers:set_config(Config, {consul_pid, ConsulPid}). +do_start_consul(Cmd) -> + case rabbit_ct_helpers:exec(Cmd) of + {ok, Stdout} -> + ct:pal("Consul daemon exited:~n~s", [Stdout]); + {error, Reason, Stdout} -> + ct:pal( + "Consul daemon exited with error ~0p:~n~s", + [Reason, Stdout]) + end. + stop_consul(Config) -> case rabbit_ct_helpers:get_config(Config, consul_pid) of ConsulPid when is_pid(ConsulPid) -> diff --git a/deps/rabbitmq_peer_discovery_consul/test/system_SUITE_data/consul.hcl b/deps/rabbitmq_peer_discovery_consul/test/system_SUITE_data/consul.hcl index 4a850633c427..9374b7b3123a 100644 --- a/deps/rabbitmq_peer_discovery_consul/test/system_SUITE_data/consul.hcl +++ b/deps/rabbitmq_peer_discovery_consul/test/system_SUITE_data/consul.hcl @@ -23,7 +23,7 @@ connect { # Addresses and ports client_addr = "0.0.0.0" -bind_addr = "{{ GetInterfaceIP \"eth0\" }}" +bind_addr = "127.0.0.1" addresses { grpc = "0.0.0.0"