From common-commits-return-88844-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Thu Oct 4 03:18:58 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 28C6118065B for ; Thu, 4 Oct 2018 03:18:57 +0200 (CEST) Received: (qmail 35384 invoked by uid 500); 4 Oct 2018 01:18:57 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 35375 invoked by uid 99); 4 Oct 2018 01:18:57 -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; Thu, 04 Oct 2018 01:18:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8D337DFE18; Thu, 4 Oct 2018 01:18:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aajisaka@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-8840. Add missing cleanupSSLConfig() call for TestTimelineClient test. Contributed by Aki Tanaka. Date: Thu, 4 Oct 2018 01:18:56 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/branch-2 150505844 -> 65aaa1017 YARN-8840. Add missing cleanupSSLConfig() call for TestTimelineClient test. Contributed by Aki Tanaka. (cherry picked from commit 39b35036ba47064149003046a7b59feb01575d1e) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/65aaa101 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/65aaa101 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/65aaa101 Branch: refs/heads/branch-2 Commit: 65aaa10173d601af41225845f5abd73276d01776 Parents: 1505058 Author: Akira Ajisaka Authored: Thu Oct 4 09:51:42 2018 +0900 Committer: Akira Ajisaka Committed: Thu Oct 4 10:15:37 2018 +0900 ---------------------------------------------------------------------- .../client/api/impl/TestTimelineClient.java | 25 ++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/65aaa101/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java index a5f2f7b..10750e3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java @@ -25,7 +25,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; -import java.io.File; import java.io.IOException; import java.net.ConnectException; import java.net.SocketTimeoutException; @@ -62,6 +61,8 @@ public class TestTimelineClient { private TimelineClientImpl client; private TimelineWriter spyTimelineWriter; + private String keystoresDir; + private String sslConfDir; @Before public void setup() { @@ -72,10 +73,13 @@ public class TestTimelineClient { } @After - public void tearDown() { + public void tearDown() throws Exception { if (client != null) { client.stop(); } + if (isSSLConfigured()) { + KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir); + } } @Test @@ -453,11 +457,7 @@ public class TestTimelineClient { conf.setInt(YarnConfiguration.TIMELINE_SERVICE_CLIENT_MAX_RETRIES, 0); conf.set(YarnConfiguration.YARN_HTTP_POLICY_KEY, Policy.HTTPS_ONLY.name()); - File testDir = TestGenericTestUtils.getTestDir(); - String sslConfDir = - KeyStoreTestUtil.getClasspathDir(TestTimelineClient.class); - KeyStoreTestUtil.setupSSLConfig(testDir.getAbsolutePath(), - sslConfDir, conf, false); + setupSSLConfig(conf); client = createTimelineClient(conf); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); @@ -491,6 +491,17 @@ public class TestTimelineClient { Assert.assertFalse("Reloader is still alive", reloaderStillAlive); } + private void setupSSLConfig(YarnConfiguration conf) throws Exception { + keystoresDir = TestGenericTestUtils.getTestDir().getAbsolutePath(); + sslConfDir = + KeyStoreTestUtil.getClasspathDir(TestTimelineClient.class); + KeyStoreTestUtil.setupSSLConfig(keystoresDir, sslConfDir, conf, false); + } + + private boolean isSSLConfigured() { + return keystoresDir != null && sslConfDir != null; + } + private static class TestTimelineDelegationTokenSecretManager extends AbstractDelegationTokenSecretManager { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org