From 8fdff5b791b9f80617544038f1f3e46dd513d934 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Wed, 22 Oct 2014 14:34:57 +0100 Subject: [PATCH] YARN-2692 ktutil test hanging on some machines/ktutil versions (stevel) --- hadoop-yarn-project/CHANGES.txt | 2 + .../hadoop/registry/RegistryTestHelper.java | 42 ------------------- .../registry/secure/TestSecureLogins.java | 13 ------ 3 files changed, 2 insertions(+), 55 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index f1442c81f10..04277a189ae 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -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 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/RegistryTestHelper.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/RegistryTestHelper.java index 38cc2cb7264..460ecad876a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/RegistryTestHelper.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/RegistryTestHelper.java @@ -325,48 +325,6 @@ public class RegistryTestHelper extends Assert { return null; } - /** - * Exec the native ktutil 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 ktutil to be installed and on the path - *
-   *   ktutil --keytab=target/kdc/zookeeper.keytab list --keys
-   * 
- * @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 ktutils -l ... 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 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java index 9a90a45a2ef..5592e19ff7b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureLogins.java @@ -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());