Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C17DD0F8 for ; Thu, 27 Sep 2012 17:35:25 +0000 (UTC) Received: (qmail 42858 invoked by uid 500); 27 Sep 2012 17:35:25 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 42823 invoked by uid 500); 27 Sep 2012 17:35:25 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 42814 invoked by uid 99); 27 Sep 2012 17:35:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2012 17:35:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2012 17:35:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7188B238890D; Thu, 27 Sep 2012 17:34:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1391127 - in /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs: ./ src/test/java/org/apache/hadoop/tools/ src/test/resources/META-INF/services/ Date: Thu, 27 Sep 2012 17:34:40 -0000 To: hdfs-commits@hadoop.apache.org From: bobby@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120927173440.7188B238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bobby Date: Thu Sep 27 17:34:39 2012 New Revision: 1391127 URL: http://svn.apache.org/viewvc?rev=1391127&view=rev Log: svn merge -c 1391121 FIXES: HDFS-3831. Failure to renew tokens due to test-sources left in classpath (jlowe via bobby) Added: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/FakeRenewer.java - copied unchanged from r1391121, hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/FakeRenewer.java Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/META-INF/services/org.apache.hadoop.security.token.TokenRenewer Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1391127&r1=1391126&r2=1391127&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Thu Sep 27 17:34:39 2012 @@ -15,6 +15,9 @@ Release 0.23.4 - UNRELEASED HDFS-3860. HeartbeatManager#Monitor may wrongly hold the writelock of namesystem. (Jing Zhao via atm) + HDFS-3831. Failure to renew tokens due to test-sources left in classpath + (jlowe via bobby) + Release 0.23.3 - UNRELEASED INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java?rev=1391127&r1=1391126&r2=1391127&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java (original) +++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java Thu Sep 27 17:34:39 2012 @@ -36,9 +36,7 @@ import org.apache.hadoop.hdfs.security.t import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; import org.apache.hadoop.io.Text; import org.apache.hadoop.security.Credentials; -import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.Token; -import org.apache.hadoop.security.token.TokenRenewer; import org.junit.Before; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; @@ -50,7 +48,6 @@ public class TestDelegationTokenFetcher private Configuration conf; private URI uri; private static final String SERVICE_VALUE = "localhost:2005"; - private static final Text KIND = new Text("TESTING-TOKEN-KIND"); private static String tokenFile = "file.dta"; @Before @@ -61,37 +58,6 @@ public class TestDelegationTokenFetcher FileSystemTestHelper.addFileSystemForTesting(uri, conf, dfs); } - public static class FakeRenewer extends TokenRenewer { - static Token lastRenewed = null; - static Token lastCanceled = null; - - @Override - public boolean handleKind(Text kind) { - return KIND.equals(kind); - } - - @Override - public boolean isManaged(Token token) throws IOException { - return true; - } - - @Override - public long renew(Token token, Configuration conf) { - lastRenewed = token; - return 0; - } - - @Override - public void cancel(Token token, Configuration conf) { - lastCanceled = token; - } - - public static void reset() { - lastRenewed = null; - lastCanceled = null; - } - } - /** * Verify that when the DelegationTokenFetcher runs, it talks to the Namenode, * pulls out the correct user's token and successfully serializes it to disk. @@ -103,13 +69,11 @@ public class TestDelegationTokenFetcher new Text("renewer"), new Text("realuser")).getBytes(); final byte[] pw = new byte[] { 42 }; final Text service = new Text(uri.toString()); - final String user = - UserGroupInformation.getCurrentUser().getShortUserName(); // Create a token for the fetcher to fetch, wire NN to return it when asked // for this particular user. final Token t = - new Token(ident, pw, KIND, service); + new Token(ident, pw, FakeRenewer.KIND, service); when(dfs.addDelegationTokens(eq((String) null), any(Credentials.class))).thenAnswer( new Answer[]>() { @Override Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/META-INF/services/org.apache.hadoop.security.token.TokenRenewer URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/META-INF/services/org.apache.hadoop.security.token.TokenRenewer?rev=1391127&r1=1391126&r2=1391127&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/META-INF/services/org.apache.hadoop.security.token.TokenRenewer (original) +++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/META-INF/services/org.apache.hadoop.security.token.TokenRenewer Thu Sep 27 17:34:39 2012 @@ -1 +1 @@ -org.apache.hadoop.tools.TestDelegationTokenFetcher$FakeRenewer +org.apache.hadoop.tools.FakeRenewer