hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-14596 TestCellACLs failing... on1.2 builds; TUNEUP
Date Tue, 13 Oct 2015 05:50:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 2ff6d0fe4 -> 2428c5f46


HBASE-14596 TestCellACLs failing... on1.2 builds; TUNEUP


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

Branch: refs/heads/master
Commit: 2428c5f46712ac026f2523bd12ad9ea88359fca6
Parents: 2ff6d0f
Author: stack <stack@apache.org>
Authored: Mon Oct 12 22:37:59 2015 -0700
Committer: stack <stack@apache.org>
Committed: Mon Oct 12 22:50:48 2015 -0700

----------------------------------------------------------------------
 .../hbase/security/access/TestCellACLs.java     | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2428c5f4/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
index 31345ca..aadd02c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
@@ -31,9 +31,9 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.Coprocessor;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableNotFoundException;
-import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Delete;
@@ -77,6 +77,7 @@ public class TestCellACLs extends SecureTestUtil {
 
   @Rule
   public TestTableName TEST_TABLE = new TestTableName();
+
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final byte[] TEST_FAMILY = Bytes.toBytes("f1");
   private static final byte[] TEST_ROW = Bytes.toBytes("cellpermtest");
@@ -95,10 +96,13 @@ public class TestCellACLs extends SecureTestUtil {
   private static User USER_OTHER;
   private static String[] usersAndGroups;
 
+  private Connection connection;
+
   @BeforeClass
   public static void setupBeforeClass() throws Exception {
     // setup configuration
     conf = TEST_UTIL.getConfiguration();
+    conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
     // Enable security
     enableSecurity(conf);
     // Verify enableSecurity sets up what we require
@@ -137,19 +141,19 @@ public class TestCellACLs extends SecureTestUtil {
   @Before
   public void setUp() throws Exception {
     // Create the test table (owner added to the _acl_ table)
-    Admin admin = TEST_UTIL.getHBaseAdmin();
+    this.connection = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
     HTableDescriptor htd = new HTableDescriptor(TEST_TABLE.getTableName());
     HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY);
     hcd.setMaxVersions(4);
     htd.setOwner(USER_OWNER);
     htd.addFamily(hcd);
-    admin.createTable(htd, new byte[][] { Bytes.toBytes("s") });
-    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName());
+    TEST_UTIL.createTable(htd, new byte[][] { Bytes.toBytes("s") });
     LOG.info("Sleeping a second because of HBASE-12581");
     Threads.sleep(1000);
+    this.connection = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
   }
 
-  @Test
+  @Test (timeout=120000)
   public void testCellPermissions() throws Exception {
     // store two sets of values, one store with a cell level ACL, and one without
     verifyAllowed(new AccessTestAction() {
@@ -159,17 +163,17 @@ public class TestCellACLs extends SecureTestUtil {
             Table t = connection.getTable(TEST_TABLE.getTableName())) {
           Put p;
           // with ro ACL
-          p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q1, ZERO);
+          p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q1, ZERO);
           p.setACL(prepareCellPermissions(usersAndGroups, Action.READ));
           t.put(p);
           // with rw ACL
-          p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q2, ZERO);
+          p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q2, ZERO);
           p.setACL(prepareCellPermissions(usersAndGroups, Action.READ, Action.WRITE));
           t.put(p);
           // no ACL
           p = new Put(TEST_ROW)
-            .add(TEST_FAMILY, TEST_Q3, ZERO)
-            .add(TEST_FAMILY, TEST_Q4, ZERO);
+            .addColumn(TEST_FAMILY, TEST_Q3, ZERO)
+            .addColumn(TEST_FAMILY, TEST_Q4, ZERO);
           t.put(p);
         }
         return null;
@@ -376,7 +380,7 @@ public class TestCellACLs extends SecureTestUtil {
    * Insure we are not granting access in the absence of any cells found
    * when scanning for covered cells.
    */
-  @Test
+  @Test (timeout=120000)
   public void testCoveringCheck() throws Exception {
     // Grant read access to USER_OTHER
     grantOnTable(TEST_UTIL, USER_OTHER.getShortName(), TEST_TABLE.getTableName(), TEST_FAMILY,
@@ -399,7 +403,7 @@ public class TestCellACLs extends SecureTestUtil {
         try(Connection connection = ConnectionFactory.createConnection(conf);
             Table t = connection.getTable(TEST_TABLE.getTableName())) {
           Put p;
-          p = new Put(TEST_ROW).add(TEST_FAMILY, TEST_Q1, ZERO);
+          p = new Put(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q1, ZERO);
           t.put(p);
         }
         return null;
@@ -462,5 +466,6 @@ public class TestCellACLs extends SecureTestUtil {
       LOG.info("Test deleted table " + TEST_TABLE.getTableName());
     }
     assertEquals(0, AccessControlLists.getTablePermissions(conf, TEST_TABLE.getTableName()).size());
+    this.connection.close();
   }
 }


Mime
View raw message