You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sn...@apache.org on 2019/08/16 10:32:16 UTC
[hadoop] branch trunk updated: YARN-9461.
TestRMWebServicesDelegationTokenAuthentication.testCancelledDelegationToken
fails with HTTP 400. Contributed by Peter Bacsko
This is an automated email from the ASF dual-hosted git repository.
snemeth pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 9b8359b YARN-9461. TestRMWebServicesDelegationTokenAuthentication.testCancelledDelegationToken fails with HTTP 400. Contributed by Peter Bacsko
9b8359b is described below
commit 9b8359bb085b29b868ec9e704bf655b58d3e36a7
Author: Szilard Nemeth <sn...@apache.org>
AuthorDate: Fri Aug 16 12:31:58 2019 +0200
YARN-9461. TestRMWebServicesDelegationTokenAuthentication.testCancelledDelegationToken fails with HTTP 400. Contributed by Peter Bacsko
---
...RMWebServicesDelegationTokenAuthentication.java | 23 ++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java
index 41e56ae..6eecaa9f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java
@@ -59,8 +59,10 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationSubmissionContextInfo;
import org.codehaus.jettison.json.JSONObject;
+import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -84,8 +86,8 @@ public class TestRMWebServicesDelegationTokenAuthentication {
private static boolean miniKDCStarted = false;
private static MiniKdc testMiniKDC;
- private static MockRM rm;
private static String sunSecurityKrb5RcacheValue;
+ private MockRM rm;
String delegationTokenHeader;
@@ -107,7 +109,7 @@ public class TestRMWebServicesDelegationTokenAuthentication {
System.setProperty(SUN_SECURITY_KRB5_RCACHE_KEY, "none");
testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir);
setupKDC();
- setupAndStartRM();
+
} catch (Exception e) {
assertTrue("Couldn't create MiniKDC", false);
}
@@ -118,9 +120,6 @@ public class TestRMWebServicesDelegationTokenAuthentication {
if (testMiniKDC != null) {
testMiniKDC.stop();
}
- if (rm != null) {
- rm.stop();
- }
if (sunSecurityKrb5RcacheValue == null) {
System.clearProperty(SUN_SECURITY_KRB5_RCACHE_KEY);
} else {
@@ -129,6 +128,18 @@ public class TestRMWebServicesDelegationTokenAuthentication {
}
}
+ @Before
+ public void before() throws Exception {
+ setupAndStartRM();
+ }
+
+ @After
+ public void after() {
+ if (rm != null) {
+ rm.stop();
+ }
+ }
+
@Parameterized.Parameters
public static Collection<Object[]> headers() {
return Arrays.asList(new Object[][] { {OldDelegationTokenHeader}, {NewDelegationTokenHeader}});
@@ -139,7 +150,7 @@ public class TestRMWebServicesDelegationTokenAuthentication {
this.delegationTokenHeader = header;
}
- private static void setupAndStartRM() throws Exception {
+ private void setupAndStartRM() throws Exception {
Configuration rmconf = new Configuration();
rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org