hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [4/6] git commit: HBASE-11253 IntegrationTestWithCellVisibilityLoadAndVerify failing since HBASE-10326 (Anoop Sam John)
Date Mon, 26 May 2014 18:40:47 GMT
HBASE-11253 IntegrationTestWithCellVisibilityLoadAndVerify failing since HBASE-10326 (Anoop
Sam John)


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

Branch: refs/heads/0.98
Commit: bade38219bce159a4429d3e56f4a00363c810cb0
Parents: d29d73e
Author: Andrew Purtell <apurtell@apache.org>
Authored: Mon May 26 11:28:07 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon May 26 11:28:14 2014 -0700

----------------------------------------------------------------------
 .../test/IntegrationTestLoadAndVerify.java      |  6 ++---
 ...tionTestWithCellVisibilityLoadAndVerify.java | 25 +++++++++-----------
 2 files changed, 14 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bade3821/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
index 0bc5e5c..91efc79 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
@@ -123,10 +123,10 @@ public class IntegrationTestLoadAndVerify  extends IntegrationTestBase
 {
     util = getTestingUtil(getConf());
     util.initializeCluster(3);
     this.setConf(util.getConfiguration());
+    getConf().setLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT / 100);
+    getConf().setInt(NUM_MAP_TASKS_KEY, NUM_MAP_TASKS_DEFAULT / 100);
+    getConf().setInt(NUM_REDUCE_TASKS_KEY, NUM_REDUCE_TASKS_DEFAULT / 10);
     if (!util.isDistributedCluster()) {
-      getConf().setLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT / 100);
-      getConf().setInt(NUM_MAP_TASKS_KEY, NUM_MAP_TASKS_DEFAULT / 100);
-      getConf().setInt(NUM_REDUCE_TASKS_KEY, NUM_REDUCE_TASKS_DEFAULT / 10);
       util.startMiniMapReduceCluster();
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bade3821/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestWithCellVisibilityLoadAndVerify.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestWithCellVisibilityLoadAndVerify.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestWithCellVisibilityLoadAndVerify.java
index 52ca4c2..7b59909 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestWithCellVisibilityLoadAndVerify.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestWithCellVisibilityLoadAndVerify.java
@@ -99,8 +99,7 @@ public class IntegrationTestWithCellVisibilityLoadAndVerify extends IntegrationT
       numRowsLoadWithExp4;
   private long numRowsReadWithExp1, numRowsReadWithExp2, numRowsReadWithExp3, numRowsReadWithExp4;
 
-  private static User ADMIN;
-  private static User NORMAL_USER;
+  private static User USER1, USER2;
 
   private enum Counters {
     ROWS_VIS_EXP_1, ROWS_VIS_EXP_2, ROWS_VIS_EXP_3, ROWS_VIS_EXP_4;
@@ -113,22 +112,20 @@ public class IntegrationTestWithCellVisibilityLoadAndVerify extends
IntegrationT
     conf.setInt(HFile.FORMAT_VERSION_KEY, 3);
     conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
     conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
-    String adminName = User.getCurrent().getName();
-    conf.set("hbase.superuser", adminName);
+    conf.set("hbase.superuser", User.getCurrent().getName());
     super.setUpCluster();
-    ADMIN = User.createUserForTesting(conf, adminName, new String[] { "supergroup" });
-    NORMAL_USER = User.createUserForTesting(conf, "user1", new String[] {});
+    USER1 = User.createUserForTesting(conf, "user1", new String[] {});
+    USER2 = User.createUserForTesting(conf, "user2", new String[] {});
     addLabelsAndAuths();
   }
 
   private void addLabelsAndAuths() throws Exception {
     try {
       VisibilityClient.addLabels(util.getConfiguration(), LABELS);
-      VisibilityClient.setAuths(util.getConfiguration(), LABELS, User.getCurrent().getName());
       VisibilityClient.setAuths(util.getConfiguration(), new String[] { CONFIDENTIAL, TOPSECRET,
-          SECRET, PRIVATE }, ADMIN.getName());
+          SECRET, PRIVATE }, USER1.getName());
       VisibilityClient.setAuths(util.getConfiguration(), new String[] { PUBLIC },
-          NORMAL_USER.getName());
+          USER2.getName());
     } catch (Throwable t) {
       throw new IOException(t);
     }
@@ -254,7 +251,7 @@ public class IntegrationTestWithCellVisibilityLoadAndVerify extends IntegrationT
         return doVerify(conf, htd, CONFIDENTIAL, TOPSECRET, SECRET, PRIVATE);
       }
     };
-    Job job = ADMIN.runAs(scanAction);
+    Job job = USER1.runAs(scanAction);
     this.numRowsReadWithExp1 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_1).getValue();
     this.numRowsReadWithExp2 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_2).getValue();
     this.numRowsReadWithExp3 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_3).getValue();
@@ -264,7 +261,7 @@ public class IntegrationTestWithCellVisibilityLoadAndVerify extends IntegrationT
     assertEquals(0, this.numRowsReadWithExp3);
     assertEquals(0, this.numRowsReadWithExp4);
 
-    // PUBLIC label auth is not provided for ADMIN user.
+    // PUBLIC label auth is not provided for user1 user.
     System.out.println(String.format("Verifying for auths %s, %s", PRIVATE, PUBLIC));
     scanAction = new PrivilegedExceptionAction<Job>() {
       @Override
@@ -272,7 +269,7 @@ public class IntegrationTestWithCellVisibilityLoadAndVerify extends IntegrationT
         return doVerify(conf, htd, PRIVATE, PUBLIC);
       }
     };
-    job = ADMIN.runAs(scanAction);
+    job = USER1.runAs(scanAction);
     this.numRowsReadWithExp1 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_1).getValue();
     this.numRowsReadWithExp2 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_2).getValue();
     this.numRowsReadWithExp3 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_3).getValue();
@@ -283,14 +280,14 @@ public class IntegrationTestWithCellVisibilityLoadAndVerify extends
IntegrationT
     assertEquals(this.numRowsLoadWithExp4, this.numRowsReadWithExp4);
 
     // Normal user only having PUBLIC label auth and can view only those cells.
-    System.out.println(String.format("Verifying for auths %s, %s", SECRET, PUBLIC));
+    System.out.println(String.format("Verifying for auths %s, %s", PRIVATE, PUBLIC));
     scanAction = new PrivilegedExceptionAction<Job>() {
       @Override
       public Job run() throws Exception {
         return doVerify(conf, htd, PRIVATE, PUBLIC);
       }
     };
-    job = NORMAL_USER.runAs(scanAction);
+    job = USER2.runAs(scanAction);
     this.numRowsReadWithExp1 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_1).getValue();
     this.numRowsReadWithExp2 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_2).getValue();
     this.numRowsReadWithExp3 = job.getCounters().findCounter(Counters.ROWS_VIS_EXP_3).getValue();


Mime
View raw message