HADOOP-11273. TestMiniKdc failure: login options not compatible with IBM JDK. Contributed by Gao Zhong Liang.

This commit is contained in:
Haohui Mai 2014-12-09 10:57:32 -08:00
parent d8352b9b2b
commit d08fc9aca8
2 changed files with 17 additions and 8 deletions

View File

@ -545,6 +545,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11372. Fix new findbugs warnings in mapreduce-examples. HADOOP-11372. Fix new findbugs warnings in mapreduce-examples.
(Li Lu via wheat9) (Li Lu via wheat9)
HADOOP-11273. TestMiniKdc failure: login options not compatible with IBM
JDK. (Gao Zhong Liang via wheat9)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -37,7 +37,8 @@ import java.util.HashMap;
import java.util.Arrays; import java.util.Arrays;
public class TestMiniKdc extends KerberosSecurityTestcase { public class TestMiniKdc extends KerberosSecurityTestcase {
private static final boolean IBM_JAVA = System.getProperty("java.vendor")
.contains("IBM");
@Test @Test
public void testMiniKdcStart() { public void testMiniKdcStart() {
MiniKdc kdc = getKdc(); MiniKdc kdc = getKdc();
@ -94,15 +95,20 @@ public class TestMiniKdc extends KerberosSecurityTestcase {
@Override @Override
public AppConfigurationEntry[] getAppConfigurationEntry(String name) { public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
Map<String, String> options = new HashMap<String, String>(); Map<String, String> options = new HashMap<String, String>();
options.put("keyTab", keytab);
options.put("principal", principal); options.put("principal", principal);
options.put("useKeyTab", "true");
options.put("storeKey", "true");
options.put("doNotPrompt", "true");
options.put("useTicketCache", "true");
options.put("renewTGT", "true");
options.put("refreshKrb5Config", "true"); options.put("refreshKrb5Config", "true");
options.put("isInitiator", Boolean.toString(isInitiator)); if (IBM_JAVA) {
options.put("useKeytab", keytab);
options.put("credsType", "both");
} else {
options.put("keyTab", keytab);
options.put("useKeyTab", "true");
options.put("storeKey", "true");
options.put("doNotPrompt", "true");
options.put("useTicketCache", "true");
options.put("renewTGT", "true");
options.put("isInitiator", Boolean.toString(isInitiator));
}
String ticketCache = System.getenv("KRB5CCNAME"); String ticketCache = System.getenv("KRB5CCNAME");
if (ticketCache != null) { if (ticketCache != null) {
options.put("ticketCache", ticketCache); options.put("ticketCache", ticketCache);