hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject git commit: HBASE-11294 IntegrationTestIngestWithACL should automatically set the superuser when running on local minicluster (Ram)
Date Thu, 03 Jul 2014 05:26:04 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 180034b75 -> 5bd3ad3dd


HBASE-11294 IntegrationTestIngestWithACL should automatically set the
superuser when running on local minicluster (Ram)


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

Branch: refs/heads/0.98
Commit: 5bd3ad3dd14d8d134ebddaf9907d70de0f5de1b5
Parents: 180034b
Author: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Authored: Thu Jul 3 10:52:45 2014 +0530
Committer: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Committed: Thu Jul 3 10:55:31 2014 +0530

----------------------------------------------------------------------
 .../hbase/IntegrationTestIngestWithACL.java     |  3 ++-
 .../apache/hadoop/hbase/util/LoadTestTool.java  | 20 +++++---------------
 .../hbase/util/MultiThreadedReaderWithACL.java  |  1 -
 3 files changed, 7 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5bd3ad3d/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
index 94681cc..691f740 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
@@ -27,6 +27,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.io.hfile.HFile;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.security.access.AccessController;
+import org.apache.hadoop.hbase.security.access.SecureTestUtil;
 import org.apache.hadoop.hbase.util.LoadTestTool;
 import org.apache.hadoop.hbase.util.test.LoadTestDataGeneratorWithACL;
 import org.apache.hadoop.util.ToolRunner;
@@ -58,7 +59,7 @@ public class IntegrationTestIngestWithACL extends IntegrationTestIngest
{
     conf.setInt(HFile.FORMAT_VERSION_KEY, 3);
     conf.set("hbase.coprocessor.master.classes", AccessController.class.getName());
     conf.set("hbase.coprocessor.region.classes", AccessController.class.getName());
-    // conf.set("hbase.superuser", "admin");
+    SecureTestUtil.enableSecurity(conf);
     super.setUpCluster();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/5bd3ad3d/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
index b96f265..c0050ef 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
@@ -191,7 +191,7 @@ public class LoadTestTool extends AbstractHBaseTool {
 
   private String superUser;
 
-  private String userNames = "user1, user2, user3, user4";
+  private String userNames;
   //This file is used to read authentication information in secure clusters.
   private String authnFileName;
 
@@ -527,7 +527,7 @@ public class LoadTestTool extends AbstractHBaseTool {
           minColsPerKey, maxColsPerKey, COLUMN_FAMILY);
     }
 
-    if (User.isHBaseSecurityEnabled(conf) && userOwner != null) {
+    if (userOwner != null) {
       LOG.info("Granting permissions for user " + userOwner.getShortName());
       AccessControlProtos.Permission.Action[] actions = {
         AccessControlProtos.Permission.Action.ADMIN, AccessControlProtos.Permission.Action.CREATE,
@@ -543,20 +543,10 @@ public class LoadTestTool extends AbstractHBaseTool {
       // This will be comma separated list of expressions.
       String users[] = userNames.split(",");
       User user = null;
-      if (User.isHBaseSecurityEnabled(conf)) {
-        for (String userStr : users) {
+      for (String userStr : users) {
+        if (User.isHBaseSecurityEnabled(conf)) {
           user = User.create(loginAndReturnUGI(conf, userStr));
-          LOG.info("Granting READ permission for the user " + user.getShortName());
-          AccessControlProtos.Permission.Action[] actions = { AccessControlProtos.Permission.Action.READ
};
-          try {
-            AccessControlClient.grant(conf, tableName, user.getShortName(), null, null, actions);
-          } catch (Throwable e) {
-            LOG.fatal("Error in granting READ permission for the user " + user.getShortName(),
e);
-            return EXIT_FAILURE;
-          }
-	}
-      } else {
-        for (String userStr : users) {
+        } else {
           user = User.createUserForTesting(conf, userStr, new String[0]);
         }
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/5bd3ad3d/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
index 068f120..1aa4870 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
@@ -107,7 +107,6 @@ public class MultiThreadedReaderWithACL extends MultiThreadedReader {
               result = localTable.get(get);
             }
             boolean isNullExpected = ((((int) keyToRead % specialPermCellInsertionFactor))
== 0);
-            LOG.info("Read happening from ACL " + isNullExpected);
             getResultMetricUpdation(verify, rowKey, start, result, localTable, isNullExpected);
           } catch (IOException e) {
             recordFailure(keyToRead);


Mime
View raw message