HBASE-14378 Get TestAccessController* passing again on branch-1

This commit is contained in:
stack 2015-09-24 17:39:09 -07:00
parent 23506454cf
commit a33adf2f0b
8 changed files with 107 additions and 89 deletions

View File

@ -130,6 +130,8 @@ public class TestHCM {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
TEST_UTIL.getConfiguration().setBoolean(HConstants.STATUS_PUBLISHED, true);
// Up the handlers; this test needs more than usual.
TEST_UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
TEST_UTIL.startMiniCluster(2);
}
@ -137,7 +139,7 @@ public class TestHCM {
TEST_UTIL.shutdownMiniCluster();
}
@Test
@Test (timeout=120000)
public void testClusterConnection() throws IOException {
ThreadPoolExecutor otherPool = new ThreadPoolExecutor(1, 1,
5, TimeUnit.SECONDS,
@ -201,7 +203,7 @@ public class TestHCM {
* Naive test to check that HConnection#getAdmin returns a properly constructed HBaseAdmin object
* @throws IOException Unable to construct admin
*/
@Test
@Test (timeout=120000)
public void testAdminFactory() throws IOException {
Connection con1 = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
Admin admin = con1.getAdmin();
@ -211,7 +213,7 @@ public class TestHCM {
}
// Fails too often! Needs work. HBASE-12558
@Ignore @Test(expected = RegionServerStoppedException.class)
@Ignore @Test (expected = RegionServerStoppedException.class)
public void testClusterStatus() throws Exception {
TableName tn =
@ -275,12 +277,12 @@ public class TestHCM {
* Test that we can handle connection close: it will trigger a retry, but the calls will
* finish.
*/
@Test
@Test (timeout=120000)
public void testConnectionCloseAllowsInterrupt() throws Exception {
testConnectionClose(true);
}
@Test
@Test (timeout=120000)
public void testConnectionNotAllowsInterrupt() throws Exception {
testConnectionClose(false);
}
@ -293,7 +295,7 @@ public class TestHCM {
* succeeds. But the client won't wait that much, because 20 + 20 > 30, so the client
* timeouted when the server answers.
*/
@Test
@Test (timeout=120000)
public void testOperationTimeout() throws Exception {
HTableDescriptor hdt = TEST_UTIL.createTableDescriptor("HCM-testOperationTimeout");
hdt.addCoprocessor(SleepAndFailFirstTime.class.getName());
@ -411,7 +413,7 @@ public class TestHCM {
/**
* Test that connection can become idle without breaking everything.
*/
@Test
@Test (timeout=120000)
public void testConnectionIdle() throws Exception {
TableName tableName = TableName.valueOf("HCM-testConnectionIdle");
TEST_UTIL.createTable(tableName, FAM_NAM).close();
@ -467,12 +469,12 @@ public class TestHCM {
TEST_UTIL.getHBaseAdmin().setBalancerRunning(previousBalance, true);
}
/**
* Test that the connection to the dead server is cut immediately when we receive the
* notification.
* @throws Exception
*/
@Test
/**
* Test that the connection to the dead server is cut immediately when we receive the
* notification.
* @throws Exception
*/
@Test (timeout=120000)
public void testConnectionCut() throws Exception {
TableName tableName = TableName.valueOf("HCM-testConnectionCut");
@ -569,7 +571,7 @@ public class TestHCM {
* that we really delete it.
* @throws Exception
*/
@Test
@Test (timeout=120000)
public void testRegionCaching() throws Exception{
TEST_UTIL.createMultiRegionTable(TABLE_NAME, FAM_NAM).close();
Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
@ -756,7 +758,7 @@ public class TestHCM {
* Test that Connection or Pool are not closed when managed externally
* @throws Exception
*/
@Test
@Test (timeout=120000)
public void testConnectionManagement() throws Exception{
Table table0 = TEST_UTIL.createTable(TABLE_NAME1, FAM_NAM);
Connection conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
@ -818,7 +820,7 @@ public class TestHCM {
table.close();
}
@Test
@Test (timeout=120000)
public void testClosing() throws Exception {
Configuration configuration =
new Configuration(TEST_UTIL.getConfiguration());
@ -846,7 +848,7 @@ public class TestHCM {
* Trivial test to verify that nobody messes with
* {@link ConnectionFactory#createConnection(Configuration)}
*/
@Test
@Test (timeout=120000)
public void testCreateConnection() throws Exception {
Configuration configuration = TEST_UTIL.getConfiguration();
Connection c1 = ConnectionFactory.createConnection(configuration);

View File

@ -69,8 +69,10 @@ public class TestSnapshotCloneIndependence {
setupConf(UTIL.getConfiguration());
UTIL.startMiniCluster(NUM_RS);
}
protected static void setupConf(Configuration conf) {
static void setupConf(Configuration conf) {
// Up the handlers; this test needs more than usual.
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
// enable snapshot support
conf.setBoolean(SnapshotManager.HBASE_SNAPSHOT_ENABLED, true);
// disable the ui

View File

@ -39,6 +39,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseTestingUtility;
@ -106,6 +107,8 @@ public class TestImportExport {
@BeforeClass
public static void beforeClass() throws Exception {
// Up the handlers; this test needs more than usual.
UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
UTIL.startMiniCluster();
UTIL.startMiniMapReduceCluster();
FQ_OUTPUT_DIR = new Path(OUTPUT_DIR).makeQualified(FileSystem.get(UTIL.getConfiguration())).toString();

View File

@ -30,6 +30,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseTestingUtility;
@ -69,6 +70,8 @@ public class TestMultithreadedTableMapper {
@BeforeClass
public static void beforeClass() throws Exception {
// Up the handlers; this test needs more than usual.
UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
UTIL.startMiniCluster();
Table table =
UTIL.createMultiRegionTable(MULTI_REGION_TABLE_NAME, new byte[][] { INPUT_FAMILY,

View File

@ -29,18 +29,18 @@ import java.util.UUID;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.testclassification.SecurityTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.testclassification.SecurityTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.AfterClass;
import org.junit.Before;
@ -73,6 +73,8 @@ public class TestAccessControlFilter extends SecureTestUtil {
public static void setupBeforeClass() throws Exception {
TEST_UTIL = new HBaseTestingUtility();
Configuration conf = TEST_UTIL.getConfiguration();
// Up the handlers; this test needs more than usual.
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
enableSecurity(conf);
verifyConfiguration(conf);
@ -92,7 +94,7 @@ public class TestAccessControlFilter extends SecureTestUtil {
TEST_UTIL.shutdownMiniCluster();
}
@Test
@Test (timeout=180000)
public void testQualifierAccess() throws Exception {
final Table table = createTable(TEST_UTIL, TABLE, new byte[][] { FAMILY });
try {

View File

@ -192,6 +192,8 @@ public class TestAccessController extends SecureTestUtil {
public static void setupBeforeClass() throws Exception {
// setup configuration
conf = TEST_UTIL.getConfiguration();
// Up the handlers; this test needs more than usual.
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
// Enable security
enableSecurity(conf);
// In this particular test case, we can't use SecureBulkLoadEndpoint because its doAs will fail
@ -320,7 +322,7 @@ public class TestAccessController extends SecureTestUtil {
TEST_TABLE.getNamespaceAsString()).size());
}
@Test
@Test (timeout=180000)
public void testSecurityCapabilities() throws Exception {
List<SecurityCapability> capabilities = TEST_UTIL.getConnection().getAdmin()
.getSecurityCapabilities();
@ -330,7 +332,7 @@ public class TestAccessController extends SecureTestUtil {
capabilities.contains(SecurityCapability.CELL_AUTHORIZATION));
}
@Test
@Test (timeout=180000)
public void testTableCreate() throws Exception {
AccessTestAction createTable = new AccessTestAction() {
@Override
@ -350,7 +352,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testTableModify() throws Exception {
AccessTestAction modifyTable = new AccessTestAction() {
@Override
@ -369,7 +371,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(modifyTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testTableDelete() throws Exception {
AccessTestAction deleteTable = new AccessTestAction() {
@Override
@ -385,7 +387,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(deleteTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testTableTruncate() throws Exception {
AccessTestAction truncateTable = new AccessTestAction() {
@Override
@ -402,7 +404,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(truncateTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testAddColumn() throws Exception {
final HColumnDescriptor hcd = new HColumnDescriptor("fam_new");
AccessTestAction action = new AccessTestAction() {
@ -419,7 +421,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testModifyColumn() throws Exception {
final HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY);
hcd.setMaxVersions(10);
@ -437,7 +439,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testDeleteColumn() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -453,7 +455,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testTableDisable() throws Exception {
AccessTestAction disableTable = new AccessTestAction() {
@Override
@ -482,7 +484,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_CREATE, USER_GROUP_ADMIN, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testTableEnable() throws Exception {
AccessTestAction enableTable = new AccessTestAction() {
@Override
@ -498,7 +500,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(enableTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testMove() throws Exception {
List<HRegionLocation> regions;
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
@ -521,7 +523,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testAssign() throws Exception {
List<HRegionLocation> regions;
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
@ -542,7 +544,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testUnassign() throws Exception {
List<HRegionLocation> regions;
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
@ -563,7 +565,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testRegionOffline() throws Exception {
List<HRegionLocation> regions;
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
@ -584,7 +586,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testBalance() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -599,7 +601,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testBalanceSwitch() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -614,7 +616,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testShutdown() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -629,7 +631,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testStopMaster() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -650,7 +652,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_NONE, USER_RO, USER_GROUP_ADMIN, USER_GROUP_READ, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testSplit() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -665,7 +667,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testSplitWithSplitRow() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -682,7 +684,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testMergeRegions() throws Exception {
final TableName tname = TableName.valueOf("testMergeRegions");
createTestTable(tname);
@ -707,7 +709,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testFlush() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -722,7 +724,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testCompact() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -750,7 +752,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testRead() throws Exception {
// get action
AccessTestAction getAction = new AccessTestAction() {
@ -791,7 +793,7 @@ public class TestAccessController extends SecureTestUtil {
verifyRead(scanAction);
}
@Test
@Test (timeout=180000)
// test put, delete, increment
public void testWrite() throws Exception {
// put action
@ -840,7 +842,7 @@ public class TestAccessController extends SecureTestUtil {
verifyWrite(incrementAction);
}
@Test
@Test (timeout=180000)
public void testReadWrite() throws Exception {
// action for checkAndDelete
AccessTestAction checkAndDeleteAction = new AccessTestAction() {
@ -875,7 +877,7 @@ public class TestAccessController extends SecureTestUtil {
verifyReadWrite(checkAndPut);
}
@Test
@Test (timeout=180000)
public void testBulkLoad() throws Exception {
try {
FileSystem fs = TEST_UTIL.getTestFileSystem();
@ -992,7 +994,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testAppend() throws Exception {
AccessTestAction appendAction = new AccessTestAction() {
@ -1019,7 +1021,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_ADMIN);
}
@Test
@Test (timeout=180000)
public void testGrantRevoke() throws Exception {
AccessTestAction grantAction = new AccessTestAction() {
@Override
@ -1101,7 +1103,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testPostGrantRevoke() throws Exception {
final TableName tableName =
TableName.valueOf("TempTable");
@ -1355,7 +1357,7 @@ public class TestAccessController extends SecureTestUtil {
return perms.contains(userPermission);
}
@Test
@Test (timeout=180000)
public void testPostGrantRevokeAtQualifierLevel() throws Exception {
final TableName tableName =
TableName.valueOf("testGrantRevokeAtQualifierLevel");
@ -1459,7 +1461,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testPermissionList() throws Exception {
final TableName tableName =
TableName.valueOf("testPermissionList");
@ -1590,7 +1592,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testGlobalPermissionList() throws Exception {
List<UserPermission> perms;
Table acl = systemUserConnection.getTable(AccessControlLists.ACL_TABLE_NAME);
@ -1622,7 +1624,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(action, USER_CREATE, USER_RW, USER_NONE, USER_RO);
}
@Test
@Test (timeout=180000)
public void testCheckPermissions() throws Exception {
// --------------------------------------
// test global permissions
@ -1789,7 +1791,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testStopRegionServer() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -1804,7 +1806,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testRollWALWriterRequest() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -1819,7 +1821,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testOpenRegion() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -1834,7 +1836,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testCloseRegion() throws Exception {
AccessTestAction action = new AccessTestAction() {
@Override
@ -1849,7 +1851,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_READ, USER_GROUP_WRITE);
}
@Test
@Test (timeout=180000)
public void testSnapshot() throws Exception {
Admin admin = TEST_UTIL.getHBaseAdmin();
final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE);
@ -1910,7 +1912,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testSnapshotWithOwner() throws Exception {
Admin admin = TEST_UTIL.getHBaseAdmin();
final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE);
@ -1970,7 +1972,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testGlobalAuthorizationForNewRegisteredRS() throws Exception {
LOG.debug("Test for global authorization for a new registered RegionServer.");
MiniHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster();
@ -2033,7 +2035,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testTableDescriptorsEnumeration() throws Exception {
User TABLE_ADMIN = User.createUserForTesting(conf, "UserA", new String[0]);
@ -2077,7 +2079,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testTableNameEnumeration() throws Exception {
AccessTestAction listTablesAction = new AccessTestAction() {
@Override
@ -2099,7 +2101,7 @@ public class TestAccessController extends SecureTestUtil {
verifyIfEmptyList(listTablesAction, USER_NONE);
}
@Test
@Test (timeout=180000)
public void testTableDeletion() throws Exception {
User TABLE_ADMIN = User.createUserForTesting(conf, "TestUser", new String[0]);
final TableName tname = TableName.valueOf("testTableDeletion");
@ -2138,7 +2140,7 @@ public class TestAccessController extends SecureTestUtil {
createTable(TEST_UTIL, htd, new byte[][] { Bytes.toBytes("s") });
}
@Test
@Test (timeout=180000)
public void testNamespaceUserGrant() throws Exception {
AccessTestAction getAction = new AccessTestAction() {
@Override
@ -2162,7 +2164,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(getAction, USER_NONE);
}
@Test
@Test (timeout=180000)
public void testAccessControlClientGrantRevoke() throws Exception {
// Create user for testing, who has no READ privileges by default.
User testGrantRevoke = User.createUserForTesting(conf, "testGrantRevoke", new String[0]);
@ -2201,7 +2203,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(getAction, testGrantRevoke);
}
@Test
@Test (timeout=180000)
public void testAccessControlClientGlobalGrantRevoke() throws Exception {
// Create user for testing, who has no READ privileges by default.
User testGlobalGrantRevoke = User.createUserForTesting(conf,
@ -2245,7 +2247,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testAccessControlClientGrantRevokeOnNamespace() throws Exception {
// Create user for testing, who has no READ privileges by default.
User testNS = User.createUserForTesting(conf, "testNS", new String[0]);
@ -2335,7 +2337,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testCoprocessorExec() throws Exception {
// Set up our ping endpoint service on all regions of our test table
for (JVMClusterUtil.RegionServerThread thread:
@ -2386,7 +2388,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testReservedCellTags() throws Exception {
AccessTestAction putWithReservedTag = new AccessTestAction() {
@Override
@ -2410,7 +2412,7 @@ public class TestAccessController extends SecureTestUtil {
verifyDenied(putWithReservedTag, USER_OWNER, USER_ADMIN, USER_CREATE, USER_RW, USER_RO);
}
@Test
@Test (timeout=180000)
public void testSetQuota() throws Exception {
AccessTestAction setUserQuotaAction = new AccessTestAction() {
@Override
@ -2477,7 +2479,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
}
@Test
@Test (timeout=180000)
public void testGetNamespacePermission() throws Exception {
String namespace = "testGetNamespacePermission";
NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
@ -2494,7 +2496,7 @@ public class TestAccessController extends SecureTestUtil {
deleteNamespace(TEST_UTIL, namespace);
}
@Test
@Test (timeout=180000)
public void testTruncatePerms() throws Exception {
try {
List<UserPermission> existingPerms = AccessControlClient.getUserPermissions(
@ -2527,7 +2529,7 @@ public class TestAccessController extends SecureTestUtil {
};
}
@Test
@Test (timeout=180000)
public void testAccessControlClientUserPerms() throws Exception {
TableName tname = TableName.valueOf("testAccessControlClientUserPerms");
createTestTable(tname);
@ -2546,7 +2548,7 @@ public class TestAccessController extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testAccessControllerUserPermsRegexHandling() throws Exception {
User testRegexHandler = User.createUserForTesting(conf, "testRegexHandling", new String[0]);
@ -2603,7 +2605,7 @@ public class TestAccessController extends SecureTestUtil {
USER_GROUP_ADMIN);
}
@Test
@Test (timeout=180000)
public void testPrepareAndCleanBulkLoad() throws Exception {
AccessTestAction prepareBulkLoadAction = new AccessTestAction() {
@Override
@ -2625,7 +2627,7 @@ public class TestAccessController extends SecureTestUtil {
verifyAnyCreate(cleanupBulkLoadAction);
}
@Test
@Test (timeout=180000)
public void testReplicateLogEntries() throws Exception {
AccessTestAction replicateLogEntriesAction = new AccessTestAction() {
@Override

View File

@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration;
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.NamespaceDescriptor;
import org.apache.hadoop.hbase.TableName;
@ -107,6 +108,8 @@ public class TestAccessController2 extends SecureTestUtil {
@BeforeClass
public static void setupBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
// Up the handlers; this test needs more than usual.
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
// Enable security
enableSecurity(conf);
// Verify enableSecurity sets up what we require
@ -168,7 +171,7 @@ public class TestAccessController2 extends SecureTestUtil {
assertEquals(0, AccessControlLists.getNamespacePermissions(conf, namespace).size());
}
@Test
@Test (timeout=180000)
public void testCreateWithCorrectOwner() throws Exception {
// Create a test user
final User testUser = User.createUserForTesting(TEST_UTIL.getConfiguration(), "TestUser",
@ -205,7 +208,7 @@ public class TestAccessController2 extends SecureTestUtil {
assertTrue(perms.get(0).implies(Permission.Action.ADMIN));
}
@Test
@Test (timeout=180000)
public void testCreateTableWithGroupPermissions() throws Exception {
grantGlobal(TEST_UTIL, TESTGROUP_1_NAME, Action.CREATE);
try {
@ -230,7 +233,7 @@ public class TestAccessController2 extends SecureTestUtil {
}
}
@Test
@Test (timeout=180000)
public void testACLTableAccess() throws Exception {
final Configuration conf = TEST_UTIL.getConfiguration();
@ -474,7 +477,7 @@ public class TestAccessController2 extends SecureTestUtil {
public static class MyAccessController extends AccessController {
}
@Test
@Test (timeout=180000)
public void testCoprocessorLoading() throws Exception {
MasterCoprocessorHost cpHost =
TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterCoprocessorHost();
@ -489,7 +492,7 @@ public class TestAccessController2 extends SecureTestUtil {
MyAccessController.class, ACCESS_CONTROLLER, Coprocessor.PRIORITY_HIGHEST, 1, conf);
}
@Test
@Test (timeout=180000)
public void testACLZNodeDeletion() throws Exception {
String baseAclZNode = "/hbase/acl/";
String ns = "testACLZNodeDeletionNamespace";

View File

@ -73,7 +73,8 @@ public class TestWithDisabledAuthorization {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
// Up the handlers; this test needs more than usual.
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
// Set up superuser
SecureTestUtil.configureSuperuser(conf);
@ -114,7 +115,7 @@ public class TestWithDisabledAuthorization {
TEST_UTIL.shutdownMiniCluster();
}
@Test
@Test (timeout=180000)
public void testManageUserAuths() throws Throwable {
// Even though authorization is disabled, we should be able to manage user auths
@ -188,7 +189,7 @@ public class TestWithDisabledAuthorization {
assertEquals(0, authsList.size());
}
@Test
@Test (timeout=180000)
public void testPassiveVisibility() throws Exception {
// No values should be filtered regardless of authorization if we are passive
try (Table t = createTableAndWriteDataWithLabels(