sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pras...@apache.org
Subject [1/3] SENTRY-380: Clean up some grantorPrincipal semantics (Sravya Tirukkovalur via Prasad Mujumdar)
Date Wed, 17 Sep 2014 06:03:41 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/master fd704487d -> b8f0622ff


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/dbcdb6d6/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
index 2865a6f..38fa69e 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
@@ -985,7 +985,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     statement.execute("REVOKE ALL ON SERVER server1 from role role1");
@@ -1007,7 +1007,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     statement.execute("REVOKE ALL ON DATABASE default from role role1");
@@ -1029,7 +1029,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
     statement.execute("REVOKE ALL ON URI 'file:///path' from role role1");
     resultSet = statement.executeQuery("SHOW GRANT ROLE role1");
@@ -1050,7 +1050,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     statement.execute("REVOKE ALL ON TABLE tab1 from role role1");
@@ -1072,7 +1072,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     statement.execute("REVOKE INSERT ON TABLE tab1 from role role1");
@@ -1094,7 +1094,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     statement.execute("REVOKE SELECT ON TABLE tab1 from role role1");
@@ -1119,7 +1119,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     //Revoke Partial privilege on table by admin
@@ -1140,7 +1140,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
 
     }
     statement.close();
@@ -1363,7 +1363,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(2), is(new Boolean("False")));
       //Create time is not tested
       //assertThat(resultSet.getLong(3), is(new Long(0)));
-      assertThat(resultSet.getString(4), equalToIgnoringCase(ADMIN1));
+      assertThat(resultSet.getString(4), equalToIgnoringCase("--"));
     }
     statement.close();
     connection.close();
@@ -1479,7 +1479,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
         assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
         //Create time is not tested
         //assertThat(resultSet.getLong(9), is(new Long(0)));
-        assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+        assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
       }
       statement.close();
       connection.close();
@@ -1520,7 +1520,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
     assertThat(rowCount, is(1));
     //On table - negative
@@ -1560,7 +1560,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     //On Database - positive
@@ -1576,7 +1576,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     //On Database - negative
@@ -1614,7 +1614,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     //On Database - postive
@@ -1630,7 +1630,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
 
     statement.close();
@@ -1662,7 +1662,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
     statement.close();
     connection.close();
@@ -1796,7 +1796,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration
{
       assertThat(resultSet.getBoolean(8), is(new Boolean("False")));//grantOption
       //Create time is not tested
       //assertThat(resultSet.getLong(9), is(new Long(0)));
-      assertThat(resultSet.getString(10), equalToIgnoringCase(ADMIN1));//grantor
+      assertThat(resultSet.getString(10), equalToIgnoringCase("--"));//grantor
     }
     statement.close();
     connection.close();

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/dbcdb6d6/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
index 6fad40d..a6edf03 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestMovingToProduction.java
@@ -38,7 +38,7 @@ public class TestMovingToProduction extends AbstractTestWithStaticConfiguration
 
 
   @Before
-  public void setUp() throws Exception {
+  public void setup() throws Exception {
     File dataFile = new File(dataDir, SINGLE_TYPE_DATA_FILE_NAME);
     FileOutputStream to = new FileOutputStream(dataFile);
     Resources.copy(Resources.getResource(SINGLE_TYPE_DATA_FILE_NAME), to);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/dbcdb6d6/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImport.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImport.java
b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImport.java
index c238361..a67556b 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImport.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImport.java
@@ -126,7 +126,6 @@ public class TestPolicyImport extends AbstractTestWithStaticConfiguration
{
     Set<TSentryPrivilege> actualPrivileges = client.listAllPrivilegesByRoleName("hive",
role);
     for (TSentryPrivilege privilege : actualPrivileges) {
       privilege.unsetCreateTime();
-      privilege.unsetGrantorPrincipal();
     }
 
     assertEquals("Expected privileges don't match.", expectedPrivileges, actualPrivileges);


Mime
View raw message