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 0024118440 for ; Tue, 12 May 2015 17:45:40 +0000 (UTC) Received: (qmail 64341 invoked by uid 500); 12 May 2015 17:45:40 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 64263 invoked by uid 500); 12 May 2015 17:45:40 -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 64254 invoked by uid 99); 12 May 2015 17:45:40 -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; Tue, 12 May 2015 17:45:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 99102E0B3F; Tue, 12 May 2015 17:45:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kasha@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-3613. TestContainerManagerSecurity should init and start Yarn cluster in setup instead of individual methods. (nijel via kasha) Date: Tue, 12 May 2015 17:45:40 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/trunk 2f4b6d115 -> fe0df5962 YARN-3613. TestContainerManagerSecurity should init and start Yarn cluster in setup instead of individual methods. (nijel via kasha) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fe0df596 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fe0df596 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fe0df596 Branch: refs/heads/trunk Commit: fe0df596271340788095cb43a1944e19ac4c2cf7 Parents: 2f4b6d1 Author: Karthik Kambatla Authored: Tue May 12 10:45:33 2015 -0700 Committer: Karthik Kambatla Committed: Tue May 12 10:45:33 2015 -0700 ---------------------------------------------------------------------- hadoop-yarn-project/CHANGES.txt | 3 ++ .../server/TestContainerManagerSecurity.java | 46 +++++--------------- 2 files changed, 15 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/fe0df596/hadoop-yarn-project/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 131161f..5a858cf 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -230,6 +230,9 @@ Release 2.8.0 - UNRELEASED YARN-3513. Remove unused variables in ContainersMonitorImpl and add debug log for overall resource usage by all containers. (Naganarasimha G R via devaraj) + YARN-3613. TestContainerManagerSecurity should init and start Yarn cluster in + setup instead of individual methods. (nijel via kasha) + OPTIMIZATIONS YARN-3339. TestDockerContainerExecutor should pull a single image and not http://git-wip-us.apache.org/repos/asf/hadoop/blob/fe0df596/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java index f0dcb56..59bb6aa 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java @@ -82,8 +82,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteStreams; @RunWith(Parameterized.class) public class TestContainerManagerSecurity extends KerberosSecurityTestcase { @@ -105,10 +103,20 @@ public class TestContainerManagerSecurity extends KerberosSecurityTestcase { testRootDir.mkdirs(); httpSpnegoKeytabFile.deleteOnExit(); getKdc().createPrincipal(httpSpnegoKeytabFile, httpSpnegoPrincipal); + + yarnCluster = + new MiniYARNCluster(TestContainerManagerSecurity.class.getName(), 1, 1, + 1); + yarnCluster.init(conf); + yarnCluster.start(); } @After public void tearDown() { + if (yarnCluster != null) { + yarnCluster.stop(); + yarnCluster = null; + } testRootDir.delete(); } @@ -144,11 +152,6 @@ public class TestContainerManagerSecurity extends KerberosSecurityTestcase { @Test (timeout = 120000) public void testContainerManager() throws Exception { - try { - yarnCluster = new MiniYARNCluster(TestContainerManagerSecurity.class - .getName(), 1, 1, 1); - yarnCluster.init(conf); - yarnCluster.start(); // TestNMTokens. testNMTokens(conf); @@ -156,36 +159,11 @@ public class TestContainerManagerSecurity extends KerberosSecurityTestcase { // Testing for container token tampering testContainerToken(conf); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } finally { - if (yarnCluster != null) { - yarnCluster.stop(); - yarnCluster = null; - } - } - } - - @Test (timeout = 120000) - public void testContainerManagerWithEpoch() throws Exception { - try { - yarnCluster = new MiniYARNCluster(TestContainerManagerSecurity.class - .getName(), 1, 1, 1); - yarnCluster.init(conf); - yarnCluster.start(); - - // Testing for container token tampering + // Testing for container token tampering with epoch testContainerTokenWithEpoch(conf); - } finally { - if (yarnCluster != null) { - yarnCluster.stop(); - yarnCluster = null; - } - } } - + private void testNMTokens(Configuration conf) throws Exception { NMTokenSecretManagerInRM nmTokenSecretManagerRM = yarnCluster.getResourceManager().getRMContext()