HBASE-14378 Get TestAccessController* passing again on branch-1
This commit is contained in:
parent
8290139d4b
commit
68cb682c07
|
@ -136,6 +136,8 @@ public class TestHCM {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUpBeforeClass() throws Exception {
|
public static void setUpBeforeClass() throws Exception {
|
||||||
TEST_UTIL.getConfiguration().setBoolean(HConstants.STATUS_PUBLISHED, true);
|
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);
|
TEST_UTIL.startMiniCluster(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +150,7 @@ public class TestHCM {
|
||||||
return HConnectionTestingUtility.getConnectionCount();
|
return HConnectionTestingUtility.getConnectionCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testClusterConnection() throws IOException {
|
public void testClusterConnection() throws IOException {
|
||||||
ThreadPoolExecutor otherPool = new ThreadPoolExecutor(1, 1,
|
ThreadPoolExecutor otherPool = new ThreadPoolExecutor(1, 1,
|
||||||
5, TimeUnit.SECONDS,
|
5, TimeUnit.SECONDS,
|
||||||
|
@ -211,7 +213,7 @@ public class TestHCM {
|
||||||
* Naive test to check that HConnection#getAdmin returns a properly constructed HBaseAdmin object
|
* Naive test to check that HConnection#getAdmin returns a properly constructed HBaseAdmin object
|
||||||
* @throws IOException Unable to construct admin
|
* @throws IOException Unable to construct admin
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testAdminFactory() throws IOException {
|
public void testAdminFactory() throws IOException {
|
||||||
Connection con1 = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
|
Connection con1 = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
|
||||||
Admin admin = con1.getAdmin();
|
Admin admin = con1.getAdmin();
|
||||||
|
@ -221,7 +223,7 @@ public class TestHCM {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fails too often! Needs work. HBASE-12558
|
// Fails too often! Needs work. HBASE-12558
|
||||||
@Ignore @Test(expected = RegionServerStoppedException.class)
|
@Ignore @Test (expected = RegionServerStoppedException.class)
|
||||||
public void testClusterStatus() throws Exception {
|
public void testClusterStatus() throws Exception {
|
||||||
|
|
||||||
TableName tn =
|
TableName tn =
|
||||||
|
@ -283,12 +285,12 @@ public class TestHCM {
|
||||||
* Test that we can handle connection close: it will trigger a retry, but the calls will
|
* Test that we can handle connection close: it will trigger a retry, but the calls will
|
||||||
* finish.
|
* finish.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionCloseAllowsInterrupt() throws Exception {
|
public void testConnectionCloseAllowsInterrupt() throws Exception {
|
||||||
testConnectionClose(true);
|
testConnectionClose(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionNotAllowsInterrupt() throws Exception {
|
public void testConnectionNotAllowsInterrupt() throws Exception {
|
||||||
testConnectionClose(false);
|
testConnectionClose(false);
|
||||||
}
|
}
|
||||||
|
@ -301,7 +303,7 @@ public class TestHCM {
|
||||||
* succeeds. But the client won't wait that much, because 20 + 20 > 30, so the client
|
* succeeds. But the client won't wait that much, because 20 + 20 > 30, so the client
|
||||||
* timeouted when the server answers.
|
* timeouted when the server answers.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testOperationTimeout() throws Exception {
|
public void testOperationTimeout() throws Exception {
|
||||||
HTableDescriptor hdt = TEST_UTIL.createTableDescriptor("HCM-testOperationTimeout");
|
HTableDescriptor hdt = TEST_UTIL.createTableDescriptor("HCM-testOperationTimeout");
|
||||||
hdt.addCoprocessor(SleepAndFailFirstTime.class.getName());
|
hdt.addCoprocessor(SleepAndFailFirstTime.class.getName());
|
||||||
|
@ -410,7 +412,7 @@ public class TestHCM {
|
||||||
/**
|
/**
|
||||||
* Test that connection can become idle without breaking everything.
|
* Test that connection can become idle without breaking everything.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionIdle() throws Exception {
|
public void testConnectionIdle() throws Exception {
|
||||||
TableName tableName = TableName.valueOf("HCM-testConnectionIdle");
|
TableName tableName = TableName.valueOf("HCM-testConnectionIdle");
|
||||||
TEST_UTIL.createTable(tableName, FAM_NAM).close();
|
TEST_UTIL.createTable(tableName, FAM_NAM).close();
|
||||||
|
@ -468,7 +470,7 @@ public class TestHCM {
|
||||||
* notification.
|
* notification.
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionCut() throws Exception {
|
public void testConnectionCut() throws Exception {
|
||||||
|
|
||||||
TableName tableName = TableName.valueOf("HCM-testConnectionCut");
|
TableName tableName = TableName.valueOf("HCM-testConnectionCut");
|
||||||
|
@ -555,7 +557,7 @@ public class TestHCM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void abortingHConnectionRemovesItselfFromHCM() throws Exception {
|
public void abortingHConnectionRemovesItselfFromHCM() throws Exception {
|
||||||
// Save off current HConnections
|
// Save off current HConnections
|
||||||
Map<HConnectionKey, HConnectionImplementation> oldHBaseInstances =
|
Map<HConnectionKey, HConnectionImplementation> oldHBaseInstances =
|
||||||
|
@ -582,7 +584,7 @@ public class TestHCM {
|
||||||
* that we really delete it.
|
* that we really delete it.
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testRegionCaching() throws Exception{
|
public void testRegionCaching() throws Exception{
|
||||||
TEST_UTIL.createMultiRegionTable(TABLE_NAME, FAM_NAM).close();
|
TEST_UTIL.createMultiRegionTable(TABLE_NAME, FAM_NAM).close();
|
||||||
Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
|
Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
|
||||||
|
@ -768,7 +770,7 @@ public class TestHCM {
|
||||||
* Test that Connection or Pool are not closed when managed externally
|
* Test that Connection or Pool are not closed when managed externally
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionManagement() throws Exception{
|
public void testConnectionManagement() throws Exception{
|
||||||
Table table0 = TEST_UTIL.createTable(TABLE_NAME1, FAM_NAM);
|
Table table0 = TEST_UTIL.createTable(TABLE_NAME1, FAM_NAM);
|
||||||
Connection conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
|
Connection conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
|
||||||
|
@ -835,7 +837,7 @@ public class TestHCM {
|
||||||
* Make sure that {@link Configuration} instances that are essentially the
|
* Make sure that {@link Configuration} instances that are essentially the
|
||||||
* same map to the same {@link HConnection} instance.
|
* same map to the same {@link HConnection} instance.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionSameness() throws Exception {
|
public void testConnectionSameness() throws Exception {
|
||||||
Connection previousConnection = null;
|
Connection previousConnection = null;
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
|
@ -867,7 +869,7 @@ public class TestHCM {
|
||||||
* @deprecated Tests deprecated functionality. Remove in 1.0.
|
* @deprecated Tests deprecated functionality. Remove in 1.0.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testConnectionUniqueness() throws Exception {
|
public void testConnectionUniqueness() throws Exception {
|
||||||
int zkmaxconnections = TEST_UTIL.getConfiguration().
|
int zkmaxconnections = TEST_UTIL.getConfiguration().
|
||||||
getInt(HConstants.ZOOKEEPER_MAX_CLIENT_CNXNS,
|
getInt(HConstants.ZOOKEEPER_MAX_CLIENT_CNXNS,
|
||||||
|
@ -913,7 +915,7 @@ public class TestHCM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testClosing() throws Exception {
|
public void testClosing() throws Exception {
|
||||||
Configuration configuration =
|
Configuration configuration =
|
||||||
new Configuration(TEST_UTIL.getConfiguration());
|
new Configuration(TEST_UTIL.getConfiguration());
|
||||||
|
@ -953,7 +955,7 @@ public class TestHCM {
|
||||||
* Trivial test to verify that nobody messes with
|
* Trivial test to verify that nobody messes with
|
||||||
* {@link HConnectionManager#createConnection(Configuration)}
|
* {@link HConnectionManager#createConnection(Configuration)}
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test (timeout=120000)
|
||||||
public void testCreateConnection() throws Exception {
|
public void testCreateConnection() throws Exception {
|
||||||
Configuration configuration = TEST_UTIL.getConfiguration();
|
Configuration configuration = TEST_UTIL.getConfiguration();
|
||||||
Connection c1 = ConnectionFactory.createConnection(configuration);
|
Connection c1 = ConnectionFactory.createConnection(configuration);
|
||||||
|
|
|
@ -71,6 +71,8 @@ public class TestSnapshotCloneIndependence {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setupConf(Configuration conf) {
|
private 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
|
// enable snapshot support
|
||||||
conf.setBoolean(SnapshotManager.HBASE_SNAPSHOT_ENABLED, true);
|
conf.setBoolean(SnapshotManager.HBASE_SNAPSHOT_ENABLED, true);
|
||||||
// disable the ui
|
// disable the ui
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.util.List;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.FileSystem;
|
import org.apache.hadoop.fs.FileSystem;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
import org.apache.hadoop.hbase.Cell;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
|
@ -100,6 +101,8 @@ public class TestImportExport {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void beforeClass() throws Exception {
|
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.startMiniCluster();
|
||||||
UTIL.startMiniMapReduceCluster();
|
UTIL.startMiniMapReduceCluster();
|
||||||
FQ_OUTPUT_DIR = new Path(OUTPUT_DIR).makeQualified(FileSystem.get(UTIL.getConfiguration())).toString();
|
FQ_OUTPUT_DIR = new Path(OUTPUT_DIR).makeQualified(FileSystem.get(UTIL.getConfiguration())).toString();
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.FileUtil;
|
import org.apache.hadoop.fs.FileUtil;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.Cell;
|
import org.apache.hadoop.hbase.Cell;
|
||||||
import org.apache.hadoop.hbase.CellUtil;
|
import org.apache.hadoop.hbase.CellUtil;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
|
@ -69,6 +70,8 @@ public class TestMultithreadedTableMapper {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void beforeClass() throws Exception {
|
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.startMiniCluster();
|
||||||
HTable table =
|
HTable table =
|
||||||
UTIL.createMultiRegionTable(MULTI_REGION_TABLE_NAME, new byte[][] { INPUT_FAMILY,
|
UTIL.createMultiRegionTable(MULTI_REGION_TABLE_NAME, new byte[][] { INPUT_FAMILY,
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||||
import org.apache.hadoop.hbase.TableName;
|
import org.apache.hadoop.hbase.TableName;
|
||||||
import org.apache.hadoop.hbase.client.HTable;
|
import org.apache.hadoop.hbase.client.HTable;
|
||||||
|
@ -70,6 +71,8 @@ public class TestAccessControlFilter extends SecureTestUtil {
|
||||||
public static void setupBeforeClass() throws Exception {
|
public static void setupBeforeClass() throws Exception {
|
||||||
TEST_UTIL = new HBaseTestingUtility();
|
TEST_UTIL = new HBaseTestingUtility();
|
||||||
Configuration conf = TEST_UTIL.getConfiguration();
|
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);
|
enableSecurity(conf);
|
||||||
verifyConfiguration(conf);
|
verifyConfiguration(conf);
|
||||||
|
|
||||||
|
@ -89,7 +92,7 @@ public class TestAccessControlFilter extends SecureTestUtil {
|
||||||
TEST_UTIL.shutdownMiniCluster();
|
TEST_UTIL.shutdownMiniCluster();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testQualifierAccess() throws Exception {
|
public void testQualifierAccess() throws Exception {
|
||||||
final Table table = createTable(TEST_UTIL, TABLE, new byte[][] { FAMILY });
|
final Table table = createTable(TEST_UTIL, TABLE, new byte[][] { FAMILY });
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -192,6 +192,8 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
public static void setupBeforeClass() throws Exception {
|
public static void setupBeforeClass() throws Exception {
|
||||||
// setup configuration
|
// setup configuration
|
||||||
conf = TEST_UTIL.getConfiguration();
|
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
|
// Enable security
|
||||||
enableSecurity(conf);
|
enableSecurity(conf);
|
||||||
// In this particular test case, we can't use SecureBulkLoadEndpoint because its doAs will fail
|
// In this particular test case, we can't use SecureBulkLoadEndpoint because its doAs will fail
|
||||||
|
@ -318,7 +320,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
TEST_TABLE.getNamespaceAsString()).size());
|
TEST_TABLE.getNamespaceAsString()).size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testSecurityCapabilities() throws Exception {
|
public void testSecurityCapabilities() throws Exception {
|
||||||
List<SecurityCapability> capabilities = TEST_UTIL.getConnection().getAdmin()
|
List<SecurityCapability> capabilities = TEST_UTIL.getConnection().getAdmin()
|
||||||
.getSecurityCapabilities();
|
.getSecurityCapabilities();
|
||||||
|
@ -328,7 +330,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
capabilities.contains(SecurityCapability.CELL_AUTHORIZATION));
|
capabilities.contains(SecurityCapability.CELL_AUTHORIZATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableCreate() throws Exception {
|
public void testTableCreate() throws Exception {
|
||||||
AccessTestAction createTable = new AccessTestAction() {
|
AccessTestAction createTable = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -348,7 +350,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_READ, USER_GROUP_WRITE);
|
USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableModify() throws Exception {
|
public void testTableModify() throws Exception {
|
||||||
AccessTestAction modifyTable = new AccessTestAction() {
|
AccessTestAction modifyTable = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -367,7 +369,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(modifyTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(modifyTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableDelete() throws Exception {
|
public void testTableDelete() throws Exception {
|
||||||
AccessTestAction deleteTable = new AccessTestAction() {
|
AccessTestAction deleteTable = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -383,7 +385,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(deleteTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(deleteTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableTruncate() throws Exception {
|
public void testTableTruncate() throws Exception {
|
||||||
AccessTestAction truncateTable = new AccessTestAction() {
|
AccessTestAction truncateTable = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -400,7 +402,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(truncateTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(truncateTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAddColumn() throws Exception {
|
public void testAddColumn() throws Exception {
|
||||||
final HColumnDescriptor hcd = new HColumnDescriptor("fam_new");
|
final HColumnDescriptor hcd = new HColumnDescriptor("fam_new");
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
|
@ -417,7 +419,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testModifyColumn() throws Exception {
|
public void testModifyColumn() throws Exception {
|
||||||
final HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY);
|
final HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY);
|
||||||
hcd.setMaxVersions(10);
|
hcd.setMaxVersions(10);
|
||||||
|
@ -435,7 +437,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testDeleteColumn() throws Exception {
|
public void testDeleteColumn() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -451,7 +453,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableDisable() throws Exception {
|
public void testTableDisable() throws Exception {
|
||||||
AccessTestAction disableTable = new AccessTestAction() {
|
AccessTestAction disableTable = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -480,7 +482,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_CREATE, USER_GROUP_ADMIN, USER_GROUP_READ, USER_GROUP_WRITE);
|
USER_GROUP_CREATE, USER_GROUP_ADMIN, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableEnable() throws Exception {
|
public void testTableEnable() throws Exception {
|
||||||
AccessTestAction enableTable = new AccessTestAction() {
|
AccessTestAction enableTable = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -496,7 +498,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(enableTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(enableTable, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testMove() throws Exception {
|
public void testMove() throws Exception {
|
||||||
List<HRegionLocation> regions;
|
List<HRegionLocation> regions;
|
||||||
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
||||||
|
@ -519,7 +521,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAssign() throws Exception {
|
public void testAssign() throws Exception {
|
||||||
List<HRegionLocation> regions;
|
List<HRegionLocation> regions;
|
||||||
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
||||||
|
@ -540,7 +542,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testUnassign() throws Exception {
|
public void testUnassign() throws Exception {
|
||||||
List<HRegionLocation> regions;
|
List<HRegionLocation> regions;
|
||||||
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
||||||
|
@ -561,7 +563,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testRegionOffline() throws Exception {
|
public void testRegionOffline() throws Exception {
|
||||||
List<HRegionLocation> regions;
|
List<HRegionLocation> regions;
|
||||||
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
try (RegionLocator locator = systemUserConnection.getRegionLocator(TEST_TABLE)) {
|
||||||
|
@ -582,7 +584,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testBalance() throws Exception {
|
public void testBalance() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -597,7 +599,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testBalanceSwitch() throws Exception {
|
public void testBalanceSwitch() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -612,7 +614,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testShutdown() throws Exception {
|
public void testShutdown() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -627,7 +629,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testStopMaster() throws Exception {
|
public void testStopMaster() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -648,7 +650,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(action, USER_NONE, USER_RO, USER_GROUP_ADMIN, USER_GROUP_READ, USER_GROUP_CREATE);
|
verifyDenied(action, USER_NONE, USER_RO, USER_GROUP_ADMIN, USER_GROUP_READ, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testSplit() throws Exception {
|
public void testSplit() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -663,7 +665,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testSplitWithSplitRow() throws Exception {
|
public void testSplitWithSplitRow() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -680,7 +682,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testMergeRegions() throws Exception {
|
public void testMergeRegions() throws Exception {
|
||||||
final TableName tname = TableName.valueOf("testMergeRegions");
|
final TableName tname = TableName.valueOf("testMergeRegions");
|
||||||
createTestTable(tname);
|
createTestTable(tname);
|
||||||
|
@ -705,7 +707,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testFlush() throws Exception {
|
public void testFlush() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -720,7 +722,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
verifyDenied(action, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCompact() throws Exception {
|
public void testCompact() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -748,7 +750,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE);
|
USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testRead() throws Exception {
|
public void testRead() throws Exception {
|
||||||
// get action
|
// get action
|
||||||
AccessTestAction getAction = new AccessTestAction() {
|
AccessTestAction getAction = new AccessTestAction() {
|
||||||
|
@ -790,7 +792,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyRead(scanAction);
|
verifyRead(scanAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
// test put, delete, increment
|
// test put, delete, increment
|
||||||
public void testWrite() throws Exception {
|
public void testWrite() throws Exception {
|
||||||
// put action
|
// put action
|
||||||
|
@ -839,7 +841,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyWrite(incrementAction);
|
verifyWrite(incrementAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testReadWrite() throws Exception {
|
public void testReadWrite() throws Exception {
|
||||||
// action for checkAndDelete
|
// action for checkAndDelete
|
||||||
AccessTestAction checkAndDeleteAction = new AccessTestAction() {
|
AccessTestAction checkAndDeleteAction = new AccessTestAction() {
|
||||||
|
@ -874,7 +876,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyReadWrite(checkAndPut);
|
verifyReadWrite(checkAndPut);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testBulkLoad() throws Exception {
|
public void testBulkLoad() throws Exception {
|
||||||
try {
|
try {
|
||||||
FileSystem fs = TEST_UTIL.getTestFileSystem();
|
FileSystem fs = TEST_UTIL.getTestFileSystem();
|
||||||
|
@ -988,7 +990,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAppend() throws Exception {
|
public void testAppend() throws Exception {
|
||||||
|
|
||||||
AccessTestAction appendAction = new AccessTestAction() {
|
AccessTestAction appendAction = new AccessTestAction() {
|
||||||
|
@ -1015,7 +1017,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_ADMIN);
|
USER_GROUP_ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testGrantRevoke() throws Exception {
|
public void testGrantRevoke() throws Exception {
|
||||||
AccessTestAction grantAction = new AccessTestAction() {
|
AccessTestAction grantAction = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1097,7 +1099,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testPostGrantRevoke() throws Exception {
|
public void testPostGrantRevoke() throws Exception {
|
||||||
final TableName tableName =
|
final TableName tableName =
|
||||||
TableName.valueOf("TempTable");
|
TableName.valueOf("TempTable");
|
||||||
|
@ -1350,7 +1352,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
return perms.contains(userPermission);
|
return perms.contains(userPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testPostGrantRevokeAtQualifierLevel() throws Exception {
|
public void testPostGrantRevokeAtQualifierLevel() throws Exception {
|
||||||
final TableName tableName =
|
final TableName tableName =
|
||||||
TableName.valueOf("testGrantRevokeAtQualifierLevel");
|
TableName.valueOf("testGrantRevokeAtQualifierLevel");
|
||||||
|
@ -1454,7 +1456,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testPermissionList() throws Exception {
|
public void testPermissionList() throws Exception {
|
||||||
final TableName tableName =
|
final TableName tableName =
|
||||||
TableName.valueOf("testPermissionList");
|
TableName.valueOf("testPermissionList");
|
||||||
|
@ -1585,7 +1587,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testGlobalPermissionList() throws Exception {
|
public void testGlobalPermissionList() throws Exception {
|
||||||
List<UserPermission> perms;
|
List<UserPermission> perms;
|
||||||
Table acl = systemUserConnection.getTable(AccessControlLists.ACL_TABLE_NAME);
|
Table acl = systemUserConnection.getTable(AccessControlLists.ACL_TABLE_NAME);
|
||||||
|
@ -1617,7 +1619,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(action, USER_CREATE, USER_RW, USER_NONE, USER_RO);
|
verifyDenied(action, USER_CREATE, USER_RW, USER_NONE, USER_RO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCheckPermissions() throws Exception {
|
public void testCheckPermissions() throws Exception {
|
||||||
// --------------------------------------
|
// --------------------------------------
|
||||||
// test global permissions
|
// test global permissions
|
||||||
|
@ -1784,7 +1786,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testStopRegionServer() throws Exception {
|
public void testStopRegionServer() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1799,7 +1801,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testRollWALWriterRequest() throws Exception {
|
public void testRollWALWriterRequest() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1814,7 +1816,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testOpenRegion() throws Exception {
|
public void testOpenRegion() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1829,7 +1831,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_READ, USER_GROUP_WRITE);
|
USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCloseRegion() throws Exception {
|
public void testCloseRegion() throws Exception {
|
||||||
AccessTestAction action = new AccessTestAction() {
|
AccessTestAction action = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1844,7 +1846,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_READ, USER_GROUP_WRITE);
|
USER_GROUP_READ, USER_GROUP_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testSnapshot() throws Exception {
|
public void testSnapshot() throws Exception {
|
||||||
Admin admin = TEST_UTIL.getHBaseAdmin();
|
Admin admin = TEST_UTIL.getHBaseAdmin();
|
||||||
final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE);
|
final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE);
|
||||||
|
@ -1905,7 +1907,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testSnapshotWithOwner() throws Exception {
|
public void testSnapshotWithOwner() throws Exception {
|
||||||
Admin admin = TEST_UTIL.getHBaseAdmin();
|
Admin admin = TEST_UTIL.getHBaseAdmin();
|
||||||
final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE);
|
final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE);
|
||||||
|
@ -1965,7 +1967,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testGlobalAuthorizationForNewRegisteredRS() throws Exception {
|
public void testGlobalAuthorizationForNewRegisteredRS() throws Exception {
|
||||||
LOG.debug("Test for global authorization for a new registered RegionServer.");
|
LOG.debug("Test for global authorization for a new registered RegionServer.");
|
||||||
MiniHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster();
|
MiniHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster();
|
||||||
|
@ -2028,7 +2030,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableDescriptorsEnumeration() throws Exception {
|
public void testTableDescriptorsEnumeration() throws Exception {
|
||||||
User TABLE_ADMIN = User.createUserForTesting(conf, "UserA", new String[0]);
|
User TABLE_ADMIN = User.createUserForTesting(conf, "UserA", new String[0]);
|
||||||
|
|
||||||
|
@ -2072,7 +2074,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableNameEnumeration() throws Exception {
|
public void testTableNameEnumeration() throws Exception {
|
||||||
AccessTestAction listTablesAction = new AccessTestAction() {
|
AccessTestAction listTablesAction = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -2094,7 +2096,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyIfEmptyList(listTablesAction, USER_NONE);
|
verifyIfEmptyList(listTablesAction, USER_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTableDeletion() throws Exception {
|
public void testTableDeletion() throws Exception {
|
||||||
User TABLE_ADMIN = User.createUserForTesting(conf, "TestUser", new String[0]);
|
User TABLE_ADMIN = User.createUserForTesting(conf, "TestUser", new String[0]);
|
||||||
final TableName tname = TableName.valueOf("testTableDeletion");
|
final TableName tname = TableName.valueOf("testTableDeletion");
|
||||||
|
@ -2133,7 +2135,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
createTable(TEST_UTIL, htd, new byte[][]{Bytes.toBytes("s")});
|
createTable(TEST_UTIL, htd, new byte[][]{Bytes.toBytes("s")});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testNamespaceUserGrant() throws Exception {
|
public void testNamespaceUserGrant() throws Exception {
|
||||||
AccessTestAction getAction = new AccessTestAction() {
|
AccessTestAction getAction = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -2157,7 +2159,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(getAction, USER_NONE);
|
verifyDenied(getAction, USER_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAccessControlClientGrantRevoke() throws Exception {
|
public void testAccessControlClientGrantRevoke() throws Exception {
|
||||||
// Create user for testing, who has no READ privileges by default.
|
// Create user for testing, who has no READ privileges by default.
|
||||||
User testGrantRevoke = User.createUserForTesting(conf, "testGrantRevoke", new String[0]);
|
User testGrantRevoke = User.createUserForTesting(conf, "testGrantRevoke", new String[0]);
|
||||||
|
@ -2196,7 +2198,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(getAction, testGrantRevoke);
|
verifyDenied(getAction, testGrantRevoke);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAccessControlClientGlobalGrantRevoke() throws Exception {
|
public void testAccessControlClientGlobalGrantRevoke() throws Exception {
|
||||||
// Create user for testing, who has no READ privileges by default.
|
// Create user for testing, who has no READ privileges by default.
|
||||||
User testGlobalGrantRevoke = User.createUserForTesting(conf,
|
User testGlobalGrantRevoke = User.createUserForTesting(conf,
|
||||||
|
@ -2240,7 +2242,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAccessControlClientGrantRevokeOnNamespace() throws Exception {
|
public void testAccessControlClientGrantRevokeOnNamespace() throws Exception {
|
||||||
// Create user for testing, who has no READ privileges by default.
|
// Create user for testing, who has no READ privileges by default.
|
||||||
User testNS = User.createUserForTesting(conf, "testNS", new String[0]);
|
User testNS = User.createUserForTesting(conf, "testNS", new String[0]);
|
||||||
|
@ -2330,7 +2332,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCoprocessorExec() throws Exception {
|
public void testCoprocessorExec() throws Exception {
|
||||||
// Set up our ping endpoint service on all regions of our test table
|
// Set up our ping endpoint service on all regions of our test table
|
||||||
for (JVMClusterUtil.RegionServerThread thread:
|
for (JVMClusterUtil.RegionServerThread thread:
|
||||||
|
@ -2381,7 +2383,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testReservedCellTags() throws Exception {
|
public void testReservedCellTags() throws Exception {
|
||||||
AccessTestAction putWithReservedTag = new AccessTestAction() {
|
AccessTestAction putWithReservedTag = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -2405,7 +2407,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyDenied(putWithReservedTag, USER_OWNER, USER_ADMIN, USER_CREATE, USER_RW, USER_RO);
|
verifyDenied(putWithReservedTag, USER_OWNER, USER_ADMIN, USER_CREATE, USER_RW, USER_RO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testSetQuota() throws Exception {
|
public void testSetQuota() throws Exception {
|
||||||
AccessTestAction setUserQuotaAction = new AccessTestAction() {
|
AccessTestAction setUserQuotaAction = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -2472,7 +2474,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
|
USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testGetNamespacePermission() throws Exception {
|
public void testGetNamespacePermission() throws Exception {
|
||||||
String namespace = "testGetNamespacePermission";
|
String namespace = "testGetNamespacePermission";
|
||||||
NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
|
NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
|
||||||
|
@ -2489,7 +2491,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
deleteNamespace(TEST_UTIL, namespace);
|
deleteNamespace(TEST_UTIL, namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testTruncatePerms() throws Exception {
|
public void testTruncatePerms() throws Exception {
|
||||||
try {
|
try {
|
||||||
List<UserPermission> existingPerms = AccessControlClient.getUserPermissions(
|
List<UserPermission> existingPerms = AccessControlClient.getUserPermissions(
|
||||||
|
@ -2522,7 +2524,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAccessControlClientUserPerms() throws Exception {
|
public void testAccessControlClientUserPerms() throws Exception {
|
||||||
TableName tname = TableName.valueOf("testAccessControlClientUserPerms");
|
TableName tname = TableName.valueOf("testAccessControlClientUserPerms");
|
||||||
createTestTable(tname);
|
createTestTable(tname);
|
||||||
|
@ -2541,7 +2543,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testAccessControllerUserPermsRegexHandling() throws Exception {
|
public void testAccessControllerUserPermsRegexHandling() throws Exception {
|
||||||
User testRegexHandler = User.createUserForTesting(conf, "testRegexHandling", new String[0]);
|
User testRegexHandler = User.createUserForTesting(conf, "testRegexHandling", new String[0]);
|
||||||
|
|
||||||
|
@ -2598,7 +2600,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
USER_GROUP_ADMIN);
|
USER_GROUP_ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testPrepareAndCleanBulkLoad() throws Exception {
|
public void testPrepareAndCleanBulkLoad() throws Exception {
|
||||||
AccessTestAction prepareBulkLoadAction = new AccessTestAction() {
|
AccessTestAction prepareBulkLoadAction = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -2620,7 +2622,7 @@ public class TestAccessController extends SecureTestUtil {
|
||||||
verifyAnyCreate(cleanupBulkLoadAction);
|
verifyAnyCreate(cleanupBulkLoadAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testReplicateLogEntries() throws Exception {
|
public void testReplicateLogEntries() throws Exception {
|
||||||
AccessTestAction replicateLogEntriesAction = new AccessTestAction() {
|
AccessTestAction replicateLogEntriesAction = new AccessTestAction() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.Coprocessor;
|
import org.apache.hadoop.hbase.Coprocessor;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
import org.apache.hadoop.hbase.HColumnDescriptor;
|
import org.apache.hadoop.hbase.HColumnDescriptor;
|
||||||
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||||
import org.apache.hadoop.hbase.NamespaceDescriptor;
|
import org.apache.hadoop.hbase.NamespaceDescriptor;
|
||||||
import org.apache.hadoop.hbase.TableName;
|
import org.apache.hadoop.hbase.TableName;
|
||||||
|
@ -106,6 +107,8 @@ public class TestAccessController2 extends SecureTestUtil {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupBeforeClass() throws Exception {
|
public static void setupBeforeClass() throws Exception {
|
||||||
conf = TEST_UTIL.getConfiguration();
|
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
|
// Enable security
|
||||||
enableSecurity(conf);
|
enableSecurity(conf);
|
||||||
// Verify enableSecurity sets up what we require
|
// Verify enableSecurity sets up what we require
|
||||||
|
@ -166,7 +169,7 @@ public class TestAccessController2 extends SecureTestUtil {
|
||||||
assertEquals(0, AccessControlLists.getNamespacePermissions(conf, namespace).size());
|
assertEquals(0, AccessControlLists.getNamespacePermissions(conf, namespace).size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCreateWithCorrectOwner() throws Exception {
|
public void testCreateWithCorrectOwner() throws Exception {
|
||||||
// Create a test user
|
// Create a test user
|
||||||
final User testUser = User.createUserForTesting(TEST_UTIL.getConfiguration(), "TestUser",
|
final User testUser = User.createUserForTesting(TEST_UTIL.getConfiguration(), "TestUser",
|
||||||
|
@ -203,7 +206,7 @@ public class TestAccessController2 extends SecureTestUtil {
|
||||||
assertTrue(perms.get(0).implies(Permission.Action.ADMIN));
|
assertTrue(perms.get(0).implies(Permission.Action.ADMIN));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCreateTableWithGroupPermissions() throws Exception {
|
public void testCreateTableWithGroupPermissions() throws Exception {
|
||||||
grantGlobal(TEST_UTIL, TESTGROUP_1_NAME, Action.CREATE);
|
grantGlobal(TEST_UTIL, TESTGROUP_1_NAME, Action.CREATE);
|
||||||
try {
|
try {
|
||||||
|
@ -228,7 +231,7 @@ public class TestAccessController2 extends SecureTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testACLTableAccess() throws Exception {
|
public void testACLTableAccess() throws Exception {
|
||||||
final Configuration conf = TEST_UTIL.getConfiguration();
|
final Configuration conf = TEST_UTIL.getConfiguration();
|
||||||
|
|
||||||
|
@ -471,7 +474,7 @@ public class TestAccessController2 extends SecureTestUtil {
|
||||||
public static class MyAccessController extends AccessController {
|
public static class MyAccessController extends AccessController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testCoprocessorLoading() throws Exception {
|
public void testCoprocessorLoading() throws Exception {
|
||||||
MasterCoprocessorHost cpHost =
|
MasterCoprocessorHost cpHost =
|
||||||
TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterCoprocessorHost();
|
TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterCoprocessorHost();
|
||||||
|
@ -486,7 +489,7 @@ public class TestAccessController2 extends SecureTestUtil {
|
||||||
MyAccessController.class, ACCESS_CONTROLLER, Coprocessor.PRIORITY_HIGHEST, 1, conf);
|
MyAccessController.class, ACCESS_CONTROLLER, Coprocessor.PRIORITY_HIGHEST, 1, conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testACLZNodeDeletion() throws Exception {
|
public void testACLZNodeDeletion() throws Exception {
|
||||||
String baseAclZNode = "/hbase/acl/";
|
String baseAclZNode = "/hbase/acl/";
|
||||||
String ns = "testACLZNodeDeletionNamespace";
|
String ns = "testACLZNodeDeletionNamespace";
|
||||||
|
|
|
@ -72,7 +72,8 @@ public class TestWithDisabledAuthorization {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUpBeforeClass() throws Exception {
|
public static void setUpBeforeClass() throws Exception {
|
||||||
conf = TEST_UTIL.getConfiguration();
|
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
|
// Set up superuser
|
||||||
SecureTestUtil.configureSuperuser(conf);
|
SecureTestUtil.configureSuperuser(conf);
|
||||||
|
|
||||||
|
@ -113,7 +114,7 @@ public class TestWithDisabledAuthorization {
|
||||||
TEST_UTIL.shutdownMiniCluster();
|
TEST_UTIL.shutdownMiniCluster();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testManageUserAuths() throws Throwable {
|
public void testManageUserAuths() throws Throwable {
|
||||||
// Even though authorization is disabled, we should be able to manage user auths
|
// Even though authorization is disabled, we should be able to manage user auths
|
||||||
|
|
||||||
|
@ -187,7 +188,7 @@ public class TestWithDisabledAuthorization {
|
||||||
assertEquals(0, authsList.size());
|
assertEquals(0, authsList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test (timeout=180000)
|
||||||
public void testPassiveVisibility() throws Exception {
|
public void testPassiveVisibility() throws Exception {
|
||||||
// No values should be filtered regardless of authorization if we are passive
|
// No values should be filtered regardless of authorization if we are passive
|
||||||
try (Table t = createTableAndWriteDataWithLabels(
|
try (Table t = createTableAndWriteDataWithLabels(
|
||||||
|
|
Loading…
Reference in New Issue