You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by bi...@apache.org on 2016/05/31 15:48:57 UTC

[1/2] incubator-slider git commit: SLIDER-1107 add IT for AM config generation

Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-1107_AM_config_generation 6b0ca18d4 -> 106d96c71


SLIDER-1107 add IT for AM config generation


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

Branch: refs/heads/feature/SLIDER-1107_AM_config_generation
Commit: e2ad57bb128490d4df380673a705806be8f90c76
Parents: 6b0ca18
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Tue May 31 08:47:23 2016 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Tue May 31 08:47:23 2016 -0700

----------------------------------------------------------------------
 .../providers/agent/AgentClientProvider.java    |   6 +-
 .../app_packages/test_am_config/appConfig.json  |  31 ++++
 .../app_packages/test_am_config/metainfo.json   |  70 +++++++++
 .../app_packages/test_am_config/resources.json  |  17 +++
 .../test_am_config/resources/test.template      |   1 +
 .../test_am_config/test_archive/testfile        |   1 +
 .../apache/slider/funtest/ResourcePaths.groovy  |   3 +
 .../funtest/misc/AMConfigPublishingIT.groovy    | 150 +++++++++++++++++++
 8 files changed, 276 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
index feac6a9..2c087ce 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
@@ -363,10 +363,10 @@ public class AgentClientProvider extends AbstractClientProvider
       }
 
       String client_script = null;
-      Component clientComponent = null;
+      String clientComponent = null;
       for (Component component : metaInfo.getApplication().getComponents()) {
         if (component.getCategory().equals("CLIENT")) {
-          clientComponent = component;
+          clientComponent = component.getName();
           if (component.getCommandScript() != null) {
             client_script = component.getCommandScript().getScript();
           }
@@ -441,7 +441,7 @@ public class AgentClientProvider extends AbstractClientProvider
           }
         }
         String user = RegistryUtils.currentUser();
-        for (ConfigFile configFile : metaInfo.getComponentConfigFiles(clientComponent.getName())) {
+        for (ConfigFile configFile : metaInfo.getComponentConfigFiles(clientComponent)) {
           retrieveConfigFile(rops, configuration, configFile, name, user,
               confInstallDir);
         }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-core/src/test/app_packages/test_am_config/appConfig.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_am_config/appConfig.json b/slider-core/src/test/app_packages/test_am_config/appConfig.json
new file mode 100644
index 0000000..9ede591
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_am_config/appConfig.json
@@ -0,0 +1,31 @@
+{
+  "schema": "http://example.org/specification/v2.0.0",
+  "metadata": {
+  },
+  "global": {
+    "am.config.generation": "true",
+    "site.global.application_id": "DateLogger",
+    "site.global.app_version": "1.0.0",
+    "site.global.app_root": "${AGENT_WORK_ROOT}/app/packages/command-logger",
+
+    "site.cl-site.logfile.location": "${AGENT_WORK_ROOT}/app/install/command-logger-app/operations.log",
+    "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p",
+    "site.cl-site.pattern.for.test.to.verify": "verify this pattern",
+
+    "site.client-json.clientkey": "clientval",
+    "site.test-json.jsonkey": "val1",
+    "site.test-xml.xmlkey": "val2",
+    "site.test-hadoop-xml.xmlkey": "val3",
+    "site.test-properties.propkey": "val4",
+    "site.test-yaml.yamlkey": "val5",
+    "site.test-env.content": "test ${envkey1} {{envkey2}} content",
+    "site.test-env.envkey1": "envval1",
+    "site.test-env.envkey2": "envval2",
+    "site.test-template.templatekey1": "templateval1",
+    "site.test-template.templatekey2": "templateval2"
+  },
+  "components": {
+    "COMMAND_LOGGER": {
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-core/src/test/app_packages/test_am_config/metainfo.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_am_config/metainfo.json b/slider-core/src/test/app_packages/test_am_config/metainfo.json
new file mode 100644
index 0000000..0238fd3
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_am_config/metainfo.json
@@ -0,0 +1,70 @@
+{
+  "schemaVersion": "2.1",
+  "application": {
+    "name": "DATE_LOGGER",
+    "components": [
+      {
+        "name": "DATE_LOGGER",
+        "commands": [
+          {
+            "exec": "echo \"Time: `date +{$conf:@//site/cl-site/datetime.format}` > {$conf:@//site/cl-site/logfile.location} 2>&1 && sleep 180000"
+          }
+        ]
+      },
+      {
+        "name": "DATE_LOGGER_CLIENT",
+        "category": "CLIENT",
+        "configFiles": [
+          {
+            "type": "json",
+            "fileName": "client.json",
+            "dictionaryName": "client-json"
+          }
+        ]
+      }
+    ],
+    "packages": [
+      {
+        "type": "archive",
+        "name": "test_am_config_generation.tgz"
+      }
+    ],
+    "configFiles": [
+      {
+        "type": "properties",
+        "fileName": "test.properties",
+        "dictionaryName": "test-properties"
+      },
+      {
+        "type": "template",
+        "fileName": "test.template",
+        "dictionaryName": "test-template"
+      },
+      {
+        "type": "json",
+        "fileName": "test.json",
+        "dictionaryName": "test-json"
+      },
+      {
+        "type": "env",
+        "fileName": "testenv",
+        "dictionaryName": "test-env"
+      },
+      {
+        "type": "hadoop-xml",
+        "fileName": "test-hadoop.xml",
+        "dictionaryName": "test-hadoop-xml"
+      },
+      {
+        "type": "xml",
+        "fileName": "test.xml",
+        "dictionaryName": "test-xml"
+      },
+      {
+        "type": "yaml",
+        "fileName": "test.yaml",
+        "dictionaryName": "test-yaml"
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-core/src/test/app_packages/test_am_config/resources.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_am_config/resources.json b/slider-core/src/test/app_packages/test_am_config/resources.json
new file mode 100644
index 0000000..72c2b7b
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_am_config/resources.json
@@ -0,0 +1,17 @@
+{
+  "schema" : "http://example.org/specification/v2.0.0",
+  "metadata" : {
+  },
+  "global" : {
+  },
+  "components": {
+    "slider-appmaster": {
+      "yarn.memory": "256"
+    },
+    "DATE_LOGGER": {
+      "yarn.role.priority": "1",
+      "yarn.component.instances": "1",
+      "yarn.memory": "128"
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-core/src/test/app_packages/test_am_config/resources/test.template
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_am_config/resources/test.template b/slider-core/src/test/app_packages/test_am_config/resources/test.template
new file mode 100644
index 0000000..1aff6bd
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_am_config/resources/test.template
@@ -0,0 +1 @@
+test ${templatekey1} {{templatekey2}} content

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-core/src/test/app_packages/test_am_config/test_archive/testfile
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_am_config/test_archive/testfile b/slider-core/src/test/app_packages/test_am_config/test_archive/testfile
new file mode 100644
index 0000000..8cd6f83
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_am_config/test_archive/testfile
@@ -0,0 +1 @@
+test archive contents

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
index 5de2b8e..bb5dfb4 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
@@ -38,4 +38,7 @@ interface ResourcePaths {
   String SLEEP_META = "$SLIDER_CORE_APP_PACKAGES/test_min_pkg/sleep_cmd/metainfo.json"
   String SLEEP_APPCONFIG = "$SLIDER_CORE_APP_PACKAGES/test_min_pkg/sleep_cmd/appConfig.json"
 
+  String AM_CONFIG_RESOURCES = "$SLIDER_CORE_APP_PACKAGES/test_am_config/resources.json"
+  String AM_CONFIG_META = "$SLIDER_CORE_APP_PACKAGES/test_am_config/metainfo.json"
+  String AM_CONFIG_APPCONFIG = "$SLIDER_CORE_APP_PACKAGES/test_am_config/appConfig.json"
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e2ad57bb/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/AMConfigPublishingIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/AMConfigPublishingIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/AMConfigPublishingIT.groovy
new file mode 100644
index 0000000..de3ea3e
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/AMConfigPublishingIT.groovy
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.funtest.misc
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.fs.Path
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.common.tools.SliderUtils
+import org.apache.slider.funtest.ResourcePaths
+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.Before
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class AMConfigPublishingIT extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+  private static String DATE_LOGGER = "DATE_LOGGER"
+  private static String APP_NAME = "am-config-publishing"
+  private static String APP_METAINFO = ResourcePaths.AM_CONFIG_META
+  private static String APP_RESOURCE = ResourcePaths.AM_CONFIG_RESOURCES
+  private static String APP_TEMPLATE = ResourcePaths.AM_CONFIG_APPCONFIG
+  private static String CLIENT_CONFIG = "../slider-core/src/test/app_packages/test_am_config/clientInstallConfig-default.json"
+  private static String RESOURCE_DIR = "../slider-core/src/test/app_packages/test_am_config/resources"
+  private static String TGZ_SOURCE = "../slider-core/src/test/app_packages/test_am_config/test_archive"
+  private static String TGZ_FILE = "test_am_config_generation.tgz"
+  private static String TGZ_DIR = "target/package-tmp/"
+
+  private static String CLIENT_INSTALL_DIR = "target/am-config-client"
+
+  private HashMap<String, String> files =
+    ["client.json": """{  "clientkey" : "clientval"}""",
+     "test.json": """{  "jsonkey" : "val1"}""",
+     "test.xml": "<configuration><property><name>xmlkey</name><value>val2</value><source/></property></configuration>",
+     "test-hadoop.xml": "<configuration><property><name>xmlkey</name><value>val3</value><source/></property></configuration>",
+     "test.properties": "propkey=val4",
+     "test.yaml": "yamlkey: val5",
+     "test.template": "test templateval1 templateval2 content",
+     "testenv": "test envval1 envval2 content",
+     "testfile": "test archive contents"
+  ]
+
+  @Before
+  public void prepareCluster() {
+    setupCluster(APP_NAME)
+  }
+
+  @Before
+  public void setupApplicationPackage() {
+    File tgzFile = new File(TGZ_DIR + TGZ_FILE);
+    SliderUtils.tarGzipFolder(new File(TGZ_SOURCE), tgzFile, null);
+    try {
+      tgzFile = tgzFile.canonicalFile
+      SliderShell shell = slider(EXIT_SUCCESS,
+        [
+          ACTION_RESOURCE,
+          ARG_INSTALL, ARG_RESOURCE, tgzFile.absolutePath,
+          ARG_OVERWRITE
+        ])
+      logShell(shell)
+      shell = slider(EXIT_SUCCESS,
+        [
+          ACTION_RESOURCE,
+          ARG_INSTALL, ARG_RESOURCE, RESOURCE_DIR,
+          ARG_DESTDIR, APP_NAME,
+          ARG_OVERWRITE
+        ])
+      logShell(shell)
+      log.info "Resources uploaded at home directory .slider/resources"
+    } catch (Exception e) {
+      setup_failed = true
+      throw e;
+    }
+    File dir = new File(CLIENT_INSTALL_DIR)
+    if (!dir.exists()) {
+      dir.mkdir()
+    }
+  }
+
+
+  @After
+  public void destroyCluster() {
+    cleanup(APP_NAME)
+  }
+
+  @Test
+  public void testCreate() throws Throwable {
+    assumeAgentTestsEnabled()
+
+    describe APP_NAME
+
+    def path = buildClusterPath(APP_NAME)
+    assert !clusterFS.exists(path)
+
+    slider(EXIT_SUCCESS,
+      [
+        ACTION_CREATE, APP_NAME,
+        ARG_TEMPLATE, APP_TEMPLATE, ARG_RESOURCES, APP_RESOURCE,
+        ARG_METAINFO, APP_METAINFO
+      ])
+    ensureApplicationIsUp(APP_NAME)
+
+    expectLiveContainerCountReached(APP_NAME, DATE_LOGGER, 1,
+      CONTAINER_LAUNCH_TIMEOUT)
+    status(0, APP_NAME)
+
+    SliderShell shell = slider(EXIT_SUCCESS,
+      [
+        ACTION_CLIENT, ARG_INSTALL,
+        ARG_DEST, CLIENT_INSTALL_DIR,
+        ARG_NAME, APP_NAME
+      ])
+    logShell(shell)
+
+    for (Map.Entry<String, String> entry : files.entrySet()) {
+      String name = entry.getKey();
+      File file = new File(CLIENT_INSTALL_DIR + "/" + name)
+      assert file.exists()
+      String contents = file.text.replaceAll("(\\r|\\n)", "")
+      assert contents.contains(entry.getValue()), "$name didn't contain value"
+    }
+  }
+
+}


[2/2] incubator-slider git commit: SLIDER-1107 add IT for unique component names

Posted by bi...@apache.org.
SLIDER-1107 add IT for unique component names


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

Branch: refs/heads/feature/SLIDER-1107_AM_config_generation
Commit: 106d96c711c22fa54c518d28e3dcf1b6dac1c40e
Parents: e2ad57b
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Tue May 31 08:48:39 2016 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Tue May 31 08:48:39 2016 -0700

----------------------------------------------------------------------
 .../resources_unique_names.json                 |  18 +++
 .../apache/slider/funtest/ResourcePaths.groovy  |   2 +
 .../funtest/misc/UniqueComponentNamesIT.groovy  | 122 +++++++++++++++++++
 3 files changed, 142 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/106d96c7/slider-core/src/test/app_packages/test_command_log/resources_unique_names.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/resources_unique_names.json b/slider-core/src/test/app_packages/test_command_log/resources_unique_names.json
new file mode 100644
index 0000000..46b0629
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_command_log/resources_unique_names.json
@@ -0,0 +1,18 @@
+{
+    "schema": "http://example.org/specification/v2.0.0",
+    "metadata": {
+    },
+    "global": {
+    },
+    "components": {
+        "COMMAND_LOGGER": {
+          "component.unique.names": "true",
+          "yarn.memory": "128",
+          "yarn.role.priority": "1",
+          "yarn.component.instances": "2"
+        },
+        "slider-appmaster": {
+          "yarn.memory": "256"
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/106d96c7/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
index bb5dfb4..c0aa06a 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/ResourcePaths.groovy
@@ -41,4 +41,6 @@ interface ResourcePaths {
   String AM_CONFIG_RESOURCES = "$SLIDER_CORE_APP_PACKAGES/test_am_config/resources.json"
   String AM_CONFIG_META = "$SLIDER_CORE_APP_PACKAGES/test_am_config/metainfo.json"
   String AM_CONFIG_APPCONFIG = "$SLIDER_CORE_APP_PACKAGES/test_am_config/appConfig.json"
+
+  String UNIQUE_COMPONENT_RESOURCES = "$SLIDER_CORE_APP_PACKAGES/test_command_log/resources_unique_names.json"
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/106d96c7/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/UniqueComponentNamesIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/UniqueComponentNamesIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/UniqueComponentNamesIT.groovy
new file mode 100644
index 0000000..110de22
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/misc/UniqueComponentNamesIT.groovy
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.slider.funtest.misc
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.funtest.ResourcePaths
+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.Before
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class UniqueComponentNamesIT extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+  private static String COMMAND_LOGGER = "COMMAND_LOGGER"
+  private static String COMMAND_LOGGER1 = COMMAND_LOGGER + "1"
+  private static String COMMAND_LOGGER2 = COMMAND_LOGGER + "2"
+  private static String COMMAND_LOGGER3 = COMMAND_LOGGER + "3"
+  private static String APPLICATION_NAME = "unique-component-names"
+  private static String APP_RESOURCE = ResourcePaths.UNIQUE_COMPONENT_RESOURCES
+
+  @Before
+  public void prepareCluster() {
+    setupCluster(APPLICATION_NAME)
+  }
+
+  @After
+  public void destroyCluster() {
+    cleanup(APPLICATION_NAME)
+  }
+
+  @Test
+  public void testCreateFlex() throws Throwable {
+    assumeAgentTestsEnabled()
+
+    describe APPLICATION_NAME
+
+    def path = buildClusterPath(APPLICATION_NAME)
+    assert !clusterFS.exists(path)
+
+    File launchReportFile = createTempJsonFile();
+    SliderShell shell = createTemplatedSliderApplication(APPLICATION_NAME,
+        APP_TEMPLATE,
+        APP_RESOURCE,
+        [],
+        launchReportFile)
+    logShell(shell)
+
+    ensureYarnApplicationIsUp(launchReportFile)
+    ensureApplicationIsUp(APPLICATION_NAME)
+
+    ClusterDescription cd = execStatus(APPLICATION_NAME)
+
+    assert 3 == cd.statistics.size()
+    assert cd.statistics.keySet().containsAll([SliderKeys.COMPONENT_AM, COMMAND_LOGGER1, COMMAND_LOGGER2])
+
+    slider(EXIT_SUCCESS,
+        [
+            ACTION_FLEX,
+            APPLICATION_NAME,
+            ARG_COMPONENT,
+            COMMAND_LOGGER,
+            "3"
+        ])
+
+    sleep(1000 * 10)
+
+    status(0, APPLICATION_NAME)
+    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER3, 1,
+        CONTAINER_LAUNCH_TIMEOUT)
+    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER2, 1,
+      CONTAINER_LAUNCH_TIMEOUT)
+    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER1, 1,
+      CONTAINER_LAUNCH_TIMEOUT)
+
+    slider(EXIT_SUCCESS,
+      [
+        ACTION_FLEX,
+        APPLICATION_NAME,
+        ARG_COMPONENT,
+        COMMAND_LOGGER,
+        "1"
+      ])
+
+    sleep(1000 * 10)
+
+    status(0, APPLICATION_NAME)
+    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER3, 0,
+      CONTAINER_LAUNCH_TIMEOUT)
+    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER2, 0,
+      CONTAINER_LAUNCH_TIMEOUT)
+    expectLiveContainerCountReached(APPLICATION_NAME, COMMAND_LOGGER1, 1,
+      CONTAINER_LAUNCH_TIMEOUT)
+  }
+
+}