diff --git a/src/riak_test.erl b/src/riak_test.erl index 017139fc..5ae6a21f 100644 --- a/src/riak_test.erl +++ b/src/riak_test.erl @@ -19,7 +19,6 @@ cli_options() -> main(Args) -> - %% @todo Fail cleanly if version of riak unavailable (e.g. 0.14.2) %% @todo loaded_upgrade basho_bench polution {ok, {ParsedArgs, HarnessArgs}} = getopt:parse(cli_options(), Args), diff --git a/src/rtdev.erl b/src/rtdev.erl index 16dfecdc..2cda2ee5 100644 --- a/src/rtdev.erl +++ b/src/rtdev.erl @@ -111,6 +111,9 @@ deploy_nodes(NodeConfig) -> NodeMap = orddict:from_list(lists:zip(Nodes, NodesN)), {Versions, Configs} = lists:unzip(NodeConfig), VersionMap = lists:zip(NodesN, Versions), + + %% Check that you have the right versions available + [ check_node(Version) || Version <- VersionMap ], rt:set_config(rt_nodes, NodeMap), rt:set_config(rt_versions, VersionMap), @@ -243,3 +246,11 @@ get_cmd_result(Port, Acc) -> after 0 -> timeout end. + +check_node({_N, Version}) -> + case proplists:is_defined(Version, rt:config(rtdev_path)) of + true -> ok; + _ -> + lager:error("You don't have Riak ~s installed", [Version]), + erlang:error("You don't have Riak " ++ Version ++ " installed" ) + end. \ No newline at end of file