From 84b7010a305791c69d519d37fc0292c013e1a873 Mon Sep 17 00:00:00 2001 From: Gary Helmling Date: Thu, 14 Jul 2016 14:15:19 -0700 Subject: [PATCH] HBASE-16231 Support client keytab login for integration tests --- .../apache/hadoop/hbase/IntegrationTestBase.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java index 39295241e6c..d3433c75184 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java @@ -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; }