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:44 UTC
[1/7] SLIDER-241 rename Tests to ITs
Repository: incubator-slider
Updated Branches:
refs/heads/develop 41e34441f -> 8e4310fb9
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestImages.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestImages.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestImages.groovy
deleted file mode 100644
index 128e087..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestImages.groovy
+++ /dev/null
@@ -1,65 +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.providers.hbase.funtest
-
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.fs.FileSystem as HadoopFS
-import org.apache.hadoop.fs.Path
-import org.apache.slider.funtest.framework.CommandTestBase
-import org.apache.slider.funtest.framework.FuntestProperties
-import org.junit.Before
-import org.junit.Test
-
-class TestImages extends CommandTestBase implements FuntestProperties {
-
-
- @Before
- public void verifyPreconditions() {
- assumeBoolOption(SLIDER_CONFIG, KEY_SLIDER_FUNTESTS_ENABLED, true)
- assumeBoolOption(SLIDER_CONFIG, KEY_TEST_HBASE_ENABLED, true)
- }
-
- @Test
- public void testImageExists() throws Throwable {
-
- Configuration conf = loadSliderConf()
- String testImage = conf.get(KEY_TEST_HBASE_TAR)
- assert testImage
- Path path = new Path(testImage)
- HadoopFS fs = HadoopFS.get(
- path.toUri(),
- conf)
- assert fs.exists(path)
- }
-
- @Test
- public void testAppConfExists() throws Throwable {
- Configuration conf = loadSliderConf()
- String dir = conf.get(KEY_TEST_HBASE_APPCONF)
-
- assert conf.get(KEY_TEST_HBASE_APPCONF)
- Path path = new Path(dir)
- HadoopFS fs = HadoopFS.get(
- path.toUri(),
- conf)
- assert fs.exists(path)
- }
-
-
-}
[3/7] git commit: SLIDER-241 rename Tests to ITs
Posted by bi...@apache.org.
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)
+ }
+}
[4/7] git commit: SLIDER-241 remove slider.funtest.enabled property
and use maven-failsafe-plugin to run ITs
Posted by bi...@apache.org.
SLIDER-241 remove slider.funtest.enabled property and use maven-failsafe-plugin to run 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/dfd3cd72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/dfd3cd72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/dfd3cd72
Branch: refs/heads/develop
Commit: dfd3cd724f9a972d15f2b43eaf8ab7c656bec87f
Parents: e1258c8
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Wed Jul 16 13:49:25 2014 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Wed Jul 16 13:49:25 2014 -0700
----------------------------------------------------------------------
app-packages/accumulo/pom.xml | 10 +-----
pom.xml | 1 +
slider-funtest/pom.xml | 19 +++++++-----
.../abstracttests/AbstractTestBuildSetup.groovy | 3 --
.../framework/AgentCommandTestBase.groovy | 1 -
.../funtest/framework/CommandTestBase.groovy | 19 ++----------
.../funtest/framework/FuntestProperties.groovy | 3 --
.../accumulo/StubToForceGroovySrcToCompile.java | 22 --------------
.../accumulo/accumulo-funtests/pom.xml | 19 +++++++-----
.../slider/providers/accumulo/TestStub.groovy | 32 --------------------
.../accumulo/funtest/AccumuloCIIT.groovy | 5 ---
.../funtest/AccumuloCommandTestBase.groovy | 1 -
.../funtest/FunctionalAccumuloClusterIT.groovy | 2 --
.../FunctionalAccumuloM1T1GC1Mon1IT.groovy | 2 --
.../StubToForceGroovyTestsToCompile.java | 22 ++++++++++++++
slider-providers/hbase/hbase-funtests/pom.xml | 21 +++++++------
.../slider/providers/hbase/TestStub.groovy | 32 --------------------
.../hbase/funtest/DemoHBaseCluster.groovy | 2 +-
.../hbase/funtest/HBaseCommandTestBase.groovy | 2 --
.../providers/hbase/funtest/ImagesIT.groovy | 1 -
.../clusters/offline/slider/slider-client.xml | 11 -------
21 files changed, 61 insertions(+), 169 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/app-packages/accumulo/pom.xml
----------------------------------------------------------------------
diff --git a/app-packages/accumulo/pom.xml b/app-packages/accumulo/pom.xml
index 985773a..f4db31b 100644
--- a/app-packages/accumulo/pom.xml
+++ b/app-packages/accumulo/pom.xml
@@ -81,6 +81,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<id>run-integration-tests</id>
@@ -143,15 +144,6 @@
</dependency>
</dependencies>
</plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- can't figure out how to get the surefire plugin not to pick up the ITs, so skip it entirely -->
- <skip>true</skip>
- </configuration>
- </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9ae2a5e..e6d1e31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -106,6 +106,7 @@
test options
-->
+ <slider.conf.dir>${project.basedir}/src/test/clusters/offline/slider</slider.conf.dir>
<test.forkedProcessTimeoutInSeconds>18000</test.forkedProcessTimeoutInSeconds>
<test.argLine>-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError</test.argLine>
<test.reuseForks>false</test.reuseForks>
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-funtest/pom.xml
----------------------------------------------------------------------
diff --git a/slider-funtest/pom.xml b/slider-funtest/pom.xml
index 5117875..b6a7dfb 100644
--- a/slider-funtest/pom.xml
+++ b/slider-funtest/pom.xml
@@ -93,8 +93,17 @@
<!-- test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${maven-surefire-plugin.version}</version>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>run-integration-tests</id>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
<configuration>
<!--mvn process fork options-->
<reuseForks>${test.reuseForks}</reuseForks>
@@ -121,12 +130,6 @@
<test.app.resource>../slider-core/src/test/app_packages/test_command_log/resources.json</test.app.resource>
<test.app.template>../slider-core/src/test/app_packages/test_command_log/appConfig.json</test.app.template>
</systemPropertyVariables>
- <includes>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*$*.java</exclude>
- </excludes>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-funtest/src/main/groovy/org/apache/slider/funtest/abstracttests/AbstractTestBuildSetup.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/abstracttests/AbstractTestBuildSetup.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/abstracttests/AbstractTestBuildSetup.groovy
index c42589a..e0b87f7 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/abstracttests/AbstractTestBuildSetup.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/abstracttests/AbstractTestBuildSetup.groovy
@@ -143,7 +143,6 @@ abstract class AbstractTestBuildSetup extends SliderTestUtils implements Funtest
@Test
public void testConfHasDefaultFS() throws Throwable {
Configuration conf = loadSliderConf()
- assumeBoolOption(conf, KEY_SLIDER_FUNTESTS_ENABLED, true)
String fs = conf.get("fs.defaultFS")
log.info("Test Filesystem $fs")
assert fs != null
@@ -152,9 +151,7 @@ abstract class AbstractTestBuildSetup extends SliderTestUtils implements Funtest
@Test
public void testConfHasRM() throws Throwable {
-
Configuration conf = loadSliderConf()
- assumeBoolOption(conf, KEY_SLIDER_FUNTESTS_ENABLED, true)
String val = conf.get(YarnConfiguration.RM_ADDRESS)
log.info("$YarnConfiguration.RM_ADDRESS = $val")
assert val != YarnConfiguration.DEFAULT_RM_ADDRESS
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
index 26ae2bb..35e1834 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
@@ -65,7 +65,6 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
public TemporaryFolder folder = new TemporaryFolder();
public static void assumeAgentTestsEnabled() {
- assumeFunctionalTestsEnabled()
assume(AGENTTESTS_ENABLED, "Agent tests disabled")
}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index 08d352a..d3df015 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -66,8 +66,6 @@ abstract class CommandTestBase extends SliderTestUtils {
public static final int SLIDER_TEST_TIMEOUT
- public static final boolean FUNTESTS_ENABLED
-
public static final String YARN_RAM_REQUEST
@@ -83,8 +81,6 @@ abstract class CommandTestBase extends SliderTestUtils {
SLIDER_TEST_TIMEOUT = getTimeOptionMillis(SLIDER_CONFIG,
KEY_TEST_TIMEOUT,
1000 * DEFAULT_TEST_TIMEOUT_SECONDS)
- FUNTESTS_ENABLED =
- SLIDER_CONFIG.getBoolean(KEY_SLIDER_FUNTESTS_ENABLED, true)
YARN_RAM_REQUEST = SLIDER_CONFIG.get(
KEY_TEST_YARN_RAM_REQUEST,
@@ -327,9 +323,7 @@ abstract class CommandTestBase extends SliderTestUtils {
* @param cluster
*/
static void setupCluster(String cluster) {
- if (FUNTESTS_ENABLED) {
- ensureClusterDestroyed(cluster)
- }
+ ensureClusterDestroyed(cluster)
}
/**
@@ -338,9 +332,7 @@ abstract class CommandTestBase extends SliderTestUtils {
* @param name cluster name
*/
static void teardown(String name) {
- if (FUNTESTS_ENABLED) {
- freezeForce(name)
- }
+ freezeForce(name)
}
/**
@@ -508,11 +500,4 @@ abstract class CommandTestBase extends SliderTestUtils {
return status
}
- /**
- * if tests are not enabled: skip them
- */
- public static void assumeFunctionalTestsEnabled() {
- assume(FUNTESTS_ENABLED, "Functional tests disabled")
- }
-
}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
index 9b63c22..1096dfa 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
@@ -40,7 +40,6 @@ public interface FuntestProperties extends SliderXMLConfKeysForTesting {
String KEY_SLIDER_TEST_NUM_WORKERS = "slider.test.cluster.size"
int DEFAULT_SLIDER_NUM_WORKERS = 1
- String KEY_SLIDER_TEST_ZK_HOSTS = "slider.test.zkhosts";
String DEFAULT_SLIDER_ZK_HOSTS = "localhost:2181";
/**
@@ -49,8 +48,6 @@ public interface FuntestProperties extends SliderXMLConfKeysForTesting {
String KEY_AM_RESTART_SLEEP_TIME = "slider.test.am.restart.time"
int DEFAULT_AM_RESTART_SLEEP_TIME = 30000
- String KEY_SLIDER_FUNTESTS_ENABLED = "slider.funtest.enabled"
-
String CLIENT_CONFIG_FILENAME = SliderKeys.CLIENT_RESOURCE
String ENV_CONF_DIR = "SLIDER_CONF_DIR"
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-funtest/src/main/java/org/apache/slider/funtest/accumulo/StubToForceGroovySrcToCompile.java
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/java/org/apache/slider/funtest/accumulo/StubToForceGroovySrcToCompile.java b/slider-funtest/src/main/java/org/apache/slider/funtest/accumulo/StubToForceGroovySrcToCompile.java
deleted file mode 100644
index eefccbb..0000000
--- a/slider-funtest/src/main/java/org/apache/slider/funtest/accumulo/StubToForceGroovySrcToCompile.java
+++ /dev/null
@@ -1,22 +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.accumulo;
-
-class StubToForceGroovySrcToCompile {
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/accumulo/accumulo-funtests/pom.xml
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/pom.xml b/slider-providers/accumulo/accumulo-funtests/pom.xml
index c55c0d5..1cd2163 100644
--- a/slider-providers/accumulo/accumulo-funtests/pom.xml
+++ b/slider-providers/accumulo/accumulo-funtests/pom.xml
@@ -85,8 +85,17 @@
<!-- functional test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${maven-surefire-plugin.version}</version>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>run-integration-tests</id>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
<configuration>
<!--mvn process fork options-->
<reuseForks>${test.reuseForks}</reuseForks>
@@ -109,12 +118,6 @@
<slider.conf.dir>${slider.conf.dir}</slider.conf.dir>
<slider.bin.dir>../../../slider-assembly/target/slider-${project.version}-all/slider-${project.version}</slider.bin.dir>
</systemPropertyVariables>
- <includes>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*$*.java</exclude>
- </excludes>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/TestStub.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/TestStub.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/TestStub.groovy
deleted file mode 100644
index 3d9abb7..0000000
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/TestStub.groovy
+++ /dev/null
@@ -1,32 +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.providers.accumulo
-
-import org.junit.Test
-
-/**
- * this is here to ensure there is always a test
- */
-class TestStub {
-
- @Test
- public void testStubTest() throws Throwable {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/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
index 546c04b..7283730 100644
--- 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
@@ -16,7 +16,6 @@
*/
package org.apache.slider.providers.accumulo.funtest
-import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.apache.accumulo.core.client.Connector
@@ -34,10 +33,6 @@ 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 {
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
index 1b5d8bf..7942ce1 100644
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
@@ -62,7 +62,6 @@ abstract class AccumuloCommandTestBase extends CommandTestBase {
public static void assumeAccumuloTestsEnabled() {
- assumeFunctionalTestsEnabled()
assume(ACCUMULO_TESTS_ENABLED, "Accumulo tests disabled")
}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
index 79dd611..465792c 100644
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
@@ -18,7 +18,6 @@ package org.apache.slider.providers.accumulo.funtest
import static org.apache.slider.providers.accumulo.AccumuloConfigFileOptions.*
import static org.apache.slider.providers.accumulo.AccumuloKeys.*
-import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.apache.slider.common.SliderExitCodes
@@ -33,7 +32,6 @@ import org.junit.Test
/**
*
*/
-@CompileStatic
@Slf4j
class FunctionalAccumuloClusterIT extends AccumuloCommandTestBase
implements FuntestProperties, Arguments, SliderExitCodes {
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy
index 865eacc..33910d4 100644
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy
@@ -18,13 +18,11 @@
package org.apache.slider.providers.accumulo.funtest
-import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.apache.slider.api.ClusterDescription
import org.apache.slider.common.params.Arguments
import org.apache.slider.common.params.SliderActions
-@CompileStatic
@Slf4j
public class FunctionalAccumuloM1T1GC1Mon1IT extends FunctionalAccumuloClusterIT {
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/accumulo/accumulo-funtests/src/test/java/org/apache/slider/providers/accumulo/funtest/StubToForceGroovyTestsToCompile.java
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/java/org/apache/slider/providers/accumulo/funtest/StubToForceGroovyTestsToCompile.java b/slider-providers/accumulo/accumulo-funtests/src/test/java/org/apache/slider/providers/accumulo/funtest/StubToForceGroovyTestsToCompile.java
new file mode 100644
index 0000000..1a948a2
--- /dev/null
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/java/org/apache/slider/providers/accumulo/funtest/StubToForceGroovyTestsToCompile.java
@@ -0,0 +1,22 @@
+/*
+ * 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;
+
+class StubToForceGroovyTestsToCompile {
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/hbase/hbase-funtests/pom.xml
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/pom.xml b/slider-providers/hbase/hbase-funtests/pom.xml
index 7913fbf..08d27c3 100644
--- a/slider-providers/hbase/hbase-funtests/pom.xml
+++ b/slider-providers/hbase/hbase-funtests/pom.xml
@@ -85,8 +85,17 @@
<!-- functional test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${maven-surefire-plugin.version}</version>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>run-integration-tests</id>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
<configuration>
<!--mvn process fork options-->
@@ -107,15 +116,9 @@
<java.security.krb5.realm>${slider.test.java.security.krb5.realm}</java.security.krb5.realm>
<java.security.krb5.kdc>${slider.test.java.security.krb5.kdc}</java.security.krb5.kdc>
<!-- this property must be supplied-->
- <slider.conf.dir>../../../src/test/clusters/offline/slider</slider.conf.dir>
+ <slider.conf.dir>${slider.conf.dir}</slider.conf.dir>
<slider.bin.dir>../../../slider-assembly/target/slider-${project.version}-all/slider-${project.version}</slider.bin.dir>
</systemPropertyVariables>
- <includes>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/Test*$*.java</exclude>
- </excludes>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/TestStub.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/TestStub.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/TestStub.groovy
deleted file mode 100644
index f683ded..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/TestStub.groovy
+++ /dev/null
@@ -1,32 +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.providers.hbase
-
-import org.junit.Test
-
-/**
- * this is here to ensure there is always a test
- */
-class TestStub {
-
- @Test
- public void testStubTest() throws Throwable {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/DemoHBaseCluster.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/DemoHBaseCluster.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/DemoHBaseCluster.groovy
index 9385cc9..1bef7d3 100644
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/DemoHBaseCluster.groovy
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/DemoHBaseCluster.groovy
@@ -22,7 +22,7 @@ import org.apache.hadoop.conf.Configuration
import org.apache.slider.api.ClusterDescription
import org.apache.slider.client.SliderClient
-class DemoHBaseCluster extends TestFunctionalHBaseCluster {
+class DemoHBaseCluster extends FunctionalHBaseClusterIT {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseCommandTestBase.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseCommandTestBase.groovy
index 8bad590..caaab04 100644
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseCommandTestBase.groovy
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseCommandTestBase.groovy
@@ -52,7 +52,6 @@ abstract class HBaseCommandTestBase extends CommandTestBase {
@BeforeClass
public static void extendClasspath() {
- assumeFunctionalTestsEnabled()
addExtraJar(HBaseClientProvider)
}
@@ -65,7 +64,6 @@ abstract class HBaseCommandTestBase extends CommandTestBase {
public void assumeHBaseTestsEnabled() {
- assumeFunctionalTestsEnabled()
assume(HBASE_TESTS_ENABLED, "HBase tests disabled")
}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
index 6611664..d1b5c55 100644
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
@@ -31,7 +31,6 @@ class ImagesIT extends CommandTestBase implements FuntestProperties {
@Before
public void verifyPreconditions() {
- assumeBoolOption(SLIDER_CONFIG, KEY_SLIDER_FUNTESTS_ENABLED, true)
assumeBoolOption(SLIDER_CONFIG, KEY_TEST_HBASE_ENABLED, true)
}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/dfd3cd72/src/test/clusters/offline/slider/slider-client.xml
----------------------------------------------------------------------
diff --git a/src/test/clusters/offline/slider/slider-client.xml b/src/test/clusters/offline/slider/slider-client.xml
index 8385086..25c01cf 100644
--- a/src/test/clusters/offline/slider/slider-client.xml
+++ b/src/test/clusters/offline/slider/slider-client.xml
@@ -38,11 +38,6 @@
</property>
<property>
- <name>slider.funtest.enabled</name>
- <value>false</value>
- </property>
-
- <property>
<name>yarn.application.classpath</name>
<value>
/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*
@@ -62,12 +57,6 @@
</property>
<property>
- <name>slider.test.zkhosts</name>
- <description>list of the zookeeper hosts</description>
- <value></value>
- </property>
-
- <property>
<name>slider.test.accumulo.enabled</name>
<description>Flag to enable/disable Accumulo tests</description>
<value>false</value>
[6/7] git commit: Merge branch
'feature/SLIDER-241_convert_funtests_to_ITs' into develop
Posted by bi...@apache.org.
Merge branch 'feature/SLIDER-241_convert_funtests_to_ITs' into develop
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/90e8fb13
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/90e8fb13
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/90e8fb13
Branch: refs/heads/develop
Commit: 90e8fb13c0c5573a9b74bc76b618356f3d38f1e3
Parents: 5709850 272e127
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Wed Jul 16 17:20:24 2014 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Wed Jul 16 17:20:24 2014 -0700
----------------------------------------------------------------------
app-packages/accumulo/pom.xml | 10 +-
pom.xml | 1 +
slider-funtest/pom.xml | 19 +-
.../abstracttests/AbstractTestBuildSetup.groovy | 3 -
.../framework/AgentCommandTestBase.groovy | 47 ----
.../funtest/framework/CommandTestBase.groovy | 57 +++--
.../funtest/framework/FuntestProperties.groovy | 3 -
.../accumulo/StubToForceGroovySrcToCompile.java | 22 --
.../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 -------
.../accumulo/accumulo-funtests/pom.xml | 19 +-
.../slider/providers/accumulo/TestStub.groovy | 32 ---
.../funtest/AccumuloBuildSetupIT.groovy | 37 +++
.../accumulo/funtest/AccumuloCIIT.groovy | 109 +++++++++
.../funtest/AccumuloCommandTestBase.groovy | 53 ++++-
.../funtest/FunctionalAccumuloClusterIT.groovy | 145 ++++++++++++
.../FunctionalAccumuloM1T1GC1Mon1IT.groovy | 57 +++++
.../funtest/TestAccumuloBuildSetup.groovy | 38 ----
.../accumulo/funtest/TestAccumuloCI.groovy | 115 ----------
.../TestFunctionalAccumuloCluster.groovy | 146 ------------
.../TestFunctionalAccumuloM1T1GC1Mon1.groovy | 59 -----
.../StubToForceGroovyTestsToCompile.java | 22 ++
slider-providers/hbase/hbase-funtests/pom.xml | 21 +-
.../slider/providers/hbase/TestStub.groovy | 32 ---
.../hbase/funtest/DemoHBaseCluster.groovy | 2 +-
.../funtest/FunctionalHBaseClusterIT.groovy | 223 +++++++++++++++++++
.../hbase/funtest/HBaseBuildSetupIT.groovy | 36 +++
.../funtest/HBaseClusterBuildDestroyIT.groovy | 87 ++++++++
.../funtest/HBaseClusterLifecycleIT.groovy | 183 +++++++++++++++
.../hbase/funtest/HBaseCommandTestBase.groovy | 2 -
.../hbase/funtest/HBaseIntegrationIT.groovy | 69 ++++++
.../providers/hbase/funtest/HBaseLoadIT.groovy | 64 ++++++
.../hbase/funtest/HBaseNodeFailureIT.groovy | 135 +++++++++++
.../providers/hbase/funtest/ImagesIT.groovy | 64 ++++++
.../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 ------
.../clusters/offline/slider/slider-client.xml | 11 -
63 files changed, 2282 insertions(+), 2380 deletions(-)
----------------------------------------------------------------------
[5/7] git commit: SLIDER-241 make sure accumulo provider funtests
work, move some utility methods down to CommandTestBase
Posted by bi...@apache.org.
SLIDER-241 make sure accumulo provider funtests work, move some utility methods down to CommandTestBase
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/272e127e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/272e127e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/272e127e
Branch: refs/heads/develop
Commit: 272e127e6cfda91ac6d3161e7061bbac4fb696b5
Parents: dfd3cd7
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Wed Jul 16 17:20:03 2014 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Wed Jul 16 17:20:03 2014 -0700
----------------------------------------------------------------------
.../framework/AgentCommandTestBase.groovy | 46 -----------------
.../funtest/framework/CommandTestBase.groovy | 42 ++++++++++++++++
.../accumulo/funtest/AccumuloCIIT.groovy | 5 +-
.../funtest/AccumuloCommandTestBase.groovy | 52 ++++++++++++++++----
.../funtest/FunctionalAccumuloClusterIT.groovy | 3 +-
5 files changed, 88 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/272e127e/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
index 35e1834..0a0ac16 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentCommandTestBase.groovy
@@ -23,10 +23,6 @@ import org.apache.hadoop.fs.Path
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.AgentUploads
-import org.apache.slider.funtest.framework.CommandTestBase
-import org.apache.slider.funtest.framework.FuntestProperties
-import org.apache.slider.funtest.framework.SliderShell
import org.apache.tools.zip.ZipEntry
import org.apache.tools.zip.ZipOutputStream
import org.junit.Before
@@ -157,31 +153,6 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
return null;
}
- public static boolean isApplicationInState(String text, String applicationName) {
- boolean exists = false
- SliderShell shell = slider(EXIT_SUCCESS,
- [
- ACTION_LIST,
- applicationName])
- for (String str in shell.out) {
- if (str.contains(text)) {
- exists = true
- }
- }
-
- return exists
- }
-
- protected void ensureApplicationIsUp(String clusterName) {
- repeatUntilTrue(this.&isApplicationUp, 15, 1000 * 3, ['arg1': clusterName],
- true, 'Application did not start, aborting test.')
- }
-
- boolean isApplicationUp(Map<String, String> args) {
- String applicationName = args['arg1'];
- return isApplicationInState("RUNNING", applicationName);
- }
-
public static void addDir(File dirObj, ZipOutputStream zipFile, String prefix) {
dirObj.eachFile() { file ->
if (file.directory) {
@@ -195,23 +166,6 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
}
}
- protected void repeatUntilTrue(Closure c, int maxAttempts, int sleepDur, Map args,
- boolean failIfUnsuccessful = false, String message = "") {
- int attemptCount = 0
- while (attemptCount < maxAttempts) {
- if (c(args)) {
- break
- };
- attemptCount++;
-
- if (failIfUnsuccessful) {
- assert attemptCount != maxAttempts, message
- }
-
- sleep(sleepDur)
- }
- }
-
protected void cleanup(String applicationName) throws Throwable {
if (setup_failed) {
// cleanup probably won't work if setup failed
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/272e127e/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index d3df015..ba7be53 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -500,4 +500,46 @@ abstract class CommandTestBase extends SliderTestUtils {
return status
}
+ protected void ensureApplicationIsUp(String clusterName) {
+ repeatUntilTrue(this.&isApplicationUp, 15, 1000 * 3, ['arg1': clusterName],
+ true, 'Application did not start, aborting test.')
+ }
+
+ protected boolean isApplicationUp(Map<String, String> args) {
+ String applicationName = args['arg1'];
+ return isApplicationInState("RUNNING", applicationName);
+ }
+
+ public static boolean isApplicationInState(String text, String applicationName) {
+ boolean exists = false
+ SliderShell shell = slider(0,
+ [
+ ACTION_LIST,
+ applicationName])
+ for (String str in shell.out) {
+ if (str.contains(text)) {
+ exists = true
+ }
+ }
+
+ return exists
+ }
+
+ protected void repeatUntilTrue(Closure c, int maxAttempts, int sleepDur, Map args,
+ boolean failIfUnsuccessful = false, String message = "") {
+ int attemptCount = 0
+ while (attemptCount < maxAttempts) {
+ if (c(args)) {
+ break
+ };
+ attemptCount++;
+
+ if (failIfUnsuccessful) {
+ assert attemptCount != maxAttempts, message
+ }
+
+ sleep(sleepDur)
+ }
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/272e127e/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
index 7283730..4ec5ff1 100644
--- 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
@@ -62,7 +62,6 @@ class AccumuloCIIT extends FunctionalAccumuloClusterIT {
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
@@ -78,7 +77,7 @@ class AccumuloCIIT extends FunctionalAccumuloClusterIT {
String[] ciOpts = ["-i", inst.getInstanceName(),
"-z", zookeepers, "-u", "root",
"-p", getPassword(), "--table", tableName,
- "--num", Integer.toString(1000 * 1000 * 15 * getNumTservers()),
+ "--num", Integer.toString(1000 * 1000 * 4 * getNumTservers()),
"--batchMemory", "100000000",
"--batchLatency", "600000",
"--batchThreads", "1"]
@@ -90,7 +89,7 @@ class AccumuloCIIT extends FunctionalAccumuloClusterIT {
Path verifyOutput = new Path("/user/" + currentUser + "/.slider/cluster/" + clustername + "/verify-output")
assert !clusterFS.exists(verifyOutput)
- YarnConfiguration verifyConf = new YarnConfiguration(CommandTestBase.SLIDER_CONFIG);
+ YarnConfiguration verifyConf = new YarnConfiguration(SLIDER_CONFIG);
// Try to load the necessary classes for the Mappers to find them
if (loadClassesForMapReduce(verifyConf)) {
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/272e127e/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
index 7942ce1..f050793 100644
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/AccumuloCommandTestBase.groovy
@@ -18,6 +18,13 @@
package org.apache.slider.providers.accumulo.funtest
+import org.apache.hadoop.security.UserGroupInformation
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.funtest.framework.FileUploader
+import org.apache.slider.providers.accumulo.AccumuloClientProvider
+import org.junit.BeforeClass
+
import static SliderXMLConfKeysForTesting.KEY_TEST_ACCUMULO_APPCONF
import static SliderXMLConfKeysForTesting.KEY_TEST_ACCUMULO_TAR
import static org.apache.slider.api.ResourceKeys.YARN_MEMORY
@@ -47,10 +54,14 @@ import org.junit.Before
/**
* Anything specific to accumulo tests
*/
-abstract class AccumuloCommandTestBase extends CommandTestBase {
+abstract class AccumuloCommandTestBase extends CommandTestBase
+ implements SliderExitCodes, SliderActions {
public static final int ACCUMULO_LAUNCH_WAIT_TIME
public static final boolean ACCUMULO_TESTS_ENABLED
+ public static final FileUploader uploader
+ public Path ACCUMULO_TAR
+ public Path ACCUMULO_CONF
static {
ACCUMULO_LAUNCH_WAIT_TIME = getTimeOptionMillis(SLIDER_CONFIG,
@@ -58,6 +69,7 @@ abstract class AccumuloCommandTestBase extends CommandTestBase {
1000 * DEFAULT_ACCUMULO_LAUNCH_TIME_SECONDS)
ACCUMULO_TESTS_ENABLED =
SLIDER_CONFIG.getBoolean(KEY_TEST_ACCUMULO_ENABLED, false)
+ uploader = new FileUploader(SLIDER_CONFIG, UserGroupInformation.currentUser)
}
@@ -65,9 +77,8 @@ abstract class AccumuloCommandTestBase extends CommandTestBase {
assume(ACCUMULO_TESTS_ENABLED, "Accumulo tests disabled")
}
- @Before
- public void verifyPreconditions() {
-
+ @BeforeClass
+ public static void verifyPreconditions() {
//if tests are not enabled: skip tests
assumeAccumuloTestsEnabled()
// but if they are -fail if the values are missing
@@ -75,6 +86,29 @@ abstract class AccumuloCommandTestBase extends CommandTestBase {
getRequiredConfOption(SLIDER_CONFIG, OPTION_HADOOP_HOME)
}
+ @BeforeClass
+ public static void extendClasspath() {
+ addExtraJar(AccumuloClientProvider)
+ }
+
+ @Before
+ public void uploadFiles() {
+ File tar = new File(getRequiredConfOption(SLIDER_CONFIG,
+ KEY_TEST_ACCUMULO_TAR))
+ File conf = new File(getRequiredConfOption(SLIDER_CONFIG,
+ KEY_TEST_ACCUMULO_APPCONF))
+
+ //create the home dir or fail
+ Path home = uploader.mkHomeDir()
+
+ ACCUMULO_TAR = new Path(home, tar.getName())
+ ACCUMULO_CONF = new Path(home, "accumulo-conf")
+
+ // Upload the local accumulo tarball and conf directory to hdfs
+ uploader.copyIfOutOfDate(tar, ACCUMULO_TAR, false)
+ uploader.copyIfOutOfDate(conf, ACCUMULO_CONF, false)
+ }
+
/**
* Create an accumulo cluster
*
@@ -101,12 +135,10 @@ abstract class AccumuloCommandTestBase extends CommandTestBase {
clusterOps[OPTION_HADOOP_HOME] = getRequiredConfOption(
SLIDER_CONFIG,
OPTION_HADOOP_HOME)
- argsList << Arguments.ARG_IMAGE <<
- getRequiredConfOption(SLIDER_CONFIG, KEY_TEST_ACCUMULO_TAR)
+ argsList << Arguments.ARG_IMAGE << ACCUMULO_TAR
+
+ argsList << Arguments.ARG_CONFDIR << ACCUMULO_CONF
- argsList << Arguments.ARG_CONFDIR <<
- getRequiredConfOption(SLIDER_CONFIG, KEY_TEST_ACCUMULO_APPCONF)
-
argsList << Arguments.ARG_OPTION << AccumuloKeys.OPTION_ACCUMULO_PASSWORD << password
argsList << ARG_RES_COMP_OPT << ROLE_MASTER <<
@@ -124,7 +156,7 @@ abstract class AccumuloCommandTestBase extends CommandTestBase {
blockUntilRunning,
clusterOps)
}
-
+
public boolean loadClassesForMapReduce(Configuration conf) {
String[] neededClasses = [AccumuloInputFormat.class.getName(), TException.class.getName(), ZooStore.class.getName(), Tracer.class.getName()]
String[] neededJars = ["accumulo-core.jar", "libthrift.jar", "accumulo-fate.jar", "accumulo-trace.jar"]
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/272e127e/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
index 465792c..ca7cc65 100644
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
@@ -106,9 +106,10 @@ class FunctionalAccumuloClusterIT extends AccumuloCommandTestBase
extraArgs,
true,
clusterOps,
- "256",
+ "128",
getPassword()
)
+ ensureApplicationIsUp(getClusterName())
//get a slider client against the cluster
SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, getClusterName())
[2/7] SLIDER-241 rename Tests to ITs
Posted by bi...@apache.org.
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/FunctionalAccumuloClusterIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
new file mode 100644
index 0000000..79dd611
--- /dev/null
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloClusterIT.groovy
@@ -0,0 +1,146 @@
+/*
+ * 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 static org.apache.slider.providers.accumulo.AccumuloConfigFileOptions.*
+import static org.apache.slider.providers.accumulo.AccumuloKeys.*
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.client.SliderClient
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+
+/**
+ *
+ */
+@CompileStatic
+@Slf4j
+class FunctionalAccumuloClusterIT extends AccumuloCommandTestBase
+ implements FuntestProperties, Arguments, SliderExitCodes {
+
+
+ public String getClusterName() {
+ return "test_functional_accumulo_cluster"
+ }
+
+ public String getPassword() {
+ return "password";
+ }
+
+ @Before
+ public void prepareCluster() {
+ setupCluster(getClusterName())
+ }
+
+ @After
+ public void destroyCluster() {
+ teardown(getClusterName())
+ }
+
+ public int getNumMasters() {
+ return 1
+ }
+
+ public int getNumTservers() {
+ return 1
+ }
+
+ public int getNumMonitors() {
+ return 1
+ }
+
+ public int getNumGarbageCollectors() {
+ return 1
+ }
+
+ public int getNumTracers() {
+ return 0
+ }
+
+ public int getMonitorPort() {
+ return 0
+ }
+
+ @Test
+ public void testAccumuloClusterCreate() throws Throwable {
+
+ describe "Create a working Accumulo cluster"
+
+ def path = buildClusterPath(getClusterName())
+ assert !clusterFS.exists(path)
+
+ Map<String, Integer> roleMap = [
+ (ROLE_MASTER) : getNumMasters(),
+ (ROLE_TABLET) : getNumTservers(),
+ (ROLE_MONITOR): getNumMonitors(),
+ (ROLE_GARBAGE_COLLECTOR): getNumGarbageCollectors(),
+ (ROLE_TRACER) : getNumTracers()
+ ];
+
+ Map<String, String> clusterOps = [:]
+ clusterOps["site." + MONITOR_PORT_CLIENT] = Integer.toString(getMonitorPort())
+
+ List<String> extraArgs = []
+
+ createAccumuloCluster(
+ getClusterName(),
+ roleMap,
+ extraArgs,
+ true,
+ clusterOps,
+ "256",
+ getPassword()
+ )
+
+ //get a slider client against the cluster
+ SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, getClusterName())
+ ClusterDescription cd = sliderClient.clusterDescription
+ assert getClusterName() == cd.name
+
+ log.info("Connected via Client {}", sliderClient.toString())
+
+ //wait for the role counts to be reached
+ waitForRoleCount(sliderClient, roleMap, ACCUMULO_LAUNCH_WAIT_TIME)
+
+ clusterLoadOperations(clusterName, roleMap, cd)
+ }
+
+
+ public String getDescription() {
+ return "Create a working Accumulo cluster $clusterName"
+ }
+
+ /**
+ * Override point for any cluster load operations
+ * @param clientConf
+ * @param numWorkers
+ */
+ public void clusterLoadOperations(
+ String clustername,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+
+ log.info("Client Description = " + cd.toJsonString())
+ }
+
+}
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/FunctionalAccumuloM1T1GC1Mon1IT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy
new file mode 100644
index 0000000..865eacc
--- /dev/null
+++ b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/FunctionalAccumuloM1T1GC1Mon1IT.groovy
@@ -0,0 +1,59 @@
+/*
+ * 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.slider.api.ClusterDescription
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+
+@CompileStatic
+@Slf4j
+public class FunctionalAccumuloM1T1GC1Mon1IT extends FunctionalAccumuloClusterIT {
+
+ @Override
+ public String getClusterName() {
+ return "test_functional_accumulo_m1t1gc1mon1";
+ }
+
+ /**
+ * Override point for any cluster load operations
+ * @param clientConf
+ * @param numWorkers
+ */
+ @Override
+ public void clusterLoadOperations(
+ String clustername,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+
+ slider(0, [
+ SliderActions.ACTION_FREEZE,
+ getClusterName(),
+ Arguments.ARG_WAIT,
+ Integer.toString(FREEZE_WAIT_TIME),
+ Arguments.ARG_MESSAGE,
+ "freeze-in-test-AccumuloCluster"
+ ])
+
+ //destroy the cluster. This only works if the permissions allow it
+ destroy(0, getClusterName())
+ }
+}
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/TestAccumuloBuildSetup.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestAccumuloBuildSetup.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestAccumuloBuildSetup.groovy
deleted file mode 100644
index 61366da..0000000
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestAccumuloBuildSetup.groovy
+++ /dev/null
@@ -1,38 +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.providers.accumulo.funtest
-
-import org.apache.hadoop.conf.Configuration
-import org.apache.slider.funtest.abstracttests.AbstractTestBuildSetup
-import org.junit.Test
-
-class TestAccumuloBuildSetup extends AbstractTestBuildSetup {
-
- @Test
- public void testAccumuloBuildsHavePathsDefined() throws Throwable {
- Configuration conf = loadSliderConf();
- assumeBoolOption(conf, KEY_SLIDER_FUNTESTS_ENABLED, true)
-
- 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/TestAccumuloCI.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestAccumuloCI.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestAccumuloCI.groovy
deleted file mode 100644
index 5573dd4..0000000
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestAccumuloCI.groovy
+++ /dev/null
@@ -1,115 +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.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 TestAccumuloCI extends TestFunctionalAccumuloCluster {
-
- @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)
- }
-}
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/TestFunctionalAccumuloCluster.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestFunctionalAccumuloCluster.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestFunctionalAccumuloCluster.groovy
deleted file mode 100644
index 06fe21c..0000000
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestFunctionalAccumuloCluster.groovy
+++ /dev/null
@@ -1,146 +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.providers.accumulo.funtest
-
-import static org.apache.slider.providers.accumulo.AccumuloConfigFileOptions.*
-import static org.apache.slider.providers.accumulo.AccumuloKeys.*
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-
-import org.apache.slider.common.SliderExitCodes
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.funtest.framework.FuntestProperties
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.client.SliderClient
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-
-/**
- *
- */
-@CompileStatic
-@Slf4j
-class TestFunctionalAccumuloCluster extends AccumuloCommandTestBase
- implements FuntestProperties, Arguments, SliderExitCodes {
-
-
- public String getClusterName() {
- return "test_functional_accumulo_cluster"
- }
-
- public String getPassword() {
- return "password";
- }
-
- @Before
- public void prepareCluster() {
- setupCluster(getClusterName())
- }
-
- @After
- public void destroyCluster() {
- teardown(getClusterName())
- }
-
- public int getNumMasters() {
- return 1
- }
-
- public int getNumTservers() {
- return 1
- }
-
- public int getNumMonitors() {
- return 1
- }
-
- public int getNumGarbageCollectors() {
- return 1
- }
-
- public int getNumTracers() {
- return 0
- }
-
- public int getMonitorPort() {
- return 0
- }
-
- @Test
- public void testAccumuloClusterCreate() throws Throwable {
-
- describe "Create a working Accumulo cluster"
-
- def path = buildClusterPath(getClusterName())
- assert !clusterFS.exists(path)
-
- Map<String, Integer> roleMap = [
- (ROLE_MASTER) : getNumMasters(),
- (ROLE_TABLET) : getNumTservers(),
- (ROLE_MONITOR): getNumMonitors(),
- (ROLE_GARBAGE_COLLECTOR): getNumGarbageCollectors(),
- (ROLE_TRACER) : getNumTracers()
- ];
-
- Map<String, String> clusterOps = [:]
- clusterOps["site." + MONITOR_PORT_CLIENT] = Integer.toString(getMonitorPort())
-
- List<String> extraArgs = []
-
- createAccumuloCluster(
- getClusterName(),
- roleMap,
- extraArgs,
- true,
- clusterOps,
- "256",
- getPassword()
- )
-
- //get a slider client against the cluster
- SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, getClusterName())
- ClusterDescription cd = sliderClient.clusterDescription
- assert getClusterName() == cd.name
-
- log.info("Connected via Client {}", sliderClient.toString())
-
- //wait for the role counts to be reached
- waitForRoleCount(sliderClient, roleMap, ACCUMULO_LAUNCH_WAIT_TIME)
-
- clusterLoadOperations(clusterName, roleMap, cd)
- }
-
-
- public String getDescription() {
- return "Create a working Accumulo cluster $clusterName"
- }
-
- /**
- * Override point for any cluster load operations
- * @param clientConf
- * @param numWorkers
- */
- public void clusterLoadOperations(
- String clustername,
- Map<String, Integer> roleMap,
- ClusterDescription cd) {
-
- log.info("Client Description = " + cd.toJsonString())
- }
-
-}
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/TestFunctionalAccumuloM1T1GC1Mon1.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestFunctionalAccumuloM1T1GC1Mon1.groovy b/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestFunctionalAccumuloM1T1GC1Mon1.groovy
deleted file mode 100644
index 4f07b40..0000000
--- a/slider-providers/accumulo/accumulo-funtests/src/test/groovy/org/apache/slider/providers/accumulo/funtest/TestFunctionalAccumuloM1T1GC1Mon1.groovy
+++ /dev/null
@@ -1,59 +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.providers.accumulo.funtest
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.common.params.Arguments
-import org.apache.slider.common.params.SliderActions
-
-@CompileStatic
-@Slf4j
-public class TestFunctionalAccumuloM1T1GC1Mon1 extends TestFunctionalAccumuloCluster {
-
- @Override
- public String getClusterName() {
- return "test_functional_accumulo_m1t1gc1mon1";
- }
-
- /**
- * Override point for any cluster load operations
- * @param clientConf
- * @param numWorkers
- */
- @Override
- public void clusterLoadOperations(
- String clustername,
- Map<String, Integer> roleMap,
- ClusterDescription cd) {
-
- slider(0, [
- SliderActions.ACTION_FREEZE,
- getClusterName(),
- Arguments.ARG_WAIT,
- Integer.toString(FREEZE_WAIT_TIME),
- Arguments.ARG_MESSAGE,
- "freeze-in-test-AccumuloCluster"
- ])
-
- //destroy the cluster. This only works if the permissions allow it
- destroy(0, getClusterName())
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/FunctionalHBaseClusterIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/FunctionalHBaseClusterIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/FunctionalHBaseClusterIT.groovy
new file mode 100644
index 0000000..84e55f7
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/FunctionalHBaseClusterIT.groovy
@@ -0,0 +1,223 @@
+/*
+ * 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.hbase.funtest
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.conf.Configuration
+import org.apache.hadoop.yarn.conf.YarnConfiguration
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.api.RoleKeys
+import org.apache.slider.client.SliderClient
+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.tools.ConfigHelper
+import org.apache.slider.core.registry.info.RegistryNaming
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.apache.slider.providers.hbase.HBaseConfigFileOptions
+import org.apache.slider.providers.hbase.HBaseTestUtils
+import org.apache.slider.server.appmaster.PublishedArtifacts
+import org.apache.zookeeper.KeeperException
+import org.apache.zookeeper.WatchedEvent
+import org.apache.zookeeper.Watcher
+import org.apache.zookeeper.ZKUtil
+import org.apache.zookeeper.ZooKeeper
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+
+import static org.apache.slider.providers.hbase.HBaseKeys.ROLE_MASTER
+import static org.apache.slider.providers.hbase.HBaseKeys.ROLE_WORKER
+
+@CompileStatic
+@Slf4j
+public class FunctionalHBaseClusterIT extends HBaseCommandTestBase
+ implements FuntestProperties, Arguments, SliderExitCodes {
+
+
+ public static final String HBASE_HEAP = "96m"
+
+ public String getClusterName() {
+ return "test_functional_hbase_cluster"
+ }
+
+ public String getClusterZNode() {
+ return "/yarnapps_slider_yarn_" + clusterName;
+ }
+
+ @Before
+ public void prepareCluster() {
+
+ String quorumServers = SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, DEFAULT_SLIDER_ZK_HOSTS)
+
+ ZooKeeper monitor = new ZooKeeper(quorumServers,
+ 1000, new Watcher(){
+ @Override
+ public void process(WatchedEvent watchedEvent) {
+ }
+ }, false)
+ try {
+ ZKUtil.deleteRecursive(monitor, clusterZNode)
+ } catch (KeeperException.NoNodeException ignored) {
+ log.info(clusterZNode + " not there")
+ }
+ setupCluster(clusterName)
+ }
+
+ @After
+ public void teardownCluster() {
+ teardown(clusterName)
+ }
+
+ @Test
+ public void testHBaseCreateCluster() throws Throwable {
+
+ describe description
+
+ int numWorkers = desiredWorkerCount;
+
+ def clusterpath = buildClusterPath(clusterName)
+ assert !clusterFS.exists(clusterpath)
+ Map<String, Integer> roleMap = createHBaseCluster(
+ clusterName,
+ 1, numWorkers,
+ [
+ ARG_OPTION,
+ HBaseConfigFileOptions.KEY_HBASE_MASTER_INFO_PORT,
+ Integer.toString(masterPortAssignment),
+ ARG_COMP_OPT, ROLE_MASTER, RoleKeys.JVM_HEAP, HBASE_HEAP,
+ ARG_OPTION,
+ HBaseConfigFileOptions.KEY_REGIONSERVER_PORT,
+ Integer.toString(workerPortAssignment),
+ ARG_COMP_OPT, ROLE_WORKER, RoleKeys.JVM_HEAP, HBASE_HEAP,
+ ],
+ [:]
+ )
+
+ //get a slider client against the cluster
+ SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, clusterName)
+ ClusterDescription cd2 = sliderClient.clusterDescription
+ assert clusterName == cd2.name
+
+ log.info("Connected via Client {} with {} workers", sliderClient.toString(),
+ numWorkers)
+
+ //wait for the role counts to be reached
+ waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
+
+ Configuration clientConf = HBaseTestUtils.createHBaseConfiguration(sliderClient)
+ HBaseTestUtils.assertHBaseMasterFound(clientConf)
+ HBaseTestUtils.waitForHBaseRegionServerCount(sliderClient,
+ clusterName,
+ numWorkers,
+ HBASE_LAUNCH_WAIT_TIME)
+
+ clusterOperations(
+ clusterName,
+ sliderClient,
+ clientConf,
+ numWorkers,
+ roleMap,
+ cd2)
+ }
+
+ /**
+ * Override to change policy of the deired no of workers
+ * @return
+ */
+ def int getDesiredWorkerCount() {
+ return SLIDER_CONFIG.getInt(KEY_SLIDER_TEST_NUM_WORKERS,
+ DEFAULT_SLIDER_NUM_WORKERS)
+ }
+
+
+ public String getDescription() {
+ return "Create a working HBase cluster $clusterName"
+ }
+
+ /**
+ * Override point for any cluster operations
+ * @param clustername name of cluster
+ * @param sliderClient bonded low level client
+ * @param clientConf config
+ * @param numWorkers no. of workers created
+ * @param roleMap role map
+ * @param cd current cluster
+ */
+ public void clusterOperations(
+ String clustername,
+ SliderClient sliderClient,
+ Configuration clientConf,
+ int numWorkers,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+
+ log.info("Client Configuration = " + ConfigHelper.dumpConfigToString(clientConf))
+
+ //grab some registry bits
+ registry([ARG_LIST])
+ registry([ARG_LIST, ARG_SERVICETYPE, SliderKeys.APP_TYPE , ARG_VERBOSE])
+
+ //unknown service type
+ registry(EXIT_NOT_FOUND,
+ [ARG_LIST, ARG_SERVICETYPE, "org.apache.something"])
+
+ registry(EXIT_NOT_FOUND,
+ [ARG_LIST, ARG_NAME, "cluster-with-no-name"])
+
+ // how to work out the current service name?
+ def name = RegistryNaming.createRegistryName(clustername,
+ System.getProperty("user.name"),
+ SliderKeys.APP_TYPE,
+ 1)
+ registry([ARG_LIST, ARG_VERBOSE, ARG_NAME, name])
+
+ registry([ARG_LISTCONF, ARG_NAME, name])
+ registry(EXIT_NOT_FOUND, [ARG_LISTCONF, ARG_NAME, name, ARG_INTERNAL])
+ registry(EXIT_NOT_FOUND, [ARG_LISTCONF, ARG_NAME, "unknown"])
+ registry([ARG_GETCONF, PublishedArtifacts.COMPLETE_CONFIG,
+ ARG_NAME, name])
+ registry(EXIT_NOT_FOUND, [ARG_GETCONF, "no-such-config",
+ ARG_NAME, name])
+
+ registry(EXIT_NOT_FOUND, [ARG_GETCONF, "illegal/config/name!",
+ ARG_NAME, name])
+
+ registry(EXIT_NOT_FOUND,[ARG_GETCONF, PublishedArtifacts.COMPLETE_CONFIG,
+ ARG_NAME, name, ARG_INTERNAL])
+
+
+ def yarn_site_config = PublishedArtifacts.YARN_SITE_CONFIG
+ registry([ARG_GETCONF, yarn_site_config,
+ ARG_NAME, name])
+
+ File getConfDir = new File("target/$clusterName/getconf")
+ getConfDir.mkdirs();
+ registry([ARG_GETCONF, yarn_site_config,
+ ARG_NAME, name,
+ ARG_DEST, getConfDir.absolutePath])
+ File retrieved = new File(getConfDir, yarn_site_config +".xml")
+ def confFromFile = ConfigHelper.loadConfFromFile(retrieved)
+ assert confFromFile.get(YarnConfiguration.RM_ADDRESS)
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseBuildSetupIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseBuildSetupIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseBuildSetupIT.groovy
new file mode 100644
index 0000000..0dcffde
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseBuildSetupIT.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.providers.hbase.funtest
+
+import org.apache.hadoop.conf.Configuration
+import org.apache.slider.funtest.abstracttests.AbstractTestBuildSetup
+import org.junit.Test
+
+class HBaseBuildSetupIT extends AbstractTestBuildSetup {
+
+ @Test
+ public void testHBaseBuildsHavePathsDefined() throws Throwable {
+ Configuration conf = loadSliderConf();
+
+ assumeBoolOption(conf, KEY_TEST_HBASE_ENABLED, true)
+
+ assertStringOptionSet(conf, KEY_TEST_HBASE_APPCONF)
+ assertStringOptionSet(conf, KEY_TEST_HBASE_TAR)
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterBuildDestroyIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterBuildDestroyIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterBuildDestroyIT.groovy
new file mode 100644
index 0000000..3a44e30
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterBuildDestroyIT.groovy
@@ -0,0 +1,87 @@
+/*
+ * 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.hbase.funtest
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.hadoop.fs.Path
+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.core.main.LauncherExitCodes
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.apache.slider.providers.hbase.HBaseKeys
+import org.junit.AfterClass
+import org.junit.BeforeClass
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class HBaseClusterBuildDestroyIT extends HBaseCommandTestBase
+ implements FuntestProperties, Arguments {
+
+
+ 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(0,
+ [
+ SliderActions.ACTION_BUILD,
+ CLUSTER,
+ ARG_PROVIDER, HBaseKeys.PROVIDER_HBASE,
+ ARG_ZKHOSTS,
+ SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, DEFAULT_SLIDER_ZK_HOSTS),
+ ARG_IMAGE,
+ SLIDER_CONFIG.get(KEY_TEST_HBASE_TAR),
+ ARG_CONFDIR,
+ SLIDER_CONFIG.get(KEY_TEST_HBASE_APPCONF),
+ ARG_COMPONENT, HBaseKeys.ROLE_MASTER, "1",
+ ARG_COMPONENT, HBaseKeys.ROLE_WORKER, "1",
+ ARG_OPTION, "site.hbase.master.info.port", "8180",
+ ])
+
+
+
+ assert clusterFS.exists(clusterDirPath)
+ //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(LauncherExitCodes.EXIT_FALSE, CLUSTER, true)
+ destroy(CLUSTER)
+
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterLifecycleIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterLifecycleIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterLifecycleIT.groovy
new file mode 100644
index 0000000..aca12ef
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseClusterLifecycleIT.groovy
@@ -0,0 +1,183 @@
+/*
+ * 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.hbase.funtest
+
+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.FuntestProperties
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class HBaseClusterLifecycleIT extends HBaseCommandTestBase
+ implements FuntestProperties, Arguments, SliderExitCodes {
+
+
+ static String CLUSTER = "test_cluster_lifecycle"
+
+
+ @Before
+ public void prepareCluster() {
+ setupCluster(CLUSTER)
+ }
+
+ @After
+ public void destroyCluster() {
+ teardown(CLUSTER)
+ }
+
+ @Test
+ public void testClusterLifecycle() throws Throwable {
+
+ describe "Walk a 0-role cluster through its lifecycle"
+
+
+ def clusterpath = buildClusterPath(CLUSTER)
+ assert !clusterFS.exists(clusterpath)
+
+
+ Map<String, Integer> roleMap = createHBaseCluster(CLUSTER,
+ 0,
+ 0,
+ [],
+ [:])
+
+
+ //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"
+ ])
+
+ //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)
+ freeze(CLUSTER,
+ [
+ ARG_FORCE,
+ ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
+ ARG_MESSAGE, "forced-freeze-in-test"
+ ])
+
+ //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"
+ ])
+
+
+ ClusterDescription status = killAmAndWaitForRestart(sliderClient, CLUSTER)
+
+ 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-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseIntegrationIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseIntegrationIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseIntegrationIT.groovy
new file mode 100644
index 0000000..69da02a
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseIntegrationIT.groovy
@@ -0,0 +1,69 @@
+/*
+ * 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.hbase.funtest
+
+import org.apache.hadoop.conf.Configuration
+import org.apache.hadoop.hbase.IntegrationTestIngest
+import org.apache.hadoop.hbase.IntegrationTestingUtility
+import org.apache.hadoop.util.ToolRunner
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.client.SliderClient
+import org.apache.slider.providers.hbase.HBaseConfigFileOptions;
+
+/* Runs IntegrationTestIngest on cluster
+ *
+ * Note: this test runs for about 20 minutes
+ * please set slider.test.timeout.seconds accordingly
+ */
+class HBaseIntegrationIT extends FunctionalHBaseClusterIT {
+
+ @Override
+ String getClusterName() {
+ return "test_hbase_integration"
+ }
+
+ @Override
+ void clusterOperations(
+ String clustername,
+ SliderClient sliderClient,
+ Configuration clientConf,
+ int numWorkers,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+ String parent = "/yarnapps_slider_yarn_" + clustername
+ clientConf.set(HBaseConfigFileOptions.KEY_ZNODE_PARENT, parent)
+
+ clientConf.set(IntegrationTestingUtility.IS_DISTRIBUTED_CLUSTER, "true")
+
+ String[] args = []
+ IntegrationTestIngest test = new IntegrationTestIngest();
+ test.setConf(clientConf)
+ int ret = ToolRunner.run(clientConf, test, args);
+ assert ret == 0;
+ }
+
+
+ public int getWorkerPortAssignment() {
+ return 0
+ }
+
+ public int getMasterPortAssignment() {
+ return 0
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseLoadIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseLoadIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseLoadIT.groovy
new file mode 100644
index 0000000..7393186
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseLoadIT.groovy
@@ -0,0 +1,64 @@
+/*
+ * 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.hbase.funtest
+
+import org.apache.hadoop.conf.Configuration
+import org.apache.hadoop.hbase.util.LoadTestTool
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.client.SliderClient
+import org.apache.slider.providers.hbase.HBaseConfigFileOptions
+
+class HBaseLoadIT extends FunctionalHBaseClusterIT {
+
+ @Override
+ String getClusterName() {
+ return "test_hbase_load"
+ }
+
+ @Override
+ void clusterOperations(
+ String clustername,
+ SliderClient sliderClient,
+ Configuration clientConf,
+ int numWorkers,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+ assert clustername
+ int numKeys = 4000 * numWorkers
+ String[] args = ["-tn", "test", "-write", "4:100",
+ "-num_keys", numKeys,
+ "-zk", clientConf.get(HBaseConfigFileOptions.KEY_ZOOKEEPER_QUORUM),
+ "-zk_root", clientConf.get(HBaseConfigFileOptions.KEY_ZNODE_PARENT),
+
+ ]
+ LoadTestTool loadTool = new LoadTestTool();
+ loadTool.setConf(clientConf)
+ int ret = loadTool.run(args);
+ assert ret == 0;
+ }
+
+
+ public int getWorkerPortAssignment() {
+ return 0
+ }
+
+ public int getMasterPortAssignment() {
+ return 0
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseNodeFailureIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseNodeFailureIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseNodeFailureIT.groovy
new file mode 100644
index 0000000..cd87fab
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/HBaseNodeFailureIT.groovy
@@ -0,0 +1,135 @@
+/*
+ * 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.hbase.funtest
+
+import org.apache.hadoop.conf.Configuration
+import org.apache.slider.api.ClusterDescription
+import org.apache.slider.api.RoleKeys
+import org.apache.slider.api.StatusKeys
+import org.apache.slider.client.SliderClient
+import org.apache.slider.common.params.ActionKillContainerArgs
+import org.apache.slider.providers.hbase.HBaseKeys
+import org.apache.slider.providers.hbase.HBaseTestUtils
+
+class HBaseNodeFailureIT extends FunctionalHBaseClusterIT {
+
+
+ public static final int RESTART_SLEEP_TIME = 5000
+
+ @Override
+ String getClusterName() {
+ return "test_hbase_node_failure"
+ }
+
+ @Override
+ String getDescription() {
+ "Fail containers and verify that the cluster recovers"
+ }
+
+ @Override
+ void clusterOperations(
+ String clustername,
+ SliderClient sliderClient,
+ Configuration clientConf,
+ int numWorkers,
+ Map<String, Integer> roleMap,
+ ClusterDescription cd) {
+
+
+ killInstanceOfRole(sliderClient, HBaseKeys.ROLE_WORKER)
+ // let it take
+ sleep(RESTART_SLEEP_TIME)
+
+ //wait for the role counts to be reached
+ cd = waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
+ // then expect a restart
+ HBaseTestUtils.waitForHBaseRegionServerCount(
+ sliderClient,
+ clusterName,
+ numWorkers,
+ HBASE_LAUNCH_WAIT_TIME)
+ assert cd.roles[HBaseKeys.ROLE_WORKER][RoleKeys.ROLE_FAILED_INSTANCES] == "1"
+ killInstanceOfRole(sliderClient, HBaseKeys.ROLE_WORKER)
+ // let it take
+ sleep(RESTART_SLEEP_TIME)
+ // then expect a restart
+
+ //wait for the role counts to be reached
+ cd = waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
+
+ HBaseTestUtils.waitForHBaseRegionServerCount(
+ sliderClient,
+ clusterName,
+ numWorkers,
+ HBASE_LAUNCH_WAIT_TIME)
+ assert cd.roles[HBaseKeys.ROLE_WORKER][RoleKeys.ROLE_FAILED_INSTANCES] == "2"
+
+ killInstanceOfRole(sliderClient, HBaseKeys.ROLE_MASTER)
+ // let it take
+ sleep(RESTART_SLEEP_TIME)
+
+ // wait for the role counts to be reached
+ cd = waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
+ HBaseTestUtils.waitForHBaseRegionServerCount(
+ sliderClient,
+ clusterName,
+ numWorkers,
+ HBASE_LAUNCH_WAIT_TIME)
+ assert cd.roles[HBaseKeys.ROLE_MASTER][RoleKeys.ROLE_FAILED_INSTANCES] == "1"
+
+ // now trigger AM failure
+ ClusterDescription status = killAmAndWaitForRestart(sliderClient, clusterName)
+
+ def restarted = status.getInfo(
+ StatusKeys.INFO_CONTAINERS_AM_RESTART)
+ assert restarted != null
+ assert Integer.parseInt(restarted) == 1 + numWorkers
+
+ }
+
+ /**
+ * Kill a random in instance of a role in the cluster
+ * @param sliderClient client
+ * @param role
+ * @return ID of container killed
+ */
+ public String killInstanceOfRole(
+ SliderClient sliderClient, String role) {
+ ClusterDescription cd = sliderClient.getClusterDescription()
+ def instances = cd.instances[role]
+ if (instances == null || instances.size() == 0) {
+ log.info("No instances of role $role to kill")
+ return null;
+ }
+ String id = instances[new Random().nextInt(instances.size())]
+ ActionKillContainerArgs args = new ActionKillContainerArgs()
+ args.id = id
+ sliderClient.actionKillContainer(clusterName, args)
+ return id;
+ }
+
+
+ public int getWorkerPortAssignment() {
+ return 0
+ }
+
+ public int getMasterPortAssignment() {
+ return 0
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
new file mode 100644
index 0000000..6611664
--- /dev/null
+++ b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/ImagesIT.groovy
@@ -0,0 +1,65 @@
+/*
+ * 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.hbase.funtest
+
+import org.apache.hadoop.conf.Configuration
+import org.apache.hadoop.fs.FileSystem as HadoopFS
+import org.apache.hadoop.fs.Path
+import org.apache.slider.funtest.framework.CommandTestBase
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.junit.Before
+import org.junit.Test
+
+class ImagesIT extends CommandTestBase implements FuntestProperties {
+
+
+ @Before
+ public void verifyPreconditions() {
+ assumeBoolOption(SLIDER_CONFIG, KEY_SLIDER_FUNTESTS_ENABLED, true)
+ assumeBoolOption(SLIDER_CONFIG, KEY_TEST_HBASE_ENABLED, true)
+ }
+
+ @Test
+ public void testImageExists() throws Throwable {
+
+ Configuration conf = loadSliderConf()
+ String testImage = conf.get(KEY_TEST_HBASE_TAR)
+ assert testImage
+ Path path = new Path(testImage)
+ HadoopFS fs = HadoopFS.get(
+ path.toUri(),
+ conf)
+ assert fs.exists(path)
+ }
+
+ @Test
+ public void testAppConfExists() throws Throwable {
+ Configuration conf = loadSliderConf()
+ String dir = conf.get(KEY_TEST_HBASE_APPCONF)
+
+ assert conf.get(KEY_TEST_HBASE_APPCONF)
+ Path path = new Path(dir)
+ HadoopFS fs = HadoopFS.get(
+ path.toUri(),
+ conf)
+ assert fs.exists(path)
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestFunctionalHBaseCluster.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestFunctionalHBaseCluster.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestFunctionalHBaseCluster.groovy
deleted file mode 100644
index 3415b35..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestFunctionalHBaseCluster.groovy
+++ /dev/null
@@ -1,223 +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.providers.hbase.funtest
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.yarn.conf.YarnConfiguration
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.api.RoleKeys
-import org.apache.slider.client.SliderClient
-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.tools.ConfigHelper
-import org.apache.slider.core.registry.info.RegistryNaming
-import org.apache.slider.funtest.framework.FuntestProperties
-import org.apache.slider.providers.hbase.HBaseConfigFileOptions
-import org.apache.slider.providers.hbase.HBaseTestUtils
-import org.apache.slider.server.appmaster.PublishedArtifacts
-import org.apache.zookeeper.KeeperException
-import org.apache.zookeeper.WatchedEvent
-import org.apache.zookeeper.Watcher
-import org.apache.zookeeper.ZKUtil
-import org.apache.zookeeper.ZooKeeper
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-
-import static org.apache.slider.providers.hbase.HBaseKeys.ROLE_MASTER
-import static org.apache.slider.providers.hbase.HBaseKeys.ROLE_WORKER
-
-@CompileStatic
-@Slf4j
-public class TestFunctionalHBaseCluster extends HBaseCommandTestBase
- implements FuntestProperties, Arguments, SliderExitCodes {
-
-
- public static final String HBASE_HEAP = "96m"
-
- public String getClusterName() {
- return "test_functional_hbase_cluster"
- }
-
- public String getClusterZNode() {
- return "/yarnapps_slider_yarn_" + clusterName;
- }
-
- @Before
- public void prepareCluster() {
-
- String quorumServers = SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, DEFAULT_SLIDER_ZK_HOSTS)
-
- ZooKeeper monitor = new ZooKeeper(quorumServers,
- 1000, new Watcher(){
- @Override
- public void process(WatchedEvent watchedEvent) {
- }
- }, false)
- try {
- ZKUtil.deleteRecursive(monitor, clusterZNode)
- } catch (KeeperException.NoNodeException ignored) {
- log.info(clusterZNode + " not there")
- }
- setupCluster(clusterName)
- }
-
- @After
- public void teardownCluster() {
- teardown(clusterName)
- }
-
- @Test
- public void testHBaseCreateCluster() throws Throwable {
-
- describe description
-
- int numWorkers = desiredWorkerCount;
-
- def clusterpath = buildClusterPath(clusterName)
- assert !clusterFS.exists(clusterpath)
- Map<String, Integer> roleMap = createHBaseCluster(
- clusterName,
- 1, numWorkers,
- [
- ARG_OPTION,
- HBaseConfigFileOptions.KEY_HBASE_MASTER_INFO_PORT,
- Integer.toString(masterPortAssignment),
- ARG_COMP_OPT, ROLE_MASTER, RoleKeys.JVM_HEAP, HBASE_HEAP,
- ARG_OPTION,
- HBaseConfigFileOptions.KEY_REGIONSERVER_PORT,
- Integer.toString(workerPortAssignment),
- ARG_COMP_OPT, ROLE_WORKER, RoleKeys.JVM_HEAP, HBASE_HEAP,
- ],
- [:]
- )
-
- //get a slider client against the cluster
- SliderClient sliderClient = bondToCluster(SLIDER_CONFIG, clusterName)
- ClusterDescription cd2 = sliderClient.clusterDescription
- assert clusterName == cd2.name
-
- log.info("Connected via Client {} with {} workers", sliderClient.toString(),
- numWorkers)
-
- //wait for the role counts to be reached
- waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
-
- Configuration clientConf = HBaseTestUtils.createHBaseConfiguration(sliderClient)
- HBaseTestUtils.assertHBaseMasterFound(clientConf)
- HBaseTestUtils.waitForHBaseRegionServerCount(sliderClient,
- clusterName,
- numWorkers,
- HBASE_LAUNCH_WAIT_TIME)
-
- clusterOperations(
- clusterName,
- sliderClient,
- clientConf,
- numWorkers,
- roleMap,
- cd2)
- }
-
- /**
- * Override to change policy of the deired no of workers
- * @return
- */
- def int getDesiredWorkerCount() {
- return SLIDER_CONFIG.getInt(KEY_SLIDER_TEST_NUM_WORKERS,
- DEFAULT_SLIDER_NUM_WORKERS)
- }
-
-
- public String getDescription() {
- return "Create a working HBase cluster $clusterName"
- }
-
- /**
- * Override point for any cluster operations
- * @param clustername name of cluster
- * @param sliderClient bonded low level client
- * @param clientConf config
- * @param numWorkers no. of workers created
- * @param roleMap role map
- * @param cd current cluster
- */
- public void clusterOperations(
- String clustername,
- SliderClient sliderClient,
- Configuration clientConf,
- int numWorkers,
- Map<String, Integer> roleMap,
- ClusterDescription cd) {
-
- log.info("Client Configuration = " + ConfigHelper.dumpConfigToString(clientConf))
-
- //grab some registry bits
- registry([ARG_LIST])
- registry([ARG_LIST, ARG_SERVICETYPE, SliderKeys.APP_TYPE , ARG_VERBOSE])
-
- //unknown service type
- registry(EXIT_NOT_FOUND,
- [ARG_LIST, ARG_SERVICETYPE, "org.apache.something"])
-
- registry(EXIT_NOT_FOUND,
- [ARG_LIST, ARG_NAME, "cluster-with-no-name"])
-
- // how to work out the current service name?
- def name = RegistryNaming.createRegistryName(clustername,
- System.getProperty("user.name"),
- SliderKeys.APP_TYPE,
- 1)
- registry([ARG_LIST, ARG_VERBOSE, ARG_NAME, name])
-
- registry([ARG_LISTCONF, ARG_NAME, name])
- registry(EXIT_NOT_FOUND, [ARG_LISTCONF, ARG_NAME, name, ARG_INTERNAL])
- registry(EXIT_NOT_FOUND, [ARG_LISTCONF, ARG_NAME, "unknown"])
- registry([ARG_GETCONF, PublishedArtifacts.COMPLETE_CONFIG,
- ARG_NAME, name])
- registry(EXIT_NOT_FOUND, [ARG_GETCONF, "no-such-config",
- ARG_NAME, name])
-
- registry(EXIT_NOT_FOUND, [ARG_GETCONF, "illegal/config/name!",
- ARG_NAME, name])
-
- registry(EXIT_NOT_FOUND,[ARG_GETCONF, PublishedArtifacts.COMPLETE_CONFIG,
- ARG_NAME, name, ARG_INTERNAL])
-
-
- def yarn_site_config = PublishedArtifacts.YARN_SITE_CONFIG
- registry([ARG_GETCONF, yarn_site_config,
- ARG_NAME, name])
-
- File getConfDir = new File("target/$clusterName/getconf")
- getConfDir.mkdirs();
- registry([ARG_GETCONF, yarn_site_config,
- ARG_NAME, name,
- ARG_DEST, getConfDir.absolutePath])
- File retrieved = new File(getConfDir, yarn_site_config +".xml")
- def confFromFile = ConfigHelper.loadConfFromFile(retrieved)
- assert confFromFile.get(YarnConfiguration.RM_ADDRESS)
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseBuildSetup.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseBuildSetup.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseBuildSetup.groovy
deleted file mode 100644
index c8f3be3..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseBuildSetup.groovy
+++ /dev/null
@@ -1,37 +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.providers.hbase.funtest
-
-import org.apache.hadoop.conf.Configuration
-import org.apache.slider.funtest.abstracttests.AbstractTestBuildSetup
-import org.junit.Test
-
-class TestHBaseBuildSetup extends AbstractTestBuildSetup {
-
- @Test
- public void testHBaseBuildsHavePathsDefined() throws Throwable {
- Configuration conf = loadSliderConf();
- assumeBoolOption(conf, KEY_SLIDER_FUNTESTS_ENABLED, true)
-
- assumeBoolOption(conf, KEY_TEST_HBASE_ENABLED, true)
-
- assertStringOptionSet(conf, KEY_TEST_HBASE_APPCONF)
- assertStringOptionSet(conf, KEY_TEST_HBASE_TAR)
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterBuildDestroy.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterBuildDestroy.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterBuildDestroy.groovy
deleted file mode 100644
index 3c9b8ed..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterBuildDestroy.groovy
+++ /dev/null
@@ -1,88 +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.providers.hbase.funtest
-
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import org.apache.hadoop.fs.Path
-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.core.main.LauncherExitCodes
-import org.apache.slider.funtest.framework.FuntestProperties
-import org.apache.slider.providers.hbase.HBaseKeys
-import org.junit.AfterClass
-import org.junit.BeforeClass
-import org.junit.Test
-
-@CompileStatic
-@Slf4j
-public class TestHBaseClusterBuildDestroy extends HBaseCommandTestBase
- implements FuntestProperties, Arguments {
-
-
- static String CLUSTER = "test_cluster_build_destroy"
-
-
- @BeforeClass
- public static void prepareCluster() {
- assumeFunctionalTestsEnabled();
- 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(0,
- [
- SliderActions.ACTION_BUILD,
- CLUSTER,
- ARG_PROVIDER, HBaseKeys.PROVIDER_HBASE,
- ARG_ZKHOSTS,
- SLIDER_CONFIG.get(SliderXmlConfKeys.REGISTRY_ZK_QUORUM, DEFAULT_SLIDER_ZK_HOSTS),
- ARG_IMAGE,
- SLIDER_CONFIG.get(KEY_TEST_HBASE_TAR),
- ARG_CONFDIR,
- SLIDER_CONFIG.get(KEY_TEST_HBASE_APPCONF),
- ARG_COMPONENT, HBaseKeys.ROLE_MASTER, "1",
- ARG_COMPONENT, HBaseKeys.ROLE_WORKER, "1",
- ARG_OPTION, "site.hbase.master.info.port", "8180",
- ])
-
-
-
- assert clusterFS.exists(clusterDirPath)
- //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(LauncherExitCodes.EXIT_FALSE, CLUSTER, true)
- destroy(CLUSTER)
-
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterLifecycle.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterLifecycle.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterLifecycle.groovy
deleted file mode 100644
index 01c7131..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseClusterLifecycle.groovy
+++ /dev/null
@@ -1,183 +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.providers.hbase.funtest
-
-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.FuntestProperties
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-
-@CompileStatic
-@Slf4j
-public class TestHBaseClusterLifecycle extends HBaseCommandTestBase
- implements FuntestProperties, Arguments, SliderExitCodes {
-
-
- static String CLUSTER = "test_cluster_lifecycle"
-
-
- @Before
- public void prepareCluster() {
- setupCluster(CLUSTER)
- }
-
- @After
- public void destroyCluster() {
- teardown(CLUSTER)
- }
-
- @Test
- public void testClusterLifecycle() throws Throwable {
-
- describe "Walk a 0-role cluster through its lifecycle"
-
-
- def clusterpath = buildClusterPath(CLUSTER)
- assert !clusterFS.exists(clusterpath)
-
-
- Map<String, Integer> roleMap = createHBaseCluster(CLUSTER,
- 0,
- 0,
- [],
- [:])
-
-
- //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"
- ])
-
- //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)
- freeze(CLUSTER,
- [
- ARG_FORCE,
- ARG_WAIT, Integer.toString(FREEZE_WAIT_TIME),
- ARG_MESSAGE, "forced-freeze-in-test"
- ])
-
- //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"
- ])
-
-
- ClusterDescription status = killAmAndWaitForRestart(sliderClient, CLUSTER)
-
- 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-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseIntegration.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseIntegration.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseIntegration.groovy
deleted file mode 100644
index 4bf18f6..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseIntegration.groovy
+++ /dev/null
@@ -1,69 +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.providers.hbase.funtest
-
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.hbase.IntegrationTestIngest
-import org.apache.hadoop.hbase.IntegrationTestingUtility
-import org.apache.hadoop.util.ToolRunner
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.HBaseConfigFileOptions;
-
-/* Runs IntegrationTestIngest on cluster
- *
- * Note: this test runs for about 20 minutes
- * please set slider.test.timeout.seconds accordingly
- */
-class TestHBaseIntegration extends TestFunctionalHBaseCluster {
-
- @Override
- String getClusterName() {
- return "test_hbase_integration"
- }
-
- @Override
- void clusterOperations(
- String clustername,
- SliderClient sliderClient,
- Configuration clientConf,
- int numWorkers,
- Map<String, Integer> roleMap,
- ClusterDescription cd) {
- String parent = "/yarnapps_slider_yarn_" + clustername
- clientConf.set(HBaseConfigFileOptions.KEY_ZNODE_PARENT, parent)
-
- clientConf.set(IntegrationTestingUtility.IS_DISTRIBUTED_CLUSTER, "true")
-
- String[] args = []
- IntegrationTestIngest test = new IntegrationTestIngest();
- test.setConf(clientConf)
- int ret = ToolRunner.run(clientConf, test, args);
- assert ret == 0;
- }
-
-
- public int getWorkerPortAssignment() {
- return 0
- }
-
- public int getMasterPortAssignment() {
- return 0
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseLoad.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseLoad.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseLoad.groovy
deleted file mode 100644
index 3d6c46c..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseLoad.groovy
+++ /dev/null
@@ -1,64 +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.providers.hbase.funtest
-
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.hbase.util.LoadTestTool
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.client.SliderClient
-import org.apache.slider.providers.hbase.HBaseConfigFileOptions
-
-class TestHBaseLoad extends TestFunctionalHBaseCluster {
-
- @Override
- String getClusterName() {
- return "test_hbase_load"
- }
-
- @Override
- void clusterOperations(
- String clustername,
- SliderClient sliderClient,
- Configuration clientConf,
- int numWorkers,
- Map<String, Integer> roleMap,
- ClusterDescription cd) {
- assert clustername
- int numKeys = 4000 * numWorkers
- String[] args = ["-tn", "test", "-write", "4:100",
- "-num_keys", numKeys,
- "-zk", clientConf.get(HBaseConfigFileOptions.KEY_ZOOKEEPER_QUORUM),
- "-zk_root", clientConf.get(HBaseConfigFileOptions.KEY_ZNODE_PARENT),
-
- ]
- LoadTestTool loadTool = new LoadTestTool();
- loadTool.setConf(clientConf)
- int ret = loadTool.run(args);
- assert ret == 0;
- }
-
-
- public int getWorkerPortAssignment() {
- return 0
- }
-
- public int getMasterPortAssignment() {
- return 0
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e1258c8a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseNodeFailure.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseNodeFailure.groovy b/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseNodeFailure.groovy
deleted file mode 100644
index fab73b3..0000000
--- a/slider-providers/hbase/hbase-funtests/src/test/groovy/org/apache/slider/providers/hbase/funtest/TestHBaseNodeFailure.groovy
+++ /dev/null
@@ -1,135 +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.providers.hbase.funtest
-
-import org.apache.hadoop.conf.Configuration
-import org.apache.slider.api.ClusterDescription
-import org.apache.slider.api.RoleKeys
-import org.apache.slider.api.StatusKeys
-import org.apache.slider.client.SliderClient
-import org.apache.slider.common.params.ActionKillContainerArgs
-import org.apache.slider.providers.hbase.HBaseKeys
-import org.apache.slider.providers.hbase.HBaseTestUtils
-
-class TestHBaseNodeFailure extends TestFunctionalHBaseCluster {
-
-
- public static final int RESTART_SLEEP_TIME = 5000
-
- @Override
- String getClusterName() {
- return "test_hbase_node_failure"
- }
-
- @Override
- String getDescription() {
- "Fail containers and verify that the cluster recovers"
- }
-
- @Override
- void clusterOperations(
- String clustername,
- SliderClient sliderClient,
- Configuration clientConf,
- int numWorkers,
- Map<String, Integer> roleMap,
- ClusterDescription cd) {
-
-
- killInstanceOfRole(sliderClient, HBaseKeys.ROLE_WORKER)
- // let it take
- sleep(RESTART_SLEEP_TIME)
-
- //wait for the role counts to be reached
- cd = waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
- // then expect a restart
- HBaseTestUtils.waitForHBaseRegionServerCount(
- sliderClient,
- clusterName,
- numWorkers,
- HBASE_LAUNCH_WAIT_TIME)
- assert cd.roles[HBaseKeys.ROLE_WORKER][RoleKeys.ROLE_FAILED_INSTANCES] == "1"
- killInstanceOfRole(sliderClient, HBaseKeys.ROLE_WORKER)
- // let it take
- sleep(RESTART_SLEEP_TIME)
- // then expect a restart
-
- //wait for the role counts to be reached
- cd = waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
-
- HBaseTestUtils.waitForHBaseRegionServerCount(
- sliderClient,
- clusterName,
- numWorkers,
- HBASE_LAUNCH_WAIT_TIME)
- assert cd.roles[HBaseKeys.ROLE_WORKER][RoleKeys.ROLE_FAILED_INSTANCES] == "2"
-
- killInstanceOfRole(sliderClient, HBaseKeys.ROLE_MASTER)
- // let it take
- sleep(RESTART_SLEEP_TIME)
-
- // wait for the role counts to be reached
- cd = waitForRoleCount(sliderClient, roleMap, HBASE_LAUNCH_WAIT_TIME)
- HBaseTestUtils.waitForHBaseRegionServerCount(
- sliderClient,
- clusterName,
- numWorkers,
- HBASE_LAUNCH_WAIT_TIME)
- assert cd.roles[HBaseKeys.ROLE_MASTER][RoleKeys.ROLE_FAILED_INSTANCES] == "1"
-
- // now trigger AM failure
- ClusterDescription status = killAmAndWaitForRestart(sliderClient, clusterName)
-
- def restarted = status.getInfo(
- StatusKeys.INFO_CONTAINERS_AM_RESTART)
- assert restarted != null
- assert Integer.parseInt(restarted) == 1 + numWorkers
-
- }
-
- /**
- * Kill a random in instance of a role in the cluster
- * @param sliderClient client
- * @param role
- * @return ID of container killed
- */
- public String killInstanceOfRole(
- SliderClient sliderClient, String role) {
- ClusterDescription cd = sliderClient.getClusterDescription()
- def instances = cd.instances[role]
- if (instances == null || instances.size() == 0) {
- log.info("No instances of role $role to kill")
- return null;
- }
- String id = instances[new Random().nextInt(instances.size())]
- ActionKillContainerArgs args = new ActionKillContainerArgs()
- args.id = id
- sliderClient.actionKillContainer(clusterName, args)
- return id;
- }
-
-
- public int getWorkerPortAssignment() {
- return 0
- }
-
- public int getMasterPortAssignment() {
- return 0
- }
-}
[7/7] git commit: Merge branch 'develop' of
https://git-wip-us.apache.org/repos/asf/incubator-slider into develop
Posted by bi...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/incubator-slider into develop
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8e4310fb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8e4310fb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8e4310fb
Branch: refs/heads/develop
Commit: 8e4310fb92d4023ff0a60d483a8d9c1a7d19a09d
Parents: 90e8fb1 41e3444
Author: Billie Rinaldi <bi...@gmail.com>
Authored: Wed Jul 16 17:20:56 2014 -0700
Committer: Billie Rinaldi <bi...@gmail.com>
Committed: Wed Jul 16 17:20:56 2014 -0700
----------------------------------------------------------------------
.../org/apache/slider/server/appmaster/SliderAppMaster.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------