Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C65D17BA1 for ; Mon, 2 Mar 2015 17:15:52 +0000 (UTC) Received: (qmail 98873 invoked by uid 500); 2 Mar 2015 17:15:20 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 98455 invoked by uid 500); 2 Mar 2015 17:15:20 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 95188 invoked by uid 99); 2 Mar 2015 17:15:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2015 17:15:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4548AE10D9; Mon, 2 Mar 2015 17:15:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zhz@apache.org To: common-commits@hadoop.apache.org Date: Mon, 02 Mar 2015 17:16:02 -0000 Message-Id: <314427d94eee49ceafe2157c047b5429@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [46/50] [abbrv] hadoop git commit: HADOOP-10774. Update KerberosTestUtils for hadoop-auth tests when using IBM Java (sangamesh via aw) HADOOP-10774. Update KerberosTestUtils for hadoop-auth tests when using IBM Java (sangamesh via aw) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/260883bf Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/260883bf Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/260883bf Branch: refs/heads/HDFS-7285 Commit: 260883bf402cf8ad9b999a6077ba56e75820738f Parents: d6c1b62 Author: Allen Wittenauer Authored: Sat Feb 28 23:22:06 2015 -0800 Committer: Zhe Zhang Committed: Mon Mar 2 09:13:55 2015 -0800 ---------------------------------------------------------------------- .../authentication/KerberosTestUtils.java | 40 ++++++++++++++------ hadoop-common-project/hadoop-common/CHANGES.txt | 3 ++ 2 files changed, 32 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/260883bf/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/KerberosTestUtils.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/KerberosTestUtils.java b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/KerberosTestUtils.java index 7629a30..8fc08e2 100644 --- a/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/KerberosTestUtils.java +++ b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/KerberosTestUtils.java @@ -32,12 +32,14 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; +import static org.apache.hadoop.util.PlatformName.IBM_JAVA; + /** * Test helper class for Java Kerberos setup. */ public class KerberosTestUtils { private static String keytabFile = new File(System.getProperty("test.dir", "target"), - UUID.randomUUID().toString()).toString(); + UUID.randomUUID().toString()).getAbsolutePath(); public static String getRealm() { return "EXAMPLE.COM"; @@ -65,18 +67,34 @@ public class KerberosTestUtils { @Override public AppConfigurationEntry[] getAppConfigurationEntry(String name) { Map options = new HashMap(); - options.put("keyTab", KerberosTestUtils.getKeytabFile()); - 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("isInitiator", "true"); + if (IBM_JAVA) { + options.put("useKeytab", KerberosTestUtils.getKeytabFile().startsWith("file://") ? + KerberosTestUtils.getKeytabFile() : "file://" + KerberosTestUtils.getKeytabFile()); + options.put("principal", principal); + options.put("refreshKrb5Config", "true"); + options.put("credsType", "both"); + } else { + options.put("keyTab", KerberosTestUtils.getKeytabFile()); + 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("isInitiator", "true"); + } String ticketCache = System.getenv("KRB5CCNAME"); if (ticketCache != null) { - options.put("ticketCache", ticketCache); + if (IBM_JAVA) { + // IBM JAVA only respect system property and not env variable + // The first value searched when "useDefaultCcache" is used. + System.setProperty("KRB5CCNAME", ticketCache); + options.put("useDefaultCcache", "true"); + options.put("renewTGT", "true"); + } else { + options.put("ticketCache", ticketCache); + } } options.put("debug", "true"); http://git-wip-us.apache.org/repos/asf/hadoop/blob/260883bf/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 74bf558..3c4dc99 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -403,6 +403,9 @@ Trunk (Unreleased) HADOOP-11637. bash location hard-coded in shell scripts (aw) + HADOOP-10774. Update KerberosTestUtils for hadoop-auth tests when using + IBM Java (sangamesh via aw) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd)