sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ann...@apache.org
Subject sentry git commit: SENTRY-1156: TestDbColumnLevelMetaDataOps should add `use database` for user session created (Dapeng Sun, reviewed by Anne Yu).
Date Mon, 11 Apr 2016 20:31:01 GMT
Repository: sentry
Updated Branches:
  refs/heads/master e7d633c22 -> a902c2856


SENTRY-1156: TestDbColumnLevelMetaDataOps should add `use database` for user session created
(Dapeng Sun, reviewed by Anne Yu).


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

Branch: refs/heads/master
Commit: a902c2856f03f7f8dd7481918e57c29ba8fa23c7
Parents: e7d633c
Author: Anne Yu <anneyu@cloudera.com>
Authored: Mon Apr 11 13:35:43 2016 -0700
Committer: Anne Yu <anneyu@cloudera.com>
Committed: Mon Apr 11 14:02:18 2016 -0700

----------------------------------------------------------------------
 .../tests/e2e/dbprovider/TestDbColumnLevelMetaDataOps.java      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/a902c285/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbColumnLevelMetaDataOps.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbColumnLevelMetaDataOps.java
b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbColumnLevelMetaDataOps.java
index a454202..3735179 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbColumnLevelMetaDataOps.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDbColumnLevelMetaDataOps.java
@@ -292,6 +292,7 @@ public class TestDbColumnLevelMetaDataOps extends AbstractTestWithStaticConfigur
 
     String query = "SHOW COLUMNS IN " + TEST_COL_METADATA_OPS_DB + "." + TEST_COL_METADATA_OPS_TB;
     establishSession(USER1_1);
+    statement.execute("USE " + TEST_COL_METADATA_OPS_DB);
     ResultSet rs = executeQueryWithLog(query);
     boolean found = false;
     while (rs.next() && !found) {
@@ -305,9 +306,11 @@ public class TestDbColumnLevelMetaDataOps extends AbstractTestWithStaticConfigur
     rs.close();
 
     establishSession(ADMIN1);
+    statement.execute("USE " + TEST_COL_METADATA_OPS_DB);
     statement.execute("GRANT SELECT(" + colName + ") ON TABLE " + TEST_COL_METADATA_OPS_TB
+ " TO ROLE " + TEST_COL_METADATA_OPS_ROLE);
 
     establishSession(USER1_1);
+    statement.execute("USE " + TEST_COL_METADATA_OPS_DB);
     rs = executeQueryWithLog(query);
     found = false;
     while (rs.next() && !found) {
@@ -317,7 +320,7 @@ public class TestDbColumnLevelMetaDataOps extends AbstractTestWithStaticConfigur
         found = true;
       }
     }
-    assertTrue("Should not have implicit access to new column " + colName, !found);
+    assertTrue("Should have implicit access to new column " + colName, found);
     rs.close();
     validateSemanticException(query, USER2_1);
   }


Mime
View raw message