use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.
the class RegionProcedureStoreTestBase method setUp.
@Before
public void setUp() throws IOException {
htu = new HBaseCommonTestingUtil();
Configuration conf = htu.getConfiguration();
conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, false);
// Runs on local filesystem. Test does not need sync. Turn off checks.
conf.setBoolean(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE, false);
Path testDir = htu.getDataTestDir();
CommonFSUtils.setRootDir(htu.getConfiguration(), testDir);
Server server = RegionProcedureStoreTestHelper.mockServer(conf);
region = MasterRegionFactory.create(server);
store = RegionProcedureStoreTestHelper.createStore(server, region, new LoadCounter());
}
use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.
the class MasterRegionTestBase method setUp.
@Before
public void setUp() throws IOException {
htu = new HBaseCommonTestingUtil();
htu.getConfiguration().setBoolean(MemStoreLAB.USEMSLAB_KEY, false);
// Runs on local filesystem. Test does not need sync. Turn off checks.
htu.getConfiguration().setBoolean(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE, false);
createMasterRegion();
}
use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.
the class TestRegionProcedureStoreMigration method setUp.
@Before
public void setUp() throws IOException {
htu = new HBaseCommonTestingUtil();
Configuration conf = htu.getConfiguration();
conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, false);
// Runs on local filesystem. Test does not need sync. Turn off checks.
conf.setBoolean(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE, false);
Path testDir = htu.getDataTestDir();
CommonFSUtils.setRootDir(conf, testDir);
walStore = new WALProcedureStore(conf, new LeaseRecovery() {
@Override
public void recoverFileLease(FileSystem fs, Path path) throws IOException {
}
});
walStore.start(1);
walStore.recoverLease();
walStore.load(new LoadCounter());
server = RegionProcedureStoreTestHelper.mockServer(conf);
region = MasterRegionFactory.create(server);
}
use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.
the class TestProxyUserSpnegoHttpServer method setupServer.
@BeforeClass
public static void setupServer() throws Exception {
Configuration conf = new Configuration();
HBaseCommonTestingUtil htu = new HBaseCommonTestingUtil(conf);
final String serverPrincipal = "HTTP/" + KDC_SERVER_HOST;
kdc = SimpleKdcServerUtil.getRunningSimpleKdcServer(new File(htu.getDataTestDir().toString()), HBaseCommonTestingUtil::randomFreePort);
File keytabDir = new File(htu.getDataTestDir("keytabs").toString());
if (keytabDir.exists()) {
deleteRecursively(keytabDir);
}
keytabDir.mkdirs();
infoServerKeytab = new File(keytabDir, serverPrincipal.replace('/', '_') + ".keytab");
wheelKeytab = new File(keytabDir, WHEEL_PRINCIPAL + ".keytab");
unprivilegedKeytab = new File(keytabDir, UNPRIVILEGED_PRINCIPAL + ".keytab");
privilegedKeytab = new File(keytabDir, PRIVILEGED_PRINCIPAL + ".keytab");
privileged2Keytab = new File(keytabDir, PRIVILEGED2_PRINCIPAL + ".keytab");
setupUser(kdc, wheelKeytab, WHEEL_PRINCIPAL);
setupUser(kdc, unprivilegedKeytab, UNPRIVILEGED_PRINCIPAL);
setupUser(kdc, privilegedKeytab, PRIVILEGED_PRINCIPAL);
setupUser(kdc, privileged2Keytab, PRIVILEGED2_PRINCIPAL);
setupUser(kdc, infoServerKeytab, serverPrincipal);
buildSpnegoConfiguration(conf, serverPrincipal, infoServerKeytab);
AccessControlList acl = buildAdminAcl(conf);
server = createTestServerWithSecurityAndAcl(conf, acl);
server.addPrivilegedServlet("echo", "/echo", EchoServlet.class);
server.addJerseyResourcePackage(JerseyResource.class.getPackage().getName(), "/jersey/*");
server.start();
baseUrl = getServerURL(server);
LOG.info("HTTP server started: " + baseUrl);
}
use of org.apache.hadoop.hbase.HBaseCommonTestingUtil in project hbase by apache.
the class TestChildProcedures method setUp.
@Before
public void setUp() throws IOException {
htu = new HBaseCommonTestingUtil();
testDir = htu.getDataTestDir();
fs = testDir.getFileSystem(htu.getConfiguration());
assertTrue(testDir.depth() > 1);
logDir = new Path(testDir, "proc-logs");
procEnv = new TestProcEnv();
procStore = ProcedureTestingUtility.createStore(htu.getConfiguration(), logDir);
procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), procEnv, procStore);
procExecutor.testing = new ProcedureExecutor.Testing();
procStore.start(PROCEDURE_EXECUTOR_SLOTS);
ProcedureTestingUtility.initAndStartWorkers(procExecutor, PROCEDURE_EXECUTOR_SLOTS, true);
}
Aggregations