YARN-4813. TestRMWebServicesDelegationTokenAuthentication.testDoAs fails intermittently (grepas via rkanter)
(cherry picked from commit c83fe44917
)
This commit is contained in:
parent
d0fc1cd0c8
commit
edf9fd51fb
|
@ -76,6 +76,8 @@ public class TestRMWebServicesDelegationTokenAuthentication {
|
||||||
TestRMWebServicesDelegationTokenAuthentication.class.getName() + "-root");
|
TestRMWebServicesDelegationTokenAuthentication.class.getName() + "-root");
|
||||||
private static File httpSpnegoKeytabFile = new File(
|
private static File httpSpnegoKeytabFile = new File(
|
||||||
KerberosTestUtils.getKeytabFile());
|
KerberosTestUtils.getKeytabFile());
|
||||||
|
private static final String SUN_SECURITY_KRB5_RCACHE_KEY =
|
||||||
|
"sun.security.krb5.rcache";
|
||||||
|
|
||||||
private static String httpSpnegoPrincipal = KerberosTestUtils
|
private static String httpSpnegoPrincipal = KerberosTestUtils
|
||||||
.getServerPrincipal();
|
.getServerPrincipal();
|
||||||
|
@ -83,7 +85,7 @@ public class TestRMWebServicesDelegationTokenAuthentication {
|
||||||
private static boolean miniKDCStarted = false;
|
private static boolean miniKDCStarted = false;
|
||||||
private static MiniKdc testMiniKDC;
|
private static MiniKdc testMiniKDC;
|
||||||
private static MockRM rm;
|
private static MockRM rm;
|
||||||
|
private static String sunSecurityKrb5RcacheValue;
|
||||||
|
|
||||||
String delegationTokenHeader;
|
String delegationTokenHeader;
|
||||||
|
|
||||||
|
@ -98,6 +100,11 @@ public class TestRMWebServicesDelegationTokenAuthentication {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
try {
|
try {
|
||||||
|
// Disabling kerberos replay cache to avoid "Request is a replay" errors
|
||||||
|
// caused by frequent webservice calls
|
||||||
|
sunSecurityKrb5RcacheValue =
|
||||||
|
System.getProperty(SUN_SECURITY_KRB5_RCACHE_KEY);
|
||||||
|
System.setProperty(SUN_SECURITY_KRB5_RCACHE_KEY, "none");
|
||||||
testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir);
|
testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir);
|
||||||
setupKDC();
|
setupKDC();
|
||||||
setupAndStartRM();
|
setupAndStartRM();
|
||||||
|
@ -114,6 +121,12 @@ public class TestRMWebServicesDelegationTokenAuthentication {
|
||||||
if (rm != null) {
|
if (rm != null) {
|
||||||
rm.stop();
|
rm.stop();
|
||||||
}
|
}
|
||||||
|
if (sunSecurityKrb5RcacheValue == null) {
|
||||||
|
System.clearProperty(SUN_SECURITY_KRB5_RCACHE_KEY);
|
||||||
|
} else {
|
||||||
|
System.setProperty(SUN_SECURITY_KRB5_RCACHE_KEY,
|
||||||
|
sunSecurityKrb5RcacheValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Parameterized.Parameters
|
@Parameterized.Parameters
|
||||||
|
|
Loading…
Reference in New Issue