SLIDER-509 agent launcher sets up homedir; add diagnostics command IT
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/5df53ea3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/5df53ea3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/5df53ea3 Branch: refs/heads/develop Commit: 5df53ea37d9e1fda6c5f7bf841558a5cdd08bccd Parents: a0601ff Author: Steve Loughran <ste...@apache.org> Authored: Tue Oct 14 10:47:37 2014 -0700 Committer: Steve Loughran <ste...@apache.org> Committed: Tue Oct 14 10:47:37 2014 -0700 ---------------------------------------------------------------------- .../funtest/framework/AgentCommandTestBase.groovy | 7 +++++-- .../slider/funtest/framework/CommandTestBase.groovy | 9 +++++++-- .../slider/funtest/framework/FuntestProperties.groovy | 6 ++++++ .../funtest/commands/DiagnosticsCommandIT.groovy | 13 ++++++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5df53ea3/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy ---------------------------------------------------------------------- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy index ec7d3e3..d5448bf 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy @@ -20,6 +20,7 @@ package org.apache.slider.funtest.framework import groovy.util.logging.Slf4j import org.apache.hadoop.fs.Path +import org.apache.hadoop.security.UserGroupInformation import org.apache.slider.common.SliderExitCodes import org.apache.slider.common.params.Arguments import org.apache.slider.common.params.SliderActions @@ -99,7 +100,9 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions { @BeforeClass public static void setupAgent() { assumeAgentTestsEnabled() - + def uploader = new FileUploader(SLIDER_CONFIG, + UserGroupInformation.currentUser) + uploader.mkHomeDir(); } @Before @@ -210,7 +213,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions { if (shell.ret != 0 && shell.ret != EXIT_UNKNOWN_INSTANCE) { logShell(shell) - assert fail("Old cluster either should not exist or should get destroyed.") + assert fail("Old cluster either should not exist or should get destroyed; destroy exit code = ${shell.ret}") } } } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5df53ea3/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy ---------------------------------------------------------------------- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy index 7f3c43d..cfe3006 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy @@ -579,8 +579,13 @@ abstract class CommandTestBase extends SliderTestUtils { } protected void ensureApplicationIsUp(String clusterName) { - repeatUntilTrue(this.&isApplicationUp, 15, 1000 * 3, ['arg1': clusterName], - true, 'Application did not start, aborting test.') + repeatUntilTrue(this.&isApplicationUp, + SLIDER_CONFIG.getInt(KEY_TEST_INSTANCE_LAUNCH_TIME, + DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS), + 1000, + ['arg1': clusterName], + true, + 'Application did not start, aborting test.') } protected boolean isApplicationUp(Map<String, String> args) { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5df53ea3/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy ---------------------------------------------------------------------- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy index 730639b..d9d6dd6 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy @@ -63,4 +63,10 @@ public interface FuntestProperties extends SliderXMLConfKeysForTesting { String AGENT_TAR_FILENAME = "slider-agent.tar.gz" String AGENT_SLIDER_GZ_IN_SLIDER_TAR = "agent/" + AGENT_TAR_FILENAME + + + String KEY_TEST_INSTANCE_LAUNCH_TIME = + "slider.test.instance.launch.wait.seconds"; + int DEFAULT_INSTANCE_LAUNCH_TIME_SECONDS = 60 * 3; + } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5df53ea3/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/DiagnosticsCommandIT.groovy ---------------------------------------------------------------------- diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/DiagnosticsCommandIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/DiagnosticsCommandIT.groovy index b210f4b..430a75f 100644 --- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/DiagnosticsCommandIT.groovy +++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/DiagnosticsCommandIT.groovy @@ -20,8 +20,9 @@ package org.apache.slider.funtest.commands import groovy.transform.CompileStatic import groovy.util.logging.Slf4j +import org.apache.slider.common.params.Arguments +import org.apache.slider.common.params.SliderActions import org.apache.slider.funtest.framework.CommandTestBase -import org.junit.BeforeClass import org.junit.Test @CompileStatic @@ -29,8 +30,14 @@ import org.junit.Test public class DiagnosticsCommandIT extends CommandTestBase { @Test - public void testListAll() throws Throwable { - assertSuccess(list(null)) + public void testClientDiagnostics() throws Throwable { + slider(0, + [ + SliderActions.ACTION_DIAGNOSTIC, + Arguments.ARG_CLIENT, + Arguments.ARG_VERBOSE + ] + ) } }