Skip to content

Commit

Permalink
Start epmd in unit tests if not running
Browse files Browse the repository at this point in the history
  • Loading branch information
schlagert committed Oct 8, 2014
1 parent 83755c7 commit 69a5edc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/lbm_kv_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
%% lead to undefined behaviour when used.

-define(TABLE, table).
-define(NODE, master).

%%%=============================================================================
%%% TESTS
Expand Down Expand Up @@ -253,7 +254,7 @@ distributed() ->
%%------------------------------------------------------------------------------
setup() ->
fun() ->
ok = distribute(master),
ok = distribute(?NODE),
{ok, Apps} = application:ensure_all_started(lbm_kv),
ok = lbm_kv:create(?TABLE),
ok = lbm_kv:replicate_to(?TABLE, node()),
Expand All @@ -273,6 +274,7 @@ teardown() ->
%% Make this node a distributed node.
%%------------------------------------------------------------------------------
distribute(Name) ->
os:cmd("epmd -daemon"),
case net_kernel:start([Name]) of
{ok, _} -> ok;
{error, {already_started, _}} -> ok;
Expand Down

0 comments on commit 69a5edc

Please sign in to comment.