You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sd...@apache.org on 2015/10/27 02:23:11 UTC

[1/2] incubator-sentry git commit: SENTRY-930: Improve TestDbDDLAuditLog for keep consistent with Hive metadata.(Dapeng Sun, reviewed by Colin Ma)

Repository: incubator-sentry
Updated Branches:
  refs/heads/master b5bbcf94e -> 4a4bfecfe


SENTRY-930: Improve TestDbDDLAuditLog for keep consistent with Hive metadata.(Dapeng Sun, reviewed by Colin Ma)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/695d60d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/695d60d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/695d60d0

Branch: refs/heads/master
Commit: 695d60d075c4c735a555f350f2d953761c219cdf
Parents: b5bbcf9
Author: Sun Dapeng <sd...@apache.org>
Authored: Tue Oct 27 09:13:12 2015 +0800
Committer: Sun Dapeng <sd...@apache.org>
Committed: Tue Oct 27 09:13:12 2015 +0800

----------------------------------------------------------------------
 .../org/apache/sentry/tests/e2e/dbprovider/TestDbDDLAuditLog.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/695d60d0/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbDDLAuditLog.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbDDLAuditLog.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbDDLAuditLog.java
index 8613034..3afd6b2 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbDDLAuditLog.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbDDLAuditLog.java
@@ -84,6 +84,9 @@ public class TestDbDDLAuditLog extends AbstractTestWithStaticConfiguration {
     fieldValueMap.put(Constants.LOG_FIELD_IP_ADDRESS, null);
     assertAuditLog(fieldValueMap);
 
+    statement.execute("create database " + dbName);
+    statement.execute("use " + dbName);
+    statement.execute("CREATE TABLE " + tableName + " (c1 string)");
     statement.execute("GRANT ALL ON DATABASE " + dbName + " TO ROLE " + roleName);
     fieldValueMap.clear();
     fieldValueMap.put(Constants.LOG_FIELD_OPERATION, Constants.OPERATION_GRANT_PRIVILEGE);


[2/2] incubator-sentry git commit: SENTRY-931: Improve TestDatabaseProvider for keep consistent with Hive metadata.(Dapeng Sun, reviewed by Colin Ma)

Posted by sd...@apache.org.
SENTRY-931: Improve TestDatabaseProvider for keep consistent with Hive metadata.(Dapeng Sun, reviewed by Colin Ma)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/4a4bfecf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/4a4bfecf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/4a4bfecf

Branch: refs/heads/master
Commit: 4a4bfecfe77aca0c8152ad3357d92d19812fae0c
Parents: 695d60d
Author: Sun Dapeng <sd...@apache.org>
Authored: Tue Oct 27 09:14:40 2015 +0800
Committer: Sun Dapeng <sd...@apache.org>
Committed: Tue Oct 27 09:14:40 2015 +0800

----------------------------------------------------------------------
 .../sentry/tests/e2e/dbprovider/TestDatabaseProvider.java     | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4a4bfecf/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 dc008a2..98de57d 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
@@ -1225,6 +1225,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration {
     Connection connection = context.createConnection(ADMIN1);
     Statement statement = context.createStatement(connection);
 
+    statement.execute("CREATE TABLE IF NOT EXISTS tab1(c1 string)");
     //Drop a role which does not exist
     context.assertSentryException(statement, "DROP ROLE role1",
         SentryNoSuchObjectException.class.getSimpleName());
@@ -1474,6 +1475,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration {
     ResultSet resultSet = statement.executeQuery("SHOW GRANT ROLE role1");
     assertResultSize(resultSet, 0);
     statement.execute("CREATE ROLE role2");
+    statement.execute("CREATE TABLE IF NOT EXISTS t1(c1 string, c2 int)");
     statement.execute("GRANT SELECT ON TABLE t1 TO ROLE role1");
     statement.execute("GRANT ROLE role1 to GROUP " + USERGROUP1);
 
@@ -1532,6 +1534,10 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration {
     Connection connection = context.createConnection(ADMIN1);
     Statement statement = context.createStatement(connection);
     statement.execute("CREATE ROLE role1");
+    statement.execute("CREATE TABLE IF NOT EXISTS t1(c1 string, c2 int)");
+    statement.execute("CREATE TABLE IF NOT EXISTS t2(c1 string, c2 int)");
+    statement.execute("CREATE TABLE IF NOT EXISTS t3(c1 string, c2 int)");
+    statement.execute("CREATE TABLE IF NOT EXISTS t4(c1 string, c2 int)");
     statement.execute("GRANT SELECT (c1) ON TABLE t1 TO ROLE role1");
     statement.execute("GRANT SELECT (c2) ON TABLE t2 TO ROLE role1");
     statement.execute("GRANT SELECT (c1,c2) ON TABLE t3 TO ROLE role1");
@@ -1667,6 +1673,7 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration {
     Connection connection = context.createConnection(ADMIN1);
     Statement statement = context.createStatement(connection);
     statement.execute("CREATE ROLE role1");
+    statement.execute("CREATE TABLE IF NOT EXISTS t1(c1 string)");
     statement.execute("GRANT SELECT ON TABLE t1 TO ROLE role1");
 
     //On table - positive