From b5fea23ce551f5ccba347be626cbfd1f116b36af Mon Sep 17 00:00:00 2001 From: Nick Marino Date: Wed, 27 Jul 2016 14:16:22 -0400 Subject: [PATCH] Add test for mapred enabled via protocol buffers --- tests/verify_feature_enable_flags.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/verify_feature_enable_flags.erl b/tests/verify_feature_enable_flags.erl index 767677ed..73f08b28 100644 --- a/tests/verify_feature_enable_flags.erl +++ b/tests/verify_feature_enable_flags.erl @@ -95,8 +95,8 @@ verify_features_enabled_http(Client) -> verify_features_enabled_pb(Client) -> verify_list_buckets_enabled_pb(Client), verify_list_keys_enabled_pb(Client), - verify_secondary_index_enabled_pb(Client). - %%verify_map_reduce_enabled_pb(). + verify_secondary_index_enabled_pb(Client), + verify_mapred_enabled_pb(Client). verify_list_buckets_disabled_pb(Client) -> Expected = {error, <<"Operation 'list_buckets' is not enabled">>}, @@ -129,6 +129,12 @@ verify_secondary_index_enabled_pb(Client) -> Result = riakc_pb_socket:get_index_eq(Client, <<"2i_test">>, {integer_index, "test_idx"}, 42), ?assertMatch({ok, {index_results_v1, [<<"2">>], _, _}}, Result). +verify_mapred_enabled_pb(Client) -> + {ok, [{_, Results}]} = riakc_pb_socket:mapred(Client, <<"basic_test">>, []), + SortedResults = lists:sort(Results), + Expected = [{<<"basic_test">>, integer_to_binary(K)} || K <- lists:seq(1, 3)], + ?assertEqual(Expected, SortedResults). + verify_list_buckets_disabled_http(Client) -> Result = rhc:list_buckets(Client), ?assertMatch({error, {"403", _}}, Result).