Skip to content

Commit c54c8b7

Browse files
committed
wip
1 parent f3ce9d7 commit c54c8b7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

deps/rabbitmq_peer_discovery_consul/test/system_SUITE.erl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,22 @@ start_consul(Config) ->
199199
ConsulConfDir = ?config(consul_conf_dir, Config),
200200
PrivDir = ?config(priv_dir, Config),
201201
LogFile = filename:join(PrivDir, "consul.log"),
202-
Cmd = [ConsulBin, "agent", "-config-dir", ConsulConfDir, "-log-file", LogFile],
203-
ConsulPid = spawn(fun() -> rabbit_ct_helpers:exec(Cmd) end),
202+
Cmd = [ConsulBin, "agent",
203+
"-config-dir", ConsulConfDir,
204+
"-log-file", LogFile],
205+
ConsulPid = spawn(fun() -> do_start_consul(Cmd) end),
204206
rabbit_ct_helpers:set_config(Config, {consul_pid, ConsulPid}).
205207

208+
do_start_consul(Cmd) ->
209+
case rabbit_ct_helpers:exec(Cmd) of
210+
{ok, Stdout} ->
211+
ct:pal("Consul daemon exited:~n~s", [Stdout]);
212+
{error, Reason, Stdout} ->
213+
ct:pal(
214+
"Consul daemon exited with error ~0p:~n~s",
215+
[Reason, Stdout])
216+
end.
217+
206218
stop_consul(Config) ->
207219
case rabbit_ct_helpers:get_config(Config, consul_pid) of
208220
ConsulPid when is_pid(ConsulPid) ->

0 commit comments

Comments
 (0)