From 0cd8380d5571949dc22e3c31ee52b04fc538467b Mon Sep 17 00:00:00 2001 From: Mariano Guerra Date: Thu, 19 Feb 2015 10:12:38 +0000 Subject: [PATCH] failing test for issue #706, failing test output: riak_core_security_tests: security_test_ (Issue 706, error formatted correctly for unauthorized and bucket any)...*failed* in function unicode:characters_to_binary/3 called as characters_to_binary(any,utf8,utf8) in call from riak_core_security:check_permission/2 (src/riak_core_security.erl, line 380) in call from riak_core_security_tests:'-security_test_/0-fun-141-'/1 (test/riak_core_security_tests.erl, line 251) in call from riak_core_security_tests:'-security_test_/0-fun-142-'/0 (test/riak_core_security_tests.erl, line 251) **error:badarg --- test/riak_core_security_tests.erl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/riak_core_security_tests.erl b/test/riak_core_security_tests.erl index 7e9ab126d..f1c4c477a 100644 --- a/test/riak_core_security_tests.erl +++ b/test/riak_core_security_tests.erl @@ -241,7 +241,15 @@ security_test_() -> ?assertEqual(ok, riak_core_security:add_user(<<"fred">>, [])), ?assertMatch({error, {unknown_role, _}}, riak_core_security:print_grants(<<"group/fred">>)), ok - end}} - ]}. + end}}, + {timeout, 60, { "Issue 706, error formatted correctly for unauthorized and bucket any", + fun() -> + ?assertEqual(ok, riak_core_security:add_user(<<"sysadmin">>, [{"password", "password"}])), + ?assertEqual(ok, riak_core_security:add_source([<<"sysadmin">>], {{127, 0, 0, 1}, 32}, password, [])), + {ok, Ctx} = riak_core_security:authenticate(<<"sysadmin">>, <<"password">>, + [{ip, {127, 0, 0, 1}}]), + ?assertMatch({false, _}, riak_core_security:check_permissions({"riak_kv.get", any}, Ctx)), + ok + end}}]}. -endif.