----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61783/#review184322 -----------------------------------------------------------
Ship it! Ship It! - Ramesh Mani On Aug. 23, 2017, 10:57 a.m., Endre Zoltan Kovacs wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61783/ > ----------------------------------------------------------- > > (Updated Aug. 23, 2017, 10:57 a.m.) > > > Review request for ranger. > > > Bugs: RANGER-1631 > https://issues.apache.org/jira/browse/RANGER-1631 > > > Repository: ranger > > > Description > ------- > > added unit test for RANGER-1631 > > > Diffs > ----- > > > hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java > 2c9e9552 > hive-agent/src/test/resources/hive-policies.json 41a4e203 > > > Diff: https://reviews.apache.org/r/61783/diff/2/ > > > Testing > ------- > > added unit test to cover use case of: > RANGER-1631: create temp function failing with permission issues > (2e193e124399cf685c17798b8243e1d62f223315) > > My unit test creates a database test1. > Creates a UDF for test1. > Creates a temporary UDF (which is not bound to any database) > Asserts for the presence of these 2 UDFs. > > The test case includes: 1 Junit test method in > hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java > > and a new User called: tom in the policies file: > hive-agent/src/test/resources/hive-policies.json > > tom has Ranger policies to: > - create/read/update/delete databases > - create/read/update/delete UDF on test1 database > > > this unit test WILL fail when commit 2e193e124399cf685c17798b8243e1d62f223315 > is not present / reverted > (HiveAccessControlException: Permission denied: user [tom] does not have > [CREATE] privilege on [tmp]) > , and it will pass when that commit is present. > > > To run this test: > cd ranger/hive-agent > mvn test -Dtest=HIVERangerAuthorizerTest#testHiveUdfCreateOnWildcardDatabase > > To run this test alongside with its siblings: > cd ranger/hive-agent > mvn test -Dtest=HIVERangerAuthorizerTest > > > Thanks, > > Endre Zoltan Kovacs > >
