sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ann...@apache.org
Subject incubator-sentry git commit: SENTRY-1096: Fix TestDbOperations#testCaseSensitivity failure on a real cluster. (Anne Yu, reviewed by Hao Hao).
Date Wed, 24 Feb 2016 23:59:32 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/master 219534765 -> 8669f8ae7


SENTRY-1096: Fix TestDbOperations#testCaseSensitivity failure on a real cluster. (Anne Yu,
reviewed by Hao Hao).


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

Branch: refs/heads/master
Commit: 8669f8ae70d9646e270c90a1b56fbcdf1f1db840
Parents: 2195347
Author: Anne Yu <anneyu@apache.org>
Authored: Mon Feb 22 17:22:48 2016 -0800
Committer: Anne Yu <anneyu@apache.org>
Committed: Wed Feb 24 16:27:20 2016 -0800

----------------------------------------------------------------------
 .../sentry/tests/e2e/hive/TestOperations.java     | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/8669f8ae/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
index 6ca09c9..7b44e0a 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestOperations.java
@@ -26,7 +26,7 @@ import java.sql.Statement;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.sentry.provider.file.PolicyFile;
 import static org.junit.Assert.assertTrue;
 import org.junit.Before;
@@ -34,8 +34,13 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.io.Resources;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TestOperations extends AbstractTestWithStaticConfiguration {
+  private static final Logger LOGGER = LoggerFactory
+      .getLogger(TestOperations.class);
+
   private PolicyFile policyFile;
   final String tableName = "tb1";
 
@@ -1081,13 +1086,14 @@ public class TestOperations extends AbstractTestWithStaticConfiguration
{
     Connection connection = null;
     try {
       createDb(ADMIN1, DB1);
-      String baseDir = dataDir.getPath();
-      Path extParentDir = dfs.assertCreateDir(baseDir + "/ABC/hhh");
-      Path extTableDir = dfs.assertCreateDir(baseDir + "/abc/hhh");
+      String scratchLikeDir = context.getProperty(HiveConf.ConfVars.SCRATCHDIR.varname);
+      String extParentDir = dfs.assertCreateDir(scratchLikeDir + "/ABC/hhh").toUri().toString();
+      String extTableDir = dfs.assertCreateDir(scratchLikeDir + "/abc/hhh").toUri().toString();
+      LOGGER.info("Created extParentDir = " + extParentDir + ", extTableDir = " + extTableDir);
       policyFile
-          .addPermissionsToRole("create_db1", privileges.get("create_db1"))
+          .addPermissionsToRole("all_db1", privileges.get("all_db1"))
           .addPermissionsToRole("all_uri", "server=server1->uri=" + extParentDir)
-          .addRolesToGroup(USERGROUP1, "create_db1", "all_uri");
+          .addRolesToGroup(USERGROUP1, "all_db1", "all_uri");
       writePolicyFile(policyFile);
       connection = context.createConnection(USER1_1);
       statement = context.createStatement(connection);


Mime
View raw message