HBASE-16231 Support client keytab login for integration tests

This commit is contained in:
Gary Helmling 2016-07-14 14:15:19 -07:00
parent 66c68f8ea3
commit 84b7010a30
1 changed files with 15 additions and 0 deletions

View File

@ -117,6 +117,17 @@ public abstract class IntegrationTestBase extends AbstractHBaseTool {
@Override
protected int doWork() throws Exception {
ChoreService choreService = null;
// Launches chore for refreshing kerberos credentials if security is enabled.
// Please see http://hbase.apache.org/book.html#_running_canary_in_a_kerberos_enabled_cluster
// for more details.
final ScheduledChore authChore = AuthUtil.getAuthChore(conf);
if (authChore != null) {
choreService = new ChoreService("INTEGRATION_TEST");
choreService.scheduleChore(authChore);
}
setUp();
int result = -1;
try {
@ -125,6 +136,10 @@ public abstract class IntegrationTestBase extends AbstractHBaseTool {
cleanUp();
}
if (choreService != null) {
choreService.shutdown();
}
return result;
}