You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by ja...@apache.org on 2014/06/11 06:11:52 UTC

git commit: SENTRY-287: Add test case for giving select privieleges on a table in a non default database

Repository: incubator-sentry
Updated Branches:
  refs/heads/master 13587ef40 -> 066b1c404


SENTRY-287: Add test case for giving select privieleges on a table in a non default database

(Sravya Tirukkovalur via Jarek Jarcec Cecho)


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

Branch: refs/heads/master
Commit: 066b1c404df3a81ffe7eb293a54f03aed1d97f05
Parents: 13587ef
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Tue Jun 10 21:11:08 2014 -0700
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Tue Jun 10 21:11:08 2014 -0700

----------------------------------------------------------------------
 .../tests/e2e/dbprovider/TestDbEndToEnd.java    | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/066b1c40/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
index cabd5db..634dd52 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbEndToEnd.java
@@ -83,6 +83,26 @@ public class TestDbEndToEnd extends AbstractTestWithDbProvider {
   }
 
   @Test
+  public void testNonDefault() throws Exception {
+    Connection connection = context.createConnection(ADMIN1);
+    Statement statement = context.createStatement(connection);
+    statement.execute("CREATE database db1");
+    statement.execute("USE db1");
+    statement.execute("CREATE TABLE t1 (c1 string)");
+    statement.execute("CREATE ROLE user_role");
+    statement.execute("GRANT SELECT ON TABLE t1 TO ROLE user_role");
+    statement.execute("GRANT ROLE user_role TO GROUP " + USERGROUP1);
+    statement.close();
+    connection.close();
+    connection = context.createConnection(USER1_1);
+    statement = context.createStatement(connection);
+
+    statement.execute("SELECT * FROM db1.t1");
+    statement.close();
+    connection.close();
+  }
+
+  @Test
   public void testUPrivileges() throws Exception {
     Connection connection = context.createConnection(ADMIN1);
     Statement statement = context.createStatement(connection);