diff --git a/tests/bucket_types.erl b/tests/bucket_types.erl index 7e426be5..3ea0e205 100644 --- a/tests/bucket_types.erl +++ b/tests/bucket_types.erl @@ -8,6 +8,10 @@ confirm() -> application:start(inets), lager:info("Deploy some nodes"), + + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + Nodes = rt:build_cluster(4, [], [ {riak_core, [{default_bucket_props, [ diff --git a/tests/http_security.erl b/tests/http_security.erl index fac70e32..413fb4c8 100644 --- a/tests/http_security.erl +++ b/tests/http_security.erl @@ -11,6 +11,9 @@ -define(assertDenied(Op), ?assertMatch({error, {forbidden, _}}, Op)). confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + application:start(crypto), application:start(asn1), application:start(public_key), diff --git a/tests/overload.erl b/tests/overload.erl index 8f5aab14..9be681b3 100644 --- a/tests/overload.erl +++ b/tests/overload.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2013 Basho Technologies, Inc. +%% Copyright (c) 2013-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -81,6 +81,9 @@ default_config(#config{ {riak_api, [{pb_backlog, 1024}]}]. confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + [Node1 | _] = Nodes = setup(), ok = create_bucket_type(Nodes, ?NORMAL_TYPE, [{n_val, 3}]), diff --git a/tests/pb_security.erl b/tests/pb_security.erl index e43a5ac1..531ffe23 100644 --- a/tests/pb_security.erl +++ b/tests/pb_security.erl @@ -11,6 +11,9 @@ -define(assertDenied(Op), ?assertMatch({error, <<"Permission",_/binary>>}, Op)). confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + application:start(crypto), application:start(asn1), application:start(public_key), diff --git a/tests/rolling_capabilities.erl b/tests/rolling_capabilities.erl index 5b05788b..716a4ddd 100644 --- a/tests/rolling_capabilities.erl +++ b/tests/rolling_capabilities.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2012 Basho Technologies, Inc. +%% Copyright (c) 2012-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -23,6 +23,9 @@ -include_lib("eunit/include/eunit.hrl"). confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + TestMetaData = riak_test_runner:metadata(), Count = 4, OldVsn = proplists:get_value(upgrade_version, TestMetaData, previous), diff --git a/tests/ts_cluster_capabilities_SUITE.erl b/tests/ts_cluster_capabilities_SUITE.erl index b055eb04..30e84dfd 100644 --- a/tests/ts_cluster_capabilities_SUITE.erl +++ b/tests/ts_cluster_capabilities_SUITE.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -30,19 +30,13 @@ %%-------------------------------------------------------------------- -define(TS_VERSION_CURRENT, "current"). - -%% git checkout riak_ts-1.3.1 && make locked-deps --define(TS_VERSION_1_3, riak_ts_1_3_1). - -define(SQL_SELECT_CAP, {riak_kv, sql_select_version}). suite() -> [{timetrap,{minutes,10}}]. init_per_suite(Config) -> - Versions = rt:find_version_by_name(["riak_ts-1.3.1", "riak_ts_ee-1.3.1"]), - Vsn131 = maybe_missing_1_3_1(Versions), - [{?TS_VERSION_1_3, Vsn131} | Config]. + Config. end_per_suite(_Config) -> ok. @@ -143,21 +137,19 @@ capability_not_specified_on_one_node_test(_Ctx) -> %% Riak TS Capability Tests %%-------------------------------------------------------------------- -sql_select_upgrade_a_node_from_1_3_test(Config) -> - Vsn131 = ?config(?TS_VERSION_1_3, Config), +sql_select_upgrade_a_node_from_legacy_test(_Ctx) -> [Node_A, Node_B, Node_C] = - rt:deploy_nodes([Vsn131, Vsn131, Vsn131]), + rt:deploy_nodes([legacy, legacy, legacy]), ok = rt:join_cluster([Node_A,Node_B,Node_C]), ok = rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), ok = rt:upgrade(Node_A, ?TS_VERSION_CURRENT), ok = rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), - ok = rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v1), + ok = rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v2), ok. -sql_select_join_with_all_nodes_upgraded_test(Config) -> - Vsn131 = ?config(?TS_VERSION_1_3, Config), +sql_select_join_with_all_nodes_upgraded_test(_Ctx) -> [Node_A, Node_B, Node_C] = - rt:deploy_nodes([Vsn131, Vsn131, Vsn131]), + rt:deploy_nodes([legacy, legacy, legacy]), ok = rt:join_cluster([Node_A,Node_B,Node_C]), rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), rt:upgrade(Node_A, ?TS_VERSION_CURRENT), @@ -168,18 +160,14 @@ sql_select_join_with_all_nodes_upgraded_test(Config) -> rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v3), ok. -%% This test passed for 1.4.0, expecting v1 where commented, but fails for 1.5.0 due to code change. We set it to expect -%% v3 until future changes are made. After 1.5.0 if this test will fail if new code is introduced to handle capability -%% communication. https://bashoeng.atlassian.net/browse/RTS-1415 -sql_select_downgrade_a_node_test(Config) -> - Vsn131 = ?config(?TS_VERSION_1_3, Config), +sql_select_downgrade_a_node_test(_Ctx) -> [Node_A, Node_B, Node_C] = - rt:deploy_nodes([Vsn131, ?TS_VERSION_CURRENT, ?TS_VERSION_CURRENT]), + rt:deploy_nodes([legacy, ?TS_VERSION_CURRENT, ?TS_VERSION_CURRENT]), ok = rt:join_cluster([Node_A,Node_B,Node_C]), rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), % rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v3), - rt:wait_until_capability(Node_B, ?SQL_SELECT_CAP, v1), - rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v1), + rt:wait_until_capability(Node_B, ?SQL_SELECT_CAP, v2), + rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v2), rt:upgrade(Node_A, ?TS_VERSION_CURRENT), rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v3), @@ -189,8 +177,8 @@ sql_select_downgrade_a_node_test(Config) -> %% pending changes to how capabilities are communicated around the ring, this %% section will expect v2. Once capabilities are changed in a future version of riak %% (or if testing 1.4.0 as current) - %% the expected version should go back to v1. - rt:upgrade(Node_A, Vsn131), + %% the expected version should go back to v2. + rt:upgrade(Node_A, legacy), rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), rt:wait_until_capability(Node_B, ?SQL_SELECT_CAP, v3), rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v3), @@ -200,10 +188,9 @@ sql_select_downgrade_a_node_test(Config) -> %% Perform queries in mixed version cluster %%-------------------------------------------------------------------- -query_in_mixed_version_cluster_test(Config) -> - Vsn131 = ?config(?TS_VERSION_1_3, Config), +query_in_mixed_version_cluster_test(_Ctx) -> [Node_A, Node_B, Node_C] = - rt:deploy_nodes([?TS_VERSION_CURRENT, Vsn131, ?TS_VERSION_CURRENT]), + rt:deploy_nodes([?TS_VERSION_CURRENT, previous, ?TS_VERSION_CURRENT]), ok = rt:join_cluster([Node_A,Node_B,Node_C]), rt:wait_until_ring_converged([Node_A,Node_B,Node_C]), Table = "grouptab1", @@ -220,7 +207,7 @@ query_in_mixed_version_cluster_test(Config) -> [{1,1,B*C} || B <- lists:seq(1,10), C <- lists:seq(1000,5000,1000)]), ExpectedResultSet = [{N} || N <- lists:seq(1000,5000,1000)], %% - %% Test that the current version can query version 1.3 + %% Test that the current version can query older version %% Query = "SELECT c FROM grouptab1 " @@ -232,7 +219,7 @@ query_in_mixed_version_cluster_test(Config) -> {ok,{Cols, Rows}} ), %% - %% Test that the 1.3 can query the current version + %% Test that the previous can query the current version %% {ok, {Cols, Rows}} = run_query(rt:pbc(Node_B), Query), ts_data:assert_row_sets( @@ -240,9 +227,3 @@ query_in_mixed_version_cluster_test(Config) -> {ok,{Cols, Rows}} ). -%% If 1.3.1 is not found, use a meaningful atom to prompt the error message -%% rtdev:check_version/1 -maybe_missing_1_3_1([]) -> - missing_version_ts_1_3_1; -maybe_missing_1_3_1([Vsn]) -> - Vsn. diff --git a/tests/ts_cluster_comprehensive.erl b/tests/ts_cluster_comprehensive.erl index d48019ac..5e06299a 100644 --- a/tests/ts_cluster_comprehensive.erl +++ b/tests/ts_cluster_comprehensive.erl @@ -1,6 +1,6 @@ % ------------------------------------------------------------------- %% -%% Copyright (c) 2015 Basho Technologies, Inc. +%% Copyright (c) 2015-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -39,6 +39,9 @@ confirm() -> run_tests(?PVAL_P1, ?PVAL_P2). run_tests(PvalP1, PvalP2) -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + Data = make_data(PvalP1, PvalP2), io:format("Data to be written:\n~p\n...\n~p\n", [hd(Data), lists:last(Data)]), diff --git a/tests/ts_cluster_list_irreg_keys_SUITE.erl b/tests/ts_cluster_list_irreg_keys_SUITE.erl index b0ee90f8..b885f69b 100644 --- a/tests/ts_cluster_list_irreg_keys_SUITE.erl +++ b/tests/ts_cluster_list_irreg_keys_SUITE.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -39,6 +39,9 @@ %%-------------------------------------------------------------------- suite() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + [{timetrap,{minutes,10}}]. init_per_suite(Config) -> diff --git a/tests/ts_cluster_stream_list_keys_SUITE.erl b/tests/ts_cluster_stream_list_keys_SUITE.erl index 9553d66e..8c48d9b9 100644 --- a/tests/ts_cluster_stream_list_keys_SUITE.erl +++ b/tests/ts_cluster_stream_list_keys_SUITE.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -31,6 +31,9 @@ %%-------------------------------------------------------------------- suite() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + [{timetrap,{minutes,10}}]. init_per_suite(Config) -> diff --git a/tests/ts_simple_pb_security_SUITE.erl b/tests/ts_simple_pb_security_SUITE.erl index a4ca869e..4d0f9f91 100644 --- a/tests/ts_simple_pb_security_SUITE.erl +++ b/tests/ts_simple_pb_security_SUITE.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -31,6 +31,9 @@ %%-------------------------------------------------------------------- suite() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + [{timetrap,{minutes,10}}]. init_per_suite(Config) -> diff --git a/tests/verify_api_timeouts.erl b/tests/verify_api_timeouts.erl index 0a6851cf..1ddbe878 100644 --- a/tests/verify_api_timeouts.erl +++ b/tests/verify_api_timeouts.erl @@ -8,6 +8,9 @@ -define(NUM_KEYS, 1000). confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + %% test requires allow_mult=false b/c of rt:systest_read [Node] = rt:build_cluster(1), rt:wait_until_pingable(Node), diff --git a/tests/verify_capabilities.erl b/tests/verify_capabilities.erl index a1ff966d..22407f35 100644 --- a/tests/verify_capabilities.erl +++ b/tests/verify_capabilities.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2012-2013 Basho Technologies, Inc. +%% Copyright (c) 2012-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -25,6 +25,9 @@ %% 1.4 {riak_kv, handoff_data_encoding} -> [encode_raw, encode_zlib] %% 1.3 {riak_kv, anti_entropy} -> [disabled, enabled_v1] confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + lager:info("Deploying mixed set of nodes"), Legacy = case lists:member(legacy, rt:versions()) of true -> legacy; diff --git a/tests/verify_dt_data_upgrade.erl b/tests/verify_dt_data_upgrade.erl index ac943567..907ce4b2 100644 --- a/tests/verify_dt_data_upgrade.erl +++ b/tests/verify_dt_data_upgrade.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -47,7 +47,7 @@ confirm() -> TestMetaData = riak_test_runner:metadata(), - OldVsn = proplists:get_value(upgrade_version, TestMetaData, lts), + OldVsn = proplists:get_value(upgrade_version, TestMetaData, legacy), NumNodes = 4, Vsns = [{OldVsn, ?CONFIG} || _ <- lists:seq(1, NumNodes)], @@ -116,7 +116,7 @@ confirm() -> ?assertEqual(FetchSet2, FetchSet3), %% Downgrade All Nodes and Compare - downgrade(Nodes, lts), + downgrade(Nodes, legacy), %% Create PB connection. Pid3 = rt:pbc(rt:select_random(Nodes)), diff --git a/tests/verify_job_enable_ac.erl b/tests/verify_job_enable_ac.erl index 0acf920c..faa4091a 100644 --- a/tests/verify_job_enable_ac.erl +++ b/tests/verify_job_enable_ac.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -36,6 +36,9 @@ [Class || {Class, Enabled} <- ?JOB_CLASS_DEFAULTS, Enabled]). confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + lager:info("Deploying 1 node"), rt:set_backend(eleveldb), [Node] = rt:build_cluster(1, ?CFG), diff --git a/tests/verify_job_enable_rc.erl b/tests/verify_job_enable_rc.erl index 511690bd..07630288 100644 --- a/tests/verify_job_enable_rc.erl +++ b/tests/verify_job_enable_rc.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2016 Basho Technologies, Inc. +%% Copyright (c) 2016-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -47,6 +47,9 @@ %% =================================================================== confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + Configs = [ {current, {cuttlefish, ?COMMON_CONFIG ++ config(?TEST_OPS, Bool, [])}} diff --git a/tests/verify_listkeys.erl b/tests/verify_listkeys.erl index 33af4493..66a77f54 100644 --- a/tests/verify_listkeys.erl +++ b/tests/verify_listkeys.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2012 Basho Technologies, Inc. +%% Copyright (c) 2012-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -29,6 +29,9 @@ -define(UNDEFINED_BUCKET_TYPE, <<"880bf69d-5dab-44ee-8762-d24c6f759ce1">>). confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + [Node1, Node2, Node3, Node4] = Nodes = rt:deploy_nodes(4), ?assertEqual(ok, rt:wait_until_nodes_ready(Nodes)), diff --git a/tests/verify_listkeys_eqcfsm.erl b/tests/verify_listkeys_eqcfsm.erl index d8f5f01e..66d20967 100644 --- a/tests/verify_listkeys_eqcfsm.erl +++ b/tests/verify_listkeys_eqcfsm.erl @@ -26,6 +26,9 @@ %% riak_test callback %% ==================================================================== confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + ?assert(eqc:quickcheck(eqc:numtests(?NUM_TESTS, ?MODULE:prop_test()))), pass. %% ==================================================================== diff --git a/tests/verify_mr_prereduce_node_down.erl b/tests/verify_mr_prereduce_node_down.erl index 265dd7a2..796c7b2e 100644 --- a/tests/verify_mr_prereduce_node_down.erl +++ b/tests/verify_mr_prereduce_node_down.erl @@ -1,6 +1,6 @@ %% ------------------------------------------------------------------- %% -%% Copyright (c) 2013 Basho Technologies, Inc. +%% Copyright (c) 2013-2017 Basho Technologies, Inc. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file @@ -42,6 +42,9 @@ %% @doc riak_test callback confirm() -> + %% Allow listing of buckets and keys for testing + application:set_env(riakc, allow_listing, true), + NodeCount = 4, lager:info("Build ~b-node cluster", [NodeCount]), [Primary,ToKill|_] = rt:build_cluster(NodeCount),