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 2014/07/17 02:23:46 UTC
[3/7] git commit: SLIDER-241 rename Tests to ITs
SLIDER-241 rename Tests to ITs
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/e1258c8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/e1258c8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/e1258c8a
Branch: refs/heads/develop
Commit: e1258c8a220f68f63274242d89805bc6ef8abc01
Parents: 5709850
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Wed Jul 16 13:26:46 2014 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Wed Jul 16 13:26:46 2014 -0700
----------------------------------------------------------------------
.../slider/funtest/basic/BuildSetupIT.groovy | 36 +++
.../funtest/basic/ClusterConnectivityIT.groovy | 104 +++++++++
.../funtest/basic/SignCorrectionIT.groovy | 43 ++++
.../slider/funtest/basic/TestBuildSetup.groovy | 36 ---
.../basic/TestClusterConnectivity.groovy | 109 ---------
.../funtest/basic/TestSignCorrection.groovy | 43 ----
.../funtest/commands/ListCommandIT.groovy | 36 +++
.../funtest/commands/SimpleCommandsIT.groovy | 45 ++++
.../funtest/commands/TestListCommand.groovy | 41 ----
.../funtest/commands/TestSimpleCommands.groovy | 45 ----
.../TestUnknownClusterOperations.groovy | 105 ---------
.../commands/UnknownClusterOperationsIT.groovy | 100 +++++++++
.../lifecycle/AgentClusterLifecycleIT.groovy | 192 ++++++++++++++++
.../funtest/lifecycle/AgentFailures2IT.groovy | 104 +++++++++
.../funtest/lifecycle/AgentFailuresIT.groovy | 104 +++++++++
.../funtest/lifecycle/AppsThroughAgentIT.groovy | 84 +++++++
.../lifecycle/ClusterBuildDestroyIT.groovy | 82 +++++++
.../lifecycle/TestAgentClusterLifecycle.groovy | 192 ----------------
.../funtest/lifecycle/TestAgentFailures.groovy | 104 ---------
.../funtest/lifecycle/TestAgentFailures2.groovy | 104 ---------
.../lifecycle/TestAppsThroughAgent.groovy | 84 -------
.../lifecycle/TestClusterBuildDestroy.groovy | 82 -------
.../funtest/AccumuloBuildSetupIT.groovy | 37 +++
.../accumulo/funtest/AccumuloCIIT.groovy | 115 ++++++++++
.../funtest/FunctionalAccumuloClusterIT.groovy | 146 ++++++++++++
.../FunctionalAccumuloM1T1GC1Mon1IT.groovy | 59 +++++
.../funtest/TestAccumuloBuildSetup.groovy | 38 ----
.../accumulo/funtest/TestAccumuloCI.groovy | 115 ----------
.../TestFunctionalAccumuloCluster.groovy | 146 ------------
.../TestFunctionalAccumuloM1T1GC1Mon1.groovy | 59 -----
.../funtest/FunctionalHBaseClusterIT.groovy | 223 +++++++++++++++++++
.../hbase/funtest/HBaseBuildSetupIT.groovy | 36 +++
.../funtest/HBaseClusterBuildDestroyIT.groovy | 87 ++++++++
.../funtest/HBaseClusterLifecycleIT.groovy | 183 +++++++++++++++
.../hbase/funtest/HBaseIntegrationIT.groovy | 69 ++++++
.../providers/hbase/funtest/HBaseLoadIT.groovy | 64 ++++++
.../hbase/funtest/HBaseNodeFailureIT.groovy | 135 +++++++++++
.../providers/hbase/funtest/ImagesIT.groovy | 65 ++++++
.../funtest/TestFunctionalHBaseCluster.groovy | 223 -------------------
.../hbase/funtest/TestHBaseBuildSetup.groovy | 37 ---
.../funtest/TestHBaseClusterBuildDestroy.groovy | 88 --------
.../funtest/TestHBaseClusterLifecycle.groovy | 183 ---------------
.../hbase/funtest/TestHBaseIntegration.groovy | 69 ------
.../hbase/funtest/TestHBaseLoad.groovy | 64 ------
.../hbase/funtest/TestHBaseNodeFailure.groovy | 135 -----------
.../providers/hbase/funtest/TestImages.groovy | 65 ------
46 files changed, 2149 insertions(+), 2167 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/BuildSetupIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/BuildSetupIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/BuildSetupIT.groovy
new file mode 100644
index 0000000..c8fdb97
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/BuildSetupIT.groovy
@@ -0,0 +1,36 @@
+/*
+ * 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.basic
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.funtest.abstracttests.AbstractTestBuildSetup
+
+/**
+ * Simple tests to verify that the build has been set up: if these
+ * fail then the arguments to the test run are incomplete.
+ *
+ * This deliberately doesn't depend on CommandTestBase,
+ * so that individual tests fail with more diagnostics
+ * than the @BeforeClass failing
+ */
+@CompileStatic
+@Slf4j
+class BuildSetupIT extends AbstractTestBuildSetup {
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ClusterConnectivityIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ClusterConnectivityIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ClusterConnectivityIT.groovy
new file mode 100644
index 0000000..9b8fe6f
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ClusterConnectivityIT.groovy
@@ -0,0 +1,104 @@
+/*
+ * 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.basic
+
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.fs.Path
+import org.apache.hadoop.net.NetUtils
+import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.client.SliderYarnClientImpl
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.core.zk.ZookeeperUtils
+import org.apache.slider.funtest.framework.CommandTestBase
+import org.junit.BeforeClass
+import org.junit.Test
+
+@Slf4j
+/**
+ * Test basic connectivity with the target cluster, including
+ * HDFS, YARN and ZK
+ */
+class ClusterConnectivityIT extends CommandTestBase {
+
+
+ public static final int CONNECT_TIMEOUT = 2000
+
+ @Test
+ public void testFileSystemUp() throws Throwable {
+
+ def fs = clusterFS
+ def status = fs.listStatus(new Path("/"))
+ status.each {
+ log.info("${it.path} = ${it}")
+ }
+
+ }
+
+ @Test
+ public void testZKBinding() throws Throwable {
+ def quorum = SLIDER_CONFIG.getTrimmed(SliderXmlConfKeys.REGISTRY_ZK_QUORUM)
+ assert quorum
+ def tuples = ZookeeperUtils.splitToHostsAndPortsStrictly(quorum);
+ tuples.each {
+ telnet(it.hostText, it.port)
+ }
+
+ }
+
+ @Test
+ public void testRMTelnet() throws Throwable {
+ def rmAddr = SLIDER_CONFIG.getSocketAddr(YarnConfiguration.RM_ADDRESS, "", 0)
+ telnet(rmAddr.hostName, rmAddr.port)
+ }
+
+ @Test
+ public void testRMBinding() throws Throwable {
+ testRMTelnet()
+ SliderYarnClientImpl yarnClient = new SliderYarnClientImpl()
+ try {
+ SLIDER_CONFIG.setInt("ipc.client.connect.retry.interval",100)
+ SLIDER_CONFIG.setInt(
+ YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS,5000)
+ SLIDER_CONFIG.setInt(
+ YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS,50)
+
+ yarnClient.init(SLIDER_CONFIG)
+ yarnClient.start();
+ def instances = yarnClient.listInstances("")
+ instances.each {it -> log.info("Instance $it.applicationId")}
+ } finally {
+ yarnClient.stop()
+ }
+ }
+
+ def telnet(String host, int port) {
+ assert host != ""
+ assert port != 0
+ try {
+ def socket = new Socket();
+ def addr = new InetSocketAddress(host, port)
+ socket.connect(addr, CONNECT_TIMEOUT)
+ socket.close()
+ } catch (IOException e) {
+ throw NetUtils.wrapException(host, port, "localhost", 0, e)
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/SignCorrectionIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/SignCorrectionIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/SignCorrectionIT.groovy
new file mode 100644
index 0000000..eee75a8
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/SignCorrectionIT.groovy
@@ -0,0 +1,43 @@
+/*
+ * 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.basic
+
+import org.junit.Test
+
+import static org.apache.slider.funtest.framework.SliderShell.signCorrect
+
+/**
+ * This just verifies the two's complement sign correction that will
+ * be applied after the return code is picked up from the shell
+ */
+class SignCorrectionIT {
+
+ @Test
+ public void test255ToMinus1() throws Throwable {
+ assert -1 == signCorrect(255)
+ }
+ @Test
+ public void test74To74() throws Throwable {
+ assert 74 == signCorrect(74)
+ }
+ @Test
+ public void test1To1() throws Throwable {
+ assert 1 == signCorrect(1)
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestBuildSetup.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestBuildSetup.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestBuildSetup.groovy
deleted file mode 100644
index b6f9a12..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestBuildSetup.groovy
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.basic
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.funtest.abstracttests.AbstractTestBuildSetup
-
-/**
- * Simple tests to verify that the build has been set up: if these
- * fail then the arguments to the test run are incomplete.
- *
- * This deliberately doesn't depend on CommandTestBase,
- * so that individual tests fail with more diagnostics
- * than the @BeforeClass failing
- */
-@CompileStatic
-@Slf4j
-class TestBuildSetup extends AbstractTestBuildSetup {
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
deleted file mode 100644
index b9d768a..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.basic
-
-import groovy.util.logging.Slf4j
-import org.apache.hadoop.fs.Path
-import org.apache.hadoop.net.NetUtils
-import org.apache.hadoop.yarn.conf.YarnConfiguration
-import org.apache.slider.client.SliderYarnClientImpl
-import org.apache.slider.common.SliderXmlConfKeys
-import org.apache.slider.core.zk.ZookeeperUtils
-import org.apache.slider.funtest.framework.CommandTestBase
-import org.junit.BeforeClass
-import org.junit.Test
-
-@Slf4j
-/**
- * Test basic connectivity with the target cluster, including
- * HDFS, YARN and ZK
- */
-class TestClusterConnectivity extends CommandTestBase {
-
-
- public static final int CONNECT_TIMEOUT = 2000
-
- @BeforeClass
- public static void setup() {
- assumeFunctionalTestsEnabled()
- }
-
- @Test
- public void testFileSystemUp() throws Throwable {
-
- def fs = clusterFS
- def status = fs.listStatus(new Path("/"))
- status.each {
- log.info("${it.path} = ${it}")
- }
-
- }
-
- @Test
- public void testZKBinding() throws Throwable {
- def quorum = SLIDER_CONFIG.getTrimmed(SliderXmlConfKeys.REGISTRY_ZK_QUORUM)
- assert quorum
- def tuples = ZookeeperUtils.splitToHostsAndPortsStrictly(quorum);
- tuples.each {
- telnet(it.hostText, it.port)
- }
-
- }
-
- @Test
- public void testRMTelnet() throws Throwable {
- def rmAddr = SLIDER_CONFIG.getSocketAddr(YarnConfiguration.RM_ADDRESS, "", 0)
- telnet(rmAddr.hostName, rmAddr.port)
- }
-
- @Test
- public void testRMBinding() throws Throwable {
- testRMTelnet()
- SliderYarnClientImpl yarnClient = new SliderYarnClientImpl()
- try {
- SLIDER_CONFIG.setInt("ipc.client.connect.retry.interval",100)
- SLIDER_CONFIG.setInt(
- YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS,5000)
- SLIDER_CONFIG.setInt(
- YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS,50)
-
- yarnClient.init(SLIDER_CONFIG)
- yarnClient.start();
- def instances = yarnClient.listInstances("")
- instances.each {it -> log.info("Instance $it.applicationId")}
- } finally {
- yarnClient.stop()
- }
- }
-
- def telnet(String host, int port) {
- assert host != ""
- assert port != 0
- try {
- def socket = new Socket();
- def addr = new InetSocketAddress(host, port)
- socket.connect(addr, CONNECT_TIMEOUT)
- socket.close()
- } catch (IOException e) {
- throw NetUtils.wrapException(host, port, "localhost", 0, e)
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestSignCorrection.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestSignCorrection.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestSignCorrection.groovy
deleted file mode 100644
index 7feb11d..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestSignCorrection.groovy
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.basic
-
-import org.junit.Test
-
-import static org.apache.slider.funtest.framework.SliderShell.signCorrect
-
-/**
- * This just verifies the two's complement sign correction that will
- * be applied after the return code is picked up from the shell
- */
-class TestSignCorrection {
-
- @Test
- public void test255ToMinus1() throws Throwable {
- assert -1 == signCorrect(255)
- }
- @Test
- public void test74To74() throws Throwable {
- assert 74 == signCorrect(74)
- }
- @Test
- public void test1To1() throws Throwable {
- assert 1 == signCorrect(1)
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/ListCommandIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/ListCommandIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/ListCommandIT.groovy
new file mode 100644
index 0000000..20bac88
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/ListCommandIT.groovy
@@ -0,0 +1,36 @@
+/*
+ * 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.commands
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.funtest.framework.CommandTestBase
+import org.junit.BeforeClass
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class ListCommandIT extends CommandTestBase {
+
+ @Test
+ public void testListAll() throws Throwable {
+ assertSuccess(list(null))
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/SimpleCommandsIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/SimpleCommandsIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/SimpleCommandsIT.groovy
new file mode 100644
index 0000000..bf742c9
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/SimpleCommandsIT.groovy
@@ -0,0 +1,45 @@
+/*
+ * 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.commands
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.bigtop.itest.shell.Shell
+import org.apache.slider.funtest.framework.CommandTestBase
+import org.apache.slider.funtest.framework.SliderShell
+import org.apache.slider.common.params.SliderActions
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class SimpleCommandsIT extends CommandTestBase {
+
+ @Test
+ public void testVersion() throws Throwable {
+ Shell shell = slider([SliderActions.ACTION_VERSION])
+ assertSuccess(shell)
+ }
+
+ @Test
+ public void testUsage() throws Throwable {
+ SliderShell shell = slider(0, [SliderActions.ACTION_USAGE])
+ assertSuccess(shell)
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestListCommand.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestListCommand.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestListCommand.groovy
deleted file mode 100644
index ce7b497..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestListCommand.groovy
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.commands
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.funtest.framework.CommandTestBase
-import org.junit.BeforeClass
-import org.junit.Test
-
-@CompileStatic
-@Slf4j
-public class TestListCommand extends CommandTestBase {
-
- @BeforeClass
- public static void prepareCluster() {
- assumeFunctionalTestsEnabled();
- }
-
- @Test
- public void testListAll() throws Throwable {
- assertSuccess(list(null))
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestSimpleCommands.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestSimpleCommands.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestSimpleCommands.groovy
deleted file mode 100644
index 2d00130..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestSimpleCommands.groovy
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.commands
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.bigtop.itest.shell.Shell
-import org.apache.slider.funtest.framework.CommandTestBase
-import org.apache.slider.funtest.framework.SliderShell
-import org.apache.slider.common.params.SliderActions
-import org.junit.Test
-
-@CompileStatic
-@Slf4j
-public class TestSimpleCommands extends CommandTestBase {
-
- @Test
- public void testVersion() throws Throwable {
- Shell shell = slider([SliderActions.ACTION_VERSION])
- assertSuccess(shell)
- }
-
- @Test
- public void testUsage() throws Throwable {
- SliderShell shell = slider(0, [SliderActions.ACTION_USAGE])
- assertSuccess(shell)
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestUnknownClusterOperations.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestUnknownClusterOperations.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestUnknownClusterOperations.groovy
deleted file mode 100644
index 7791c3c..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/TestUnknownClusterOperations.groovy
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.commands
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.funtest.categories.FunctionalTests
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-import org.apache.slider.funtest.framework.CommandTestBase
-import org.apache.slider.funtest.framework.SliderShell
-import org.junit.BeforeClass
-import org.junit.Test
-
-/**
- * Test the return code from ops against unknown clusters are what we expect
- */
-@CompileStatic
-@Slf4j
-@org.junit.experimental.categories.Category(FunctionalTests)
-public class TestUnknownClusterOperations extends CommandTestBase {
-
- public static final String UNKNOWN = "unknown_cluster"
-
- @BeforeClass
- public static void prepareCluster() {
- assumeFunctionalTestsEnabled();
- }
-
- @Test
- public void testFreezeUnknownCluster() throws Throwable {
- SliderShell shell = freeze(UNKNOWN)
- assertUnknownCluster(shell)
- }
-
- @Test
- public void testFreezeUnknownClusterWithMessage() throws Throwable {
- slider(SliderExitCodes.EXIT_UNKNOWN_INSTANCE,
- [
- SliderActions.ACTION_FREEZE, UNKNOWN,
- Arguments.ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
- Arguments.ARG_MESSAGE, "testFreezeUnknownClusterWithMessage"
- ])
- }
-
- @Test
- public void testFreezeForceUnknownCluster() throws Throwable {
- SliderShell shell = freezeForce(UNKNOWN)
- assertUnknownCluster(shell)
- }
-
- @Test
- public void testDestroyUnknownCluster() throws Throwable {
- SliderShell shell = destroy(UNKNOWN)
- assertSuccess(shell)
- }
-
- @Test
- public void testListUnknownCluster() throws Throwable {
- assertUnknownCluster(list(UNKNOWN))
- }
-
- @Test
- public void testExistsUnknownCluster() throws Throwable {
- assertUnknownCluster(exists(UNKNOWN, false))
- }
-
- @Test
- public void testExistsLiveUnknownCluster() throws Throwable {
- assertUnknownCluster(exists(UNKNOWN, true))
- }
-
- @Test
- public void testThawUnknownCluster() throws Throwable {
- assertUnknownCluster(thaw(UNKNOWN))
- }
-
- @Test
- public void testStatusUnknownCluster() throws Throwable {
- assertUnknownCluster(status(UNKNOWN))
- }
-
- @Test
- public void testGetConfUnknownCluster() throws Throwable {
- assertUnknownCluster(getConf(UNKNOWN))
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/UnknownClusterOperationsIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/UnknownClusterOperationsIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/UnknownClusterOperationsIT.groovy
new file mode 100644
index 0000000..39ae4dd
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/commands/UnknownClusterOperationsIT.groovy
@@ -0,0 +1,100 @@
+/*
+ * 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.commands
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.funtest.categories.FunctionalTests
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.funtest.framework.CommandTestBase
+import org.apache.slider.funtest.framework.SliderShell
+import org.junit.BeforeClass
+import org.junit.Test
+
+/**
+ * Test the return code from ops against unknown clusters are what we expect
+ */
+@CompileStatic
+@Slf4j
+@org.junit.experimental.categories.Category(FunctionalTests)
+public class UnknownClusterOperationsIT extends CommandTestBase {
+
+ public static final String UNKNOWN = "unknown_cluster"
+
+ @Test
+ public void testFreezeUnknownCluster() throws Throwable {
+ SliderShell shell = freeze(UNKNOWN)
+ assertUnknownCluster(shell)
+ }
+
+ @Test
+ public void testFreezeUnknownClusterWithMessage() throws Throwable {
+ slider(SliderExitCodes.EXIT_UNKNOWN_INSTANCE,
+ [
+ SliderActions.ACTION_FREEZE, UNKNOWN,
+ Arguments.ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
+ Arguments.ARG_MESSAGE, "testFreezeUnknownClusterWithMessage"
+ ])
+ }
+
+ @Test
+ public void testFreezeForceUnknownCluster() throws Throwable {
+ SliderShell shell = freezeForce(UNKNOWN)
+ assertUnknownCluster(shell)
+ }
+
+ @Test
+ public void testDestroyUnknownCluster() throws Throwable {
+ SliderShell shell = destroy(UNKNOWN)
+ assertSuccess(shell)
+ }
+
+ @Test
+ public void testListUnknownCluster() throws Throwable {
+ assertUnknownCluster(list(UNKNOWN))
+ }
+
+ @Test
+ public void testExistsUnknownCluster() throws Throwable {
+ assertUnknownCluster(exists(UNKNOWN, false))
+ }
+
+ @Test
+ public void testExistsLiveUnknownCluster() throws Throwable {
+ assertUnknownCluster(exists(UNKNOWN, true))
+ }
+
+ @Test
+ public void testThawUnknownCluster() throws Throwable {
+ assertUnknownCluster(thaw(UNKNOWN))
+ }
+
+ @Test
+ public void testStatusUnknownCluster() throws Throwable {
+ assertUnknownCluster(status(UNKNOWN))
+ }
+
+ @Test
+ public void testGetConfUnknownCluster() throws Throwable {
+ assertUnknownCluster(getConf(UNKNOWN))
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
new file mode 100644
index 0000000..b30d670
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentClusterLifecycleIT.groovy
@@ -0,0 +1,192 @@
+/*
+ * 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.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.api.StatusKeys
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+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 AgentClusterLifecycleIT extends AgentCommandTestBase
+ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+
+ static String CLUSTER = "test_agent_cluster_lifecycle"
+
+ static String APP_RESOURCE2 = "../slider-core/src/test/app_packages/test_command_log/resources_no_role.json"
+
+
+ @Before
+ public void prepareCluster() {
+ setupCluster(CLUSTER)
+ describe("Create a 0-role cluster, so testing AM start/stop")
+ }
+
+ @After
+ public void destroyCluster() {
+ cleanup(CLUSTER)
+ }
+
+ @Test
+ public void testAgentClusterLifecycle() throws Throwable {
+
+ describe "Walk a 0-role cluster through its lifecycle"
+
+
+ def clusterpath = buildClusterPath(CLUSTER)
+ assert !clusterFS.exists(clusterpath)
+
+ SliderShell shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_CREATE, CLUSTER,
+ ARG_IMAGE, agentTarballPath.toString(),
+ ARG_TEMPLATE, APP_TEMPLATE,
+ ARG_RESOURCES, APP_RESOURCE2
+ ])
+
+ logShell(shell)
+
+ ensureApplicationIsUp(CLUSTER)
+
+ //at this point the cluster should exist.
+ assertPathExists(clusterFS, "Cluster parent directory does not exist", clusterpath.parent)
+
+ assertPathExists(clusterFS, "Cluster directory does not exist", clusterpath)
+
+ // assert it exists on the command line
+ exists(0, CLUSTER)
+
+ //destroy will fail in use
+ destroy(EXIT_APPLICATION_IN_USE, CLUSTER)
+
+ //thaw will fail as cluster is in use
+ thaw(EXIT_APPLICATION_IN_USE, CLUSTER)
+
+ //it's still there
+ exists(0, CLUSTER)
+
+ //listing the cluster will succeed
+ list(0, CLUSTER)
+
+ //simple status
+ status(0, CLUSTER)
+
+ //now status to a temp file
+ File jsonStatus = File.createTempFile("tempfile", ".json")
+ try {
+ slider(0,
+ [
+ SliderActions.ACTION_STATUS, CLUSTER,
+ ARG_OUTPUT, jsonStatus.canonicalPath
+ ])
+
+ assert jsonStatus.exists()
+ ClusterDescription cd = ClusterDescription.fromFile(jsonStatus)
+
+ assert CLUSTER == cd.name
+
+ log.info(cd.toJsonString())
+
+ getConf(0, CLUSTER)
+
+ //get a slider client against the cluster
+ SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, CLUSTER)
+ ClusterDescription cd2 = sliderClient.clusterDescription
+ assert CLUSTER == cd2.name
+
+ log.info("Connected via Client {}", sliderClient.toString())
+
+ //freeze
+ freeze(CLUSTER, [
+ ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
+ ARG_MESSAGE, "freeze-in-test-cluster-lifecycle"
+ ])
+ describe " >>> Cluster is now frozen."
+
+ //cluster exists if you don't want it to be live
+ exists(0, CLUSTER, false)
+ //condition returns false if it is required to be live
+ exists(EXIT_FALSE, CLUSTER, true)
+
+ //thaw then freeze the cluster
+ thaw(CLUSTER,
+ [
+ ARG_WAIT, Integer.toString(THAW_WAIT_TIME),
+ ])
+ exists(0, CLUSTER)
+ describe " >>> Cluster is now thawed."
+
+ freeze(CLUSTER,
+ [
+ ARG_FORCE,
+ ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
+ ARG_MESSAGE, "forced-freeze-in-test"
+ ])
+
+ describe " >>> Cluster is now frozen - 2nd time."
+
+ //cluster is no longer live
+ exists(0, CLUSTER, false)
+
+ //condition returns false if it is required to be live
+ exists(EXIT_FALSE, CLUSTER, true)
+
+ //thaw with a restart count set to enable restart
+ describe "the kill/restart phase may fail if yarn.resourcemanager.am.max-attempts is too low"
+ thaw(CLUSTER,
+ [
+ ARG_WAIT, Integer.toString(THAW_WAIT_TIME),
+ ARG_DEFINE, SliderXmlConfKeys.KEY_AM_RESTART_LIMIT + "=3"
+ ])
+
+ describe " >>> Cluster is now thawed - 2nd time."
+
+ ClusterDescription status = killAmAndWaitForRestart(sliderClient, CLUSTER)
+
+ describe " >>> Kill AM and wait for restart."
+
+ def restarted = status.getInfo(
+ StatusKeys.INFO_CONTAINERS_AM_RESTART)
+ assert restarted != null
+ assert Integer.parseInt(restarted) == 0
+ freeze(CLUSTER)
+
+ destroy(0, CLUSTER)
+
+ //cluster now missing
+ exists(EXIT_UNKNOWN_INSTANCE, CLUSTER)
+
+ } finally {
+ jsonStatus.delete()
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
new file mode 100644
index 0000000..0ba48ba
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailures2IT.groovy
@@ -0,0 +1,104 @@
+/*
+ * 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.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+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.Test
+
+@CompileStatic
+@Slf4j
+public class AgentFailures2IT extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+ private static String COMMAND_LOGGER = "COMMAND_LOGGER"
+ private static String APPLICATION_NAME = "two-container-fail-heartbeat"
+ private static String APP_TEMPLATE3 =
+ "../slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json"
+
+
+ @After
+ public void destroyCluster() {
+ cleanup(APPLICATION_NAME)
+ }
+
+ @Test
+ public void testAgentFailHeartbeatingTwiceOnce() throws Throwable {
+ if (!AGENTTESTS_ENABLED) {
+ log.info "TESTS are not run."
+ return
+ }
+
+ cleanup(APPLICATION_NAME)
+ SliderShell shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_CREATE, APPLICATION_NAME,
+ ARG_IMAGE, agentTarballPath.toString(),
+ ARG_TEMPLATE, APP_TEMPLATE3,
+ ARG_RESOURCES, APP_RESOURCE
+ ])
+
+ logShell(shell)
+
+ ensureApplicationIsUp(APPLICATION_NAME)
+
+ repeatUntilTrue(this.&hasContainerCountExceeded, 20, 1000 * 10, ['arg1': '3']);
+
+ sleep(1000 * 20)
+
+ shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_STATUS,
+ APPLICATION_NAME])
+
+ assertComponentCount(COMMAND_LOGGER, 1, shell)
+ String requested = findLineEntryValue(shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+ assert requested != null && requested.isInteger() && requested.toInteger() >= 3,
+ 'At least 2 containers must be requested'
+
+ assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
+
+ assertSuccess(shell)
+ }
+
+
+ boolean hasContainerCountExceeded(Map<String, String> args) {
+ int expectedCount = args['arg1'].toInteger();
+ SliderShell shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_STATUS,
+ APPLICATION_NAME])
+
+ //logShell(shell)
+ String requested = findLineEntryValue(
+ shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+ if (requested != null && requested.isInteger() && requested.toInteger() >= expectedCount) {
+ return true
+ }
+
+ return false
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
new file mode 100644
index 0000000..a51c769
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentFailuresIT.groovy
@@ -0,0 +1,104 @@
+/*
+ * 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.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+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.Test
+
+@CompileStatic
+@Slf4j
+public class AgentFailuresIT extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+ private static String COMMAND_LOGGER = "COMMAND_LOGGER"
+ private static String APPLICATION_NAME = "one-container-fail-register"
+ private static String APP_TEMPLATE2 =
+ "../slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json"
+
+
+ @After
+ public void destroyCluster() {
+ cleanup(APPLICATION_NAME)
+ }
+
+ @Test
+ public void testAgentFailRegistrationOnce() throws Throwable {
+ if (!AGENTTESTS_ENABLED) {
+ log.info "TESTS are not run."
+ return
+ }
+
+ cleanup(APPLICATION_NAME)
+ SliderShell shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_CREATE, APPLICATION_NAME,
+ ARG_IMAGE, agentTarballPath.toString(),
+ ARG_TEMPLATE, APP_TEMPLATE2,
+ ARG_RESOURCES, APP_RESOURCE
+ ])
+
+ logShell(shell)
+
+ ensureApplicationIsUp(APPLICATION_NAME)
+
+ repeatUntilTrue(this.&hasContainerCountExceeded, 15, 1000 * 10, ['arg1': '2']);
+
+ sleep(1000 * 20)
+
+ shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_STATUS,
+ APPLICATION_NAME])
+
+ assertComponentCount(COMMAND_LOGGER, 1, shell)
+ String requested = findLineEntryValue(shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+ assert requested != null && requested.isInteger() && requested.toInteger() >= 2,
+ 'At least 2 containers must be requested'
+
+ assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
+
+ assertSuccess(shell)
+ }
+
+
+ boolean hasContainerCountExceeded(Map<String, String> args) {
+ int expectedCount = args['arg1'].toInteger();
+ SliderShell shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_STATUS,
+ APPLICATION_NAME])
+
+ //logShell(shell)
+ String requested = findLineEntryValue(
+ shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+ if (requested != null && requested.isInteger() && requested.toInteger() >= expectedCount) {
+ return true
+ }
+
+ return false
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
new file mode 100644
index 0000000..00a876a
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AppsThroughAgentIT.groovy
@@ -0,0 +1,84 @@
+/*
+ * 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.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+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.Test
+
+@CompileStatic
+@Slf4j
+public class AppsThroughAgentIT extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+ private static String COMMAND_LOGGER = "COMMAND_LOGGER"
+ private static String APPLICATION_NAME = "happy-path-with-flex"
+
+ @After
+ public void destroyCluster() {
+ cleanup(APPLICATION_NAME)
+ }
+
+ @Test
+ public void testCreateFlex() throws Throwable {
+ assumeAgentTestsEnabled()
+
+ cleanup(APPLICATION_NAME)
+ SliderShell shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_CREATE, APPLICATION_NAME,
+ ARG_IMAGE, agentTarballPath.toString(),
+ ARG_TEMPLATE, APP_TEMPLATE,
+ ARG_RESOURCES, APP_RESOURCE
+ ])
+
+ logShell(shell)
+
+ ensureApplicationIsUp(APPLICATION_NAME)
+
+ //flex
+ slider(EXIT_SUCCESS,
+ [
+ ACTION_FLEX,
+ APPLICATION_NAME,
+ ARG_COMPONENT,
+ COMMAND_LOGGER,
+ "2"])
+
+ // sleep till the new instance starts
+ sleep(1000 * 10)
+
+ shell = slider(EXIT_SUCCESS,
+ [
+ ACTION_STATUS,
+ APPLICATION_NAME])
+
+ assertComponentCount(COMMAND_LOGGER, 2, shell)
+
+ assertSuccess(shell)
+ assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/ClusterBuildDestroyIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/ClusterBuildDestroyIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/ClusterBuildDestroyIT.groovy
new file mode 100644
index 0000000..f8caac5
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/ClusterBuildDestroyIT.groovy
@@ -0,0 +1,82 @@
+/*
+ * 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.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.fs.Path
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.SliderKeys
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.funtest.framework.AgentCommandTestBase
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.junit.AfterClass
+import org.junit.BeforeClass
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class ClusterBuildDestroyIT extends AgentCommandTestBase
+ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+
+ static String CLUSTER = "test_cluster_build_destroy"
+
+
+ @BeforeClass
+ public static void prepareCluster() {
+
+ setupCluster(CLUSTER)
+ }
+
+ @AfterClass
+ public static void destroyCluster() {
+ teardown(CLUSTER)
+ }
+
+ @Test
+ public void testBuildAndDestroyCluster() throws Throwable {
+ def clusterDir = SliderKeys.SLIDER_BASE_DIRECTORY + "/cluster/$CLUSTER"
+ def clusterDirPath = new Path(clusterFS.homeDirectory, clusterDir)
+ clusterFS.delete(clusterDirPath, true)
+ slider(EXIT_SUCCESS,
+ [
+ ACTION_BUILD,
+ CLUSTER,
+ ARG_IMAGE, agentTarballPath.toString(),
+ ARG_ZKHOSTS,
+ SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, DEFAULT_SLIDER_ZK_HOSTS),
+ ARG_TEMPLATE, APP_TEMPLATE,
+ ARG_RESOURCES, APP_RESOURCE
+ ])
+
+
+ assert clusterFS.exists(clusterDirPath)
+ //cluster exists if you don't want it to be live
+ exists(EXIT_SUCCESS, CLUSTER, false)
+ // condition returns false if it is required to be live
+ exists(EXIT_FALSE, CLUSTER, true)
+ destroy(CLUSTER)
+
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
deleted file mode 100644
index 0d643ca..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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.lifecycle
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.api.StatusKeys
-import org.apache.slider.client.SliderClient
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.common.SliderXmlConfKeys
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-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 TestAgentClusterLifecycle extends AgentCommandTestBase
- implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
-
-
- static String CLUSTER = "test_agent_cluster_lifecycle"
-
- static String APP_RESOURCE2 = "../slider-core/src/test/app_packages/test_command_log/resources_no_role.json"
-
-
- @Before
- public void prepareCluster() {
- setupCluster(CLUSTER)
- describe("Create a 0-role cluster, so testing AM start/stop")
- }
-
- @After
- public void destroyCluster() {
- cleanup(CLUSTER)
- }
-
- @Test
- public void testAgentClusterLifecycle() throws Throwable {
-
- describe "Walk a 0-role cluster through its lifecycle"
-
-
- def clusterpath = buildClusterPath(CLUSTER)
- assert !clusterFS.exists(clusterpath)
-
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_CREATE, CLUSTER,
- ARG_IMAGE, agentTarballPath.toString(),
- ARG_TEMPLATE, APP_TEMPLATE,
- ARG_RESOURCES, APP_RESOURCE2
- ])
-
- logShell(shell)
-
- ensureApplicationIsUp(CLUSTER)
-
- //at this point the cluster should exist.
- assertPathExists(clusterFS, "Cluster parent directory does not exist", clusterpath.parent)
-
- assertPathExists(clusterFS, "Cluster directory does not exist", clusterpath)
-
- // assert it exists on the command line
- exists(0, CLUSTER)
-
- //destroy will fail in use
- destroy(EXIT_APPLICATION_IN_USE, CLUSTER)
-
- //thaw will fail as cluster is in use
- thaw(EXIT_APPLICATION_IN_USE, CLUSTER)
-
- //it's still there
- exists(0, CLUSTER)
-
- //listing the cluster will succeed
- list(0, CLUSTER)
-
- //simple status
- status(0, CLUSTER)
-
- //now status to a temp file
- File jsonStatus = File.createTempFile("tempfile", ".json")
- try {
- slider(0,
- [
- SliderActions.ACTION_STATUS, CLUSTER,
- ARG_OUTPUT, jsonStatus.canonicalPath
- ])
-
- assert jsonStatus.exists()
- ClusterDescription cd = ClusterDescription.fromFile(jsonStatus)
-
- assert CLUSTER == cd.name
-
- log.info(cd.toJsonString())
-
- getConf(0, CLUSTER)
-
- //get a slider client against the cluster
- SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, CLUSTER)
- ClusterDescription cd2 = sliderClient.clusterDescription
- assert CLUSTER == cd2.name
-
- log.info("Connected via Client {}", sliderClient.toString())
-
- //freeze
- freeze(CLUSTER, [
- ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
- ARG_MESSAGE, "freeze-in-test-cluster-lifecycle"
- ])
- describe " >>> Cluster is now frozen."
-
- //cluster exists if you don't want it to be live
- exists(0, CLUSTER, false)
- //condition returns false if it is required to be live
- exists(EXIT_FALSE, CLUSTER, true)
-
- //thaw then freeze the cluster
- thaw(CLUSTER,
- [
- ARG_WAIT, Integer.toString(THAW_WAIT_TIME),
- ])
- exists(0, CLUSTER)
- describe " >>> Cluster is now thawed."
-
- freeze(CLUSTER,
- [
- ARG_FORCE,
- ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
- ARG_MESSAGE, "forced-freeze-in-test"
- ])
-
- describe " >>> Cluster is now frozen - 2nd time."
-
- //cluster is no longer live
- exists(0, CLUSTER, false)
-
- //condition returns false if it is required to be live
- exists(EXIT_FALSE, CLUSTER, true)
-
- //thaw with a restart count set to enable restart
- describe "the kill/restart phase may fail if yarn.resourcemanager.am.max-attempts is too low"
- thaw(CLUSTER,
- [
- ARG_WAIT, Integer.toString(THAW_WAIT_TIME),
- ARG_DEFINE, SliderXmlConfKeys.KEY_AM_RESTART_LIMIT + "=3"
- ])
-
- describe " >>> Cluster is now thawed - 2nd time."
-
- ClusterDescription status = killAmAndWaitForRestart(sliderClient, CLUSTER)
-
- describe " >>> Kill AM and wait for restart."
-
- def restarted = status.getInfo(
- StatusKeys.INFO_CONTAINERS_AM_RESTART)
- assert restarted != null
- assert Integer.parseInt(restarted) == 0
- freeze(CLUSTER)
-
- destroy(0, CLUSTER)
-
- //cluster now missing
- exists(EXIT_UNKNOWN_INSTANCE, CLUSTER)
-
- } finally {
- jsonStatus.delete()
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy
deleted file mode 100644
index ea58d5f..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.lifecycle
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-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.Test
-
-@CompileStatic
-@Slf4j
-public class TestAgentFailures extends AgentCommandTestBase
-implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
-
- private static String COMMAND_LOGGER = "COMMAND_LOGGER"
- private static String APPLICATION_NAME = "one-container-fail-register"
- private static String APP_TEMPLATE2 =
- "../slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json"
-
-
- @After
- public void destroyCluster() {
- cleanup(APPLICATION_NAME)
- }
-
- @Test
- public void testAgentFailRegistrationOnce() throws Throwable {
- if (!AGENTTESTS_ENABLED) {
- log.info "TESTS are not run."
- return
- }
-
- cleanup(APPLICATION_NAME)
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_CREATE, APPLICATION_NAME,
- ARG_IMAGE, agentTarballPath.toString(),
- ARG_TEMPLATE, APP_TEMPLATE2,
- ARG_RESOURCES, APP_RESOURCE
- ])
-
- logShell(shell)
-
- ensureApplicationIsUp(APPLICATION_NAME)
-
- repeatUntilTrue(this.&hasContainerCountExceeded, 15, 1000 * 10, ['arg1': '2']);
-
- sleep(1000 * 20)
-
- shell = slider(EXIT_SUCCESS,
- [
- ACTION_STATUS,
- APPLICATION_NAME])
-
- assertComponentCount(COMMAND_LOGGER, 1, shell)
- String requested = findLineEntryValue(shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
- assert requested != null && requested.isInteger() && requested.toInteger() >= 2,
- 'At least 2 containers must be requested'
-
- assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
-
- assertSuccess(shell)
- }
-
-
- boolean hasContainerCountExceeded(Map<String, String> args) {
- int expectedCount = args['arg1'].toInteger();
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_STATUS,
- APPLICATION_NAME])
-
- //logShell(shell)
- String requested = findLineEntryValue(
- shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
- if (requested != null && requested.isInteger() && requested.toInteger() >= expectedCount) {
- return true
- }
-
- return false
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy
deleted file mode 100644
index 7804042..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.lifecycle
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-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.Test
-
-@CompileStatic
-@Slf4j
-public class TestAgentFailures2 extends AgentCommandTestBase
-implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
-
- private static String COMMAND_LOGGER = "COMMAND_LOGGER"
- private static String APPLICATION_NAME = "two-container-fail-heartbeat"
- private static String APP_TEMPLATE3 =
- "../slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json"
-
-
- @After
- public void destroyCluster() {
- cleanup(APPLICATION_NAME)
- }
-
- @Test
- public void testAgentFailHeartbeatingTwiceOnce() throws Throwable {
- if (!AGENTTESTS_ENABLED) {
- log.info "TESTS are not run."
- return
- }
-
- cleanup(APPLICATION_NAME)
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_CREATE, APPLICATION_NAME,
- ARG_IMAGE, agentTarballPath.toString(),
- ARG_TEMPLATE, APP_TEMPLATE3,
- ARG_RESOURCES, APP_RESOURCE
- ])
-
- logShell(shell)
-
- ensureApplicationIsUp(APPLICATION_NAME)
-
- repeatUntilTrue(this.&hasContainerCountExceeded, 20, 1000 * 10, ['arg1': '3']);
-
- sleep(1000 * 20)
-
- shell = slider(EXIT_SUCCESS,
- [
- ACTION_STATUS,
- APPLICATION_NAME])
-
- assertComponentCount(COMMAND_LOGGER, 1, shell)
- String requested = findLineEntryValue(shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
- assert requested != null && requested.isInteger() && requested.toInteger() >= 3,
- 'At least 2 containers must be requested'
-
- assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
-
- assertSuccess(shell)
- }
-
-
- boolean hasContainerCountExceeded(Map<String, String> args) {
- int expectedCount = args['arg1'].toInteger();
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_STATUS,
- APPLICATION_NAME])
-
- //logShell(shell)
- String requested = findLineEntryValue(
- shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
- if (requested != null && requested.isInteger() && requested.toInteger() >= expectedCount) {
- return true
- }
-
- return false
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
deleted file mode 100644
index 6b0f678..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.lifecycle
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-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.Test
-
-@CompileStatic
-@Slf4j
-public class TestAppsThroughAgent extends AgentCommandTestBase
-implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
-
- private static String COMMAND_LOGGER = "COMMAND_LOGGER"
- private static String APPLICATION_NAME = "happy-path-with-flex"
-
- @After
- public void destroyCluster() {
- cleanup(APPLICATION_NAME)
- }
-
- @Test
- public void testCreateFlex() throws Throwable {
- assumeAgentTestsEnabled()
-
- cleanup(APPLICATION_NAME)
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_CREATE, APPLICATION_NAME,
- ARG_IMAGE, agentTarballPath.toString(),
- ARG_TEMPLATE, APP_TEMPLATE,
- ARG_RESOURCES, APP_RESOURCE
- ])
-
- logShell(shell)
-
- ensureApplicationIsUp(APPLICATION_NAME)
-
- //flex
- slider(EXIT_SUCCESS,
- [
- ACTION_FLEX,
- APPLICATION_NAME,
- ARG_COMPONENT,
- COMMAND_LOGGER,
- "2"])
-
- // sleep till the new instance starts
- sleep(1000 * 10)
-
- shell = slider(EXIT_SUCCESS,
- [
- ACTION_STATUS,
- APPLICATION_NAME])
-
- assertComponentCount(COMMAND_LOGGER, 2, shell)
-
- assertSuccess(shell)
- assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
deleted file mode 100644
index ead1601..0000000
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestClusterBuildDestroy.groovy
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.lifecycle
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.hadoop.fs.Path
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.common.SliderKeys
-import org.apache.slider.common.SliderXmlConfKeys
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-import org.apache.slider.funtest.framework.AgentCommandTestBase
-import org.apache.slider.funtest.framework.FuntestProperties
-import org.junit.AfterClass
-import org.junit.BeforeClass
-import org.junit.Test
-
-@CompileStatic
-@Slf4j
-public class TestClusterBuildDestroy extends AgentCommandTestBase
- implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
-
-
- static String CLUSTER = "test_cluster_build_destroy"
-
-
- @BeforeClass
- public static void prepareCluster() {
-
- setupCluster(CLUSTER)
- }
-
- @AfterClass
- public static void destroyCluster() {
- teardown(CLUSTER)
- }
-
- @Test
- public void testBuildAndDestroyCluster() throws Throwable {
- def clusterDir = SliderKeys.SLIDER_BASE_DIRECTORY + "/cluster/$CLUSTER"
- def clusterDirPath = new Path(clusterFS.homeDirectory, clusterDir)
- clusterFS.delete(clusterDirPath, true)
- slider(EXIT_SUCCESS,
- [
- ACTION_BUILD,
- CLUSTER,
- ARG_IMAGE, agentTarballPath.toString(),
- ARG_ZKHOSTS,
- SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, DEFAULT_SLIDER_ZK_HOSTS),
- ARG_TEMPLATE, APP_TEMPLATE,
- ARG_RESOURCES, APP_RESOURCE
- ])
-
-
- assert clusterFS.exists(clusterDirPath)
- //cluster exists if you don't want it to be live
- exists(EXIT_SUCCESS, CLUSTER, false)
- // condition returns false if it is required to be live
- exists(EXIT_FALSE, CLUSTER, true)
- destroy(CLUSTER)
-
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloBuildSetupIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloBuildSetupIT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloBuildSetupIT.groovy
new file mode 100644
index 0000000..109bce9
--- /dev/null
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloBuildSetupIT.groovy
@@ -0,0 +1,37 @@
+/*
+ * 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.providers.accumulo.funtest
+
+import org.apache.hadoop.conf.Configuration
+import org.apache.slider.funtest.abstracttests.AbstractTestBuildSetup
+import org.junit.Test
+
+class AccumuloBuildSetupIT extends AbstractTestBuildSetup {
+
+ @Test
+ public void testAccumuloBuildsHavePathsDefined() throws Throwable {
+ Configuration conf = loadSliderConf();
+
+ assumeBoolOption(conf, KEY_TEST_ACCUMULO_ENABLED, true)
+
+ assertStringOptionSet(conf, KEY_TEST_ACCUMULO_APPCONF)
+ assertStringOptionSet(conf, KEY_TEST_ACCUMULO_TAR)
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCIIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCIIT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCIIT.groovy
new file mode 100644
index 0000000..546c04b
--- /dev/null
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCIIT.groovy
@@ -0,0 +1,115 @@
+/*
+ * 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.providers.accumulo.funtest
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+
+import org.apache.accumulo.core.client.Connector
+import org.apache.accumulo.core.client.ZooKeeperInstance
+import org.apache.accumulo.core.client.security.tokens.PasswordToken
+import org.apache.accumulo.test.continuous.ContinuousIngest
+import org.apache.accumulo.test.continuous.ContinuousVerify
+import org.apache.hadoop.fs.Path
+import org.apache.hadoop.io.Text
+import org.apache.hadoop.util.ToolRunner
+import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.common.SliderXmlConfKeys
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.funtest.framework.CommandTestBase
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.apache.slider.funtest.framework.PortAssignments
+
+/**
+ *
+ */
+@CompileStatic
+@Slf4j
+class AccumuloCIIT extends FunctionalAccumuloClusterIT {
+
+ @Override
+ String getClusterName() {
+ return "test_accumulo_ci"
+ }
+
+ @Override
+ public int getNumTservers() {
+ return 2;
+ }
+
+ @Override
+ public int getMonitorPort() {
+ return PortAssignments._testAccumuloCI;
+ }
+
+ @Override
+ void clusterLoadOperations(
+ String clustername,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+ assert clustername
+
+ String currentUser = System.getProperty("user.name");
+ String zookeepers = SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM,
+ FuntestProperties.DEFAULT_SLIDER_ZK_HOSTS)
+ ZooKeeperInstance inst = new ZooKeeperInstance(currentUser + "-" + clustername, zookeepers)
+ PasswordToken passwd = new PasswordToken(getPassword())
+ Connector conn = inst.getConnector("root", new PasswordToken(getPassword()))
+
+ // Create the test table with some split points
+ String tableName = "testAccumuloCi";
+ conn.tableOperations().create(tableName)
+ TreeSet<Text> splits = new TreeSet<Text>()
+ splits.add(new Text("2"))
+ splits.add(new Text("5"))
+ splits.add(new Text("7"))
+ conn.tableOperations().addSplits(tableName, splits)
+
+ // Write 15M records per tserver -- should take a few minutes
+ String[] ciOpts = ["-i", inst.getInstanceName(),
+ "-z", zookeepers, "-u", "root",
+ "-p", getPassword(), "--table", tableName,
+ "--num", Integer.toString(1000 * 1000 * 15 * getNumTservers()),
+ "--batchMemory", "100000000",
+ "--batchLatency", "600000",
+ "--batchThreads", "1"]
+
+ ContinuousIngest ci = new ContinuousIngest();
+ ci.main(ciOpts);
+
+ // Create a directory for the verify to write its output to
+ Path verifyOutput = new Path("/user/" + currentUser + "/.slider/cluster/" + clustername + "/verify-output")
+ assert !clusterFS.exists(verifyOutput)
+
+ YarnConfiguration verifyConf = new YarnConfiguration(CommandTestBase.SLIDER_CONFIG);
+
+ // Try to load the necessary classes for the Mappers to find them
+ if (loadClassesForMapReduce(verifyConf)) {
+ // If we found those classes, try to run in distributed mode.
+ tryToLoadMapredSite(verifyConf)
+ }
+
+ // Run ContinuousVerify and ensure that no holes exist
+ ContinuousVerify verify = new ContinuousVerify();
+ String[] verifyOpts = ["-i", inst.getInstanceName(),
+ "-z", zookeepers, "-u", "root",
+ "-p", getPassword(), "--table", tableName,
+ "--output", verifyOutput.toString(), "--maxMappers", Integer.toString(2 * getNumTservers()),
+ "--reducers", Integer.toString(getNumTservers())]
+ assert 0 == ToolRunner.run(verifyConf, verify, verifyOpts)
+ }
+}