You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/10/01 02:48:29 UTC

[07/12] git commit: SLIDER-448 AMFailuresIT needs vagrant

SLIDER-448 AMFailuresIT needs vagrant


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/ba1e79b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/ba1e79b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/ba1e79b9

Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry
Commit: ba1e79b9e0447bdf5b5173b7d4d17477e33fad19
Parents: 2a3a4ed
Author: Gour Saha <go...@apache.org>
Authored: Mon Sep 29 16:55:54 2014 -0700
Committer: Gour Saha <go...@apache.org>
Committed: Mon Sep 29 16:55:54 2014 -0700

----------------------------------------------------------------------
 .../org/apache/slider/common/SliderXMLConfKeysForTesting.java | 1 +
 .../slider/funtest/framework/AgentCommandTestBase.groovy      | 7 +++++++
 .../org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy   | 6 ++++++
 src/test/clusters/remote/slider/slider-client.xml             | 6 ++++++
 4 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ba1e79b9/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java b/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
index 4c56240..8886cb7 100644
--- a/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
+++ b/slider-core/src/main/java/org/apache/slider/common/SliderXMLConfKeysForTesting.java
@@ -62,6 +62,7 @@ public interface SliderXMLConfKeysForTesting {
   String KEY_TEST_AGENT_ENABLED = "slider.test.agent.enabled";
   String KEY_AGENTTESTS_QUEUE_LABELED_DEFINED = "slider.test.agent.labeled.queue.enabled";
   String KEY_AGENTTESTS_LABELS_RED_BLUE_DEFINED = "slider.test.agent.labels.defined";
+  String KEY_AGENTTESTS_AM_FAILURES_ENABLED = "slider.test.agent.am.failures.enabled";
 
   int DEFAULT_AGENT_LAUNCH_TIME_SECONDS = 60 * 3;
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ba1e79b9/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 cf32e94..602fe2c 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
@@ -39,6 +39,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
   public static final boolean AGENTTESTS_ENABLED
   public static final boolean AGENTTESTS_QUEUE_LABELED_DEFINED
   public static final boolean AGENTTESTS_LABELS_RED_BLUE_DEFINED
+  public static final boolean AGENTTESTS_AM_FAILURES_ENABLED
   private static String TEST_APP_PKG_DIR_PROP = "test.app.pkg.dir"
   private static String TEST_APP_PKG_FILE_PROP = "test.app.pkg.file"
   private static String TEST_APP_PKG_NAME_PROP = "test.app.pkg.name"
@@ -65,6 +66,8 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
         SLIDER_CONFIG.getBoolean(KEY_AGENTTESTS_QUEUE_LABELED_DEFINED, false)
     AGENTTESTS_LABELS_RED_BLUE_DEFINED =
         SLIDER_CONFIG.getBoolean(KEY_AGENTTESTS_LABELS_RED_BLUE_DEFINED, false)
+    AGENTTESTS_AM_FAILURES_ENABLED = 
+        SLIDER_CONFIG.getBoolean(KEY_AGENTTESTS_AM_FAILURES_ENABLED, false)
   }
 
   protected String getAppResource() {
@@ -90,6 +93,10 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
     assume(AGENTTESTS_LABELS_RED_BLUE_DEFINED, "Custom node labels not defined")
   }
 
+  public static void assumeAmFailureTestsEnabled() {
+    assume(AGENTTESTS_AM_FAILURES_ENABLED, "AM failure tests are disabled")
+  }
+
   @BeforeClass
   public static void setupAgent() {
     assumeAgentTestsEnabled()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ba1e79b9/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
index 852121f..9db0fec 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AMFailuresIT.groovy
@@ -33,6 +33,7 @@ import org.apache.slider.funtest.framework.AgentCommandTestBase
 import org.apache.slider.funtest.framework.FuntestProperties
 import org.apache.slider.funtest.framework.SliderShell
 import org.junit.After
+import org.junit.BeforeClass;
 import org.junit.Test
 
 @CompileStatic
@@ -46,6 +47,11 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
   public static final String VAGRANT_CWD = "vagrant.current.working.dir"
   File sshkey
 
+  @BeforeClass
+  public static void setupAMTests() {
+    assumeAmFailureTestsEnabled()
+  }
+
   @After
   public void destroyCluster() {
     cleanup(APPLICATION_NAME)

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ba1e79b9/src/test/clusters/remote/slider/slider-client.xml
----------------------------------------------------------------------
diff --git a/src/test/clusters/remote/slider/slider-client.xml b/src/test/clusters/remote/slider/slider-client.xml
index ce261e9..f8d88eb 100644
--- a/src/test/clusters/remote/slider/slider-client.xml
+++ b/src/test/clusters/remote/slider/slider-client.xml
@@ -67,6 +67,12 @@
   </property>
 
   <property>
+    <name>slider.test.agent.am.failures.enabled</name>
+    <value>false</value>
+    <description>AM failure test scenarios - if enabled vagrant.current.working.dir needs to be set as well</description>
+  </property>
+
+  <property>
     <name>slider.test.agent.tar</name>
     <value>hdfs://c6403.ambari.apache.org:8020/slider/agent/slider-agent.tar.gz</value>
   </property>