[
https://issues.apache.org/jira/browse/FLUME-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14220162#comment-14220162
]
Joey Echeverria commented on FLUME-2557:
----------------------------------------
I think testFlumeLogin covers those but needs more commetns to make it clear:
{code:java}
@Test
public void testFlumeLogin() throws IOException {
String principal = flumePrincipal;
String keytab = flumeKeytab.getAbsolutePath();
String expResult = principal;
// Ensure login works when we don't already have a TGT
String result = KerberosUtil.login(principal, keytab).getUserName();
assertEquals("Initial login failed", expResult, result);
// Ensure doing a second login with the same principal succeeds
result = KerberosUtil.login(principal, keytab).getUserName();
assertEquals("Re-login failed", expResult, result);
// Make sure logging in with a new principal fails
principal = alicePrincipal;
keytab = aliceKeytab.getAbsolutePath();
try {
result = KerberosUtil.login(principal, keytab).getUserName();
fail("Login should have failed with a new principal: " + result);
} catch (KerberosUtil.SecurityException ex) {
assertTrue("Login with a new principal failed, but for an unexpected "
+ "reason: " + ex.getMessage(),
ex.getMessage().contains("Cannot use multiple Kerberos principals:
"));
}
}
{code}
I added comments to call out the different scenerios above, and I can add those
to the patch. I put all of these into a single test case as the login is
JVM-wide and I'm not 100% certain how to control the order that tests are run,
so I wanted them all in the same method.
> DatasetSink doesn't work with Kerberos
> --------------------------------------
>
> Key: FLUME-2557
> URL: https://issues.apache.org/jira/browse/FLUME-2557
> Project: Flume
> Issue Type: Bug
> Components: Sinks+Sources
> Affects Versions: v1.5.2
> Reporter: Joey Echeverria
> Assignee: Joey Echeverria
> Fix For: v1.6.0
>
> Attachments: FLUME-2557.patch
>
>
> When configuring Kerberos, you'll get an error such as:
> Sink kite-dataset has been removed due to an error during configuration
> org.apache.flume.sink.kite.KerberosUtil$SecurityException: Cannot use
> multiple Kerberos principals:
> flume/[email protected] would replace flume
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)