YARN-2692 ktutil test hanging on some machines/ktutil versions (stevel)
This commit is contained in:
parent
b1ca12bc0b
commit
8fdff5b791
|
@ -614,6 +614,8 @@ Release 2.6.0 - UNRELEASED
|
|||
YARN-2689 TestSecureRMRegistryOperations failing on windows:
|
||||
secure ZK won't start (stevel)
|
||||
|
||||
YARN-2692 ktutil test hanging on some machines/ktutil versions (stevel)
|
||||
|
||||
---
|
||||
|
||||
YARN-2598 GHS should show N/A instead of null for the inaccessible information
|
||||
|
|
|
@ -325,48 +325,6 @@ public class RegistryTestHelper extends Assert {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exec the native <code>ktutil</code> to list the keys
|
||||
* (primarily to verify that the generated keytabs are compatible).
|
||||
* This operation is not executed on windows. On other platforms
|
||||
* it requires <code>ktutil</code> to be installed and on the path
|
||||
* <pre>
|
||||
* ktutil --keytab=target/kdc/zookeeper.keytab list --keys
|
||||
* </pre>
|
||||
* @param keytab keytab to list
|
||||
* @throws IOException on any execution problem, including the executable
|
||||
* being missing
|
||||
*/
|
||||
public static String ktList(File keytab) throws IOException {
|
||||
if (!Shell.WINDOWS) {
|
||||
String path = keytab.getAbsolutePath();
|
||||
String out = Shell.execCommand(
|
||||
KTUTIL,
|
||||
"--keytab=" + path,
|
||||
"list",
|
||||
"--keys"
|
||||
);
|
||||
LOG.info("Listing of keytab {}:\n{}\n", path, out);
|
||||
return out;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a robust <code>ktutils -l</code> ... catches and ignores
|
||||
* exceptions, otherwise the output is logged.
|
||||
* @param keytab keytab to list
|
||||
* @return the result of the operation, or "" on any problem
|
||||
*/
|
||||
public static String ktListRobust(File keytab) {
|
||||
try {
|
||||
return ktList(keytab);
|
||||
} catch (IOException e) {
|
||||
// probably not on the path
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Login via a UGI. Requres UGI to have been set up
|
||||
* @param user username
|
||||
|
|
|
@ -56,19 +56,6 @@ public class TestSecureLogins extends AbstractSecureRegistryTest {
|
|||
private static final Logger LOG =
|
||||
LoggerFactory.getLogger(TestSecureLogins.class);
|
||||
|
||||
@Test
|
||||
public void testZKinKeytab() throws Throwable {
|
||||
Assume.assumeTrue(!Shell.WINDOWS);
|
||||
try {
|
||||
String listing = ktList(keytab_zk);
|
||||
assertTrue("no " + ZOOKEEPER_LOCALHOST + " in " + listing,
|
||||
listing.contains(ZOOKEEPER_LOCALHOST));
|
||||
} catch (IOException e) {
|
||||
LOG.debug(KTUTIL + " failure: {}", e, e);
|
||||
Assume.assumeTrue("Failed to run "+ KTUTIL+": " + e, false );
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHasRealm() throws Throwable {
|
||||
assertNotNull(getRealm());
|
||||
|
|
Loading…
Reference in New Issue