Repository: bigtop Updated Branches: refs/heads/master 835987514 -> 3a987865c
BIGTOP-976. package deployment tests are CDH specific: _has_ to be removed or fixed Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/3a987865 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/3a987865 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/3a987865 Branch: refs/heads/master Commit: 3a987865cc403057efc8dd883b1c3c6c5f536c74 Parents: 8359875 Author: Konstantin Boudnik <[email protected]> Authored: Sun Mar 19 22:44:45 2017 -0700 Committer: Konstantin Boudnik <[email protected]> Committed: Sun Mar 19 22:44:45 2017 -0700 ---------------------------------------------------------------------- .../bigtop/itest/packagesmoke/BTServices.groovy | 7 - .../packagesmoke/CDHUpgradeSequence.groovy | 55 -------- .../bigtop/itest/packagesmoke/DeployCDH.groovy | 129 ------------------- .../TestPackagesPseudoDistributedUpgrade.groovy | 1 - 4 files changed, 192 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/3a987865/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/BTServices.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/BTServices.groovy b/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/BTServices.groovy index b217c72..2717d26 100644 --- a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/BTServices.groovy +++ b/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/BTServices.groovy @@ -73,13 +73,6 @@ class BTServices { static final Map<String, List<String>> release2services = [ "bigtop": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume"], - "2": ["HDFS", "mapreduce", "hive"], - "3b2": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume", "hue"], - "3b3": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume", "sqoop", "hue"], - "3b4": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume", "sqoop", "hue"], - "3u0": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume", "sqoop", "hue"], - "3u1": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume", "sqoop", "hue"], - "3": ["HDFS", "mapreduce", "hive", "HBase", "zookeeper", "oozie", "flume"], ]; public static Map getServices(String release) { http://git-wip-us.apache.org/repos/asf/bigtop/blob/3a987865/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/CDHUpgradeSequence.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/CDHUpgradeSequence.groovy b/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/CDHUpgradeSequence.groovy deleted file mode 100644 index 025f284..0000000 --- a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/CDHUpgradeSequence.groovy +++ /dev/null @@ -1,55 +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 - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * 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.bigtop.itest.packagesmoke - -import org.apache.bigtop.itest.shell.Shell - -class CDHUpgradeSequence { - private static Shell shRoot = new Shell("/bin/bash", "root"); - private static Shell shHDFS = new Shell("/bin/bash", "hdfs"); - - public static String getScript(String pkg, String from, String to) { - return ""; - } - - public static int execute(String pkg, String from, String to) { - if (pkg == "hadoop-0.20-namenode" && (from == "2" || from == "3b2")) { - // su hadoop -s /bin/bash -c "jps" - // chgrp hadoop /var/log/hadoop-0.20 - // chmod g+w /var/log/hadoop-0.20 - // chown mapred /var/log/hadoop-0.20/userlogs - // sudo -u hdfs hadoop fs -mkdir /user/joe - // sudo -u hdfs hadoop fs -chown joe /user/joe - // sudo -u hdfs hadoop fs -chmod 1777 /tmp - return shRoot.exec(""" - chown -R hdfs:hadoop /var/lib/hadoop-0.20/cache/hadoop/dfs && - chown -R mapred:hadoop /var/lib/hadoop-0.20/cache/hadoop/mapred && - ln -s hadoop /var/lib/hadoop-0.20/cache/hdfs && - service hadoop-0.20-namenode upgrade && - service hadoop-0.20-datanode start && - sleep 61 - """).getRet() + - shHDFS.exec("""hadoop dfsadmin -finalizeUpgrade && - hadoop fs -chown mapred /mapred/system || /bin/true - """).getRet() + - shRoot.exec("service hadoop-0.20-datanode stop").getRet() + - shRoot.exec("service hadoop-0.20-namenode stop").getRet(); - } - return 0; - } -} http://git-wip-us.apache.org/repos/asf/bigtop/blob/3a987865/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/DeployCDH.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/DeployCDH.groovy b/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/DeployCDH.groovy deleted file mode 100644 index 993ed41..0000000 --- a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/DeployCDH.groovy +++ /dev/null @@ -1,129 +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 - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * 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.bigtop.itest.packagesmoke - -import org.junit.Test -import org.apache.bigtop.itest.pmanager.PackageManager -import org.apache.bigtop.itest.pmanager.PackageInstance -import org.hamcrest.Matcher -import org.junit.Rule -import org.junit.rules.ErrorCollector -import static org.hamcrest.CoreMatchers.equalTo - -class DeployCDH { - List<String> cdh2 = [ - "hadoop-0.20", "hadoop-0.20-conf-pseudo", "hadoop-0.20-datanode", - "hadoop-0.20-fuse", "hadoop-0.20-jobtracker", "hadoop-0.20-namenode", "hadoop-0.20-native", - "hadoop-0.20-pipes", "hadoop-0.20-secondarynamenode", "hadoop-0.20-source", - "hadoop-0.20-tasktracker", "hadoop-hive", "hadoop-pig"]; - List<String> cdh3b2 = [ - "flume", "flume-master", "flume-agent", "hadoop-0.20", "hadoop-0.20-conf-pseudo", "hadoop-0.20-conf-pseudo-hue", - "hadoop-0.20-datanode", "hadoop-0.20-fuse", "hadoop-0.20-jobtracker", "hadoop-0.20-namenode", "hadoop-0.20-native", - "hadoop-0.20-pipes", "hadoop-0.20-secondarynamenode", "hadoop-0.20-source", - "hadoop-0.20-tasktracker", "hadoop-hbase", - "hadoop-hbase-master", "hadoop-hbase-regionserver", "hadoop-hbase-thrift", "hadoop-hive", "hadoop-pig", - "hadoop-zookeeper", "hadoop-zookeeper-server", "hue", "hue-about", "hue-beeswax", "hue-common", - "hue-filebrowser", "hue-help", "hue-jobbrowser", "hue-jobsub", "hue-plugins", "hue-proxy", - "hue-useradmin", "oozie", "sqoop"]; - List<String> cdh3b3 = [ - "flume", "flume-master", "flume-agent", "hadoop-0.20", "hadoop-0.20-conf-pseudo", - "hadoop-0.20-datanode", "hadoop-0.20-fuse", "hadoop-0.20-jobtracker", "hadoop-0.20-namenode", "hadoop-0.20-native", - "hadoop-0.20-pipes", "hadoop-0.20-sbin", "hadoop-0.20-secondarynamenode", "hadoop-0.20-source", - "hadoop-0.20-tasktracker", "hadoop-hbase", "hadoop-hbase-doc", - "hadoop-hbase-master", "hadoop-hbase-regionserver", "hadoop-hbase-thrift", "hadoop-hive", "hadoop-pig", - "hadoop-zookeeper", "hadoop-zookeeper-server", "hue", "hue-about", "hue-beeswax", "hue-common", - "hue-filebrowser", "hue-help", "hue-jobbrowser", "hue-jobsub", "hue-plugins", "hue-proxy", - "hue-useradmin", "oozie", "oozie-client", "sqoop", "sqoop-metastore"]; - - List<String> aptPkg = ["hadoop-0.20-doc", "libhdfs0", "libhdfs0-dev", "python-hive"]; - List<String> yumPkg = ["hadoop-0.20-debuginfo", "hadoop-0.20-libhdfs"]; - List<String> zypperPkg = ["hadoop-0.20-libhdfs", "hadoop-0.20-doc"]; - - Map<String, LinkedHashMap<String, Collection>> distPackages = [ - "2": ["apt": cdh2 + aptPkg, - "yum": cdh2 + yumPkg + ["hadoop-0.20-docs", "hadoop-hive-webinterface"], - "zypper": [], - // "cloudera-desktop", "cloudera-desktop-plugins", - ], - "3b2": ["apt": cdh3b2 + aptPkg, - "yum": cdh3b2 + yumPkg + ["hadoop-0.20-docs", "hadoop-hive-webinterface"], - "zypper": [], - ], - "3b3": ["apt": cdh3b3 + aptPkg + ["hadoop-hbase-doc",], - "yum": cdh3b3 + yumPkg + ["hadoop-0.20-docs", "hadoop-hive-webinterface"], - "zypper": [], - ], - "3b4": ["apt": cdh3b3 + aptPkg + ["hadoop-hbase-doc",], - "yum": cdh3b3 + yumPkg + ["hadoop-0.20-doc", "hadoop-hive-webinterface"], - "zypper": cdh3b3 + zypperPkg, - ], - "3": ["apt": cdh3b3 + aptPkg + ["hadoop-hbase-doc",], - "yum": cdh3b3 + yumPkg + ["hadoop-0.20-doc"], - "zypper": cdh3b3 + zypperPkg, - ], - "3u0": ["apt": cdh3b3 + aptPkg + ["hadoop-hbase-doc",], - "yum": cdh3b3 + yumPkg + ["hadoop-0.20-doc"], - "zypper": cdh3b3 + zypperPkg, - ], - "3u1": ["apt": cdh3b3 + aptPkg + ["hadoop-hbase-doc",], - "yum": cdh3b3 + yumPkg + ["hadoop-0.20-doc"], - "zypper": cdh3b3 + zypperPkg, - ], - ]; - - @Rule - public ErrorCollector errors = new ErrorCollector(); - - @Test - void deployCDH() { - PackageTestRepoMgr oldRepo = new PackageTestRepoMgr("cdh.prev.repo"); - PackageManager pm = oldRepo.getPm(); - - List<String> packages = (distPackages[System.getProperty("cdh.prev.repo.version", "3b4")] ?: [:])[pm.type] ?: []; - - oldRepo.addRepo(); - checkThat("failed to add repository for pre-upgrade CDH deployment", - oldRepo.getPm().refresh(), equalTo(0)); - - // Lets try to remove existing packages -- just in case - List stalePkgs = []; - distPackages.each { key, value -> stalePkgs.addAll(value[pm.type]); } - (stalePkgs as Set).each { - PackageInstance pkg = PackageInstance.getPackageInstance(pm, it); - pkg.remove(); - } - - packages.each { - PackageInstance pkg = PackageInstance.getPackageInstance(pm, it); - // Some packages get installed as requirement for others that we install. - // We don't want to install them for a second time. - if (!pkg.isInstalled()) { - checkThat("failed to install required package ${pkg.getName()}", - pkg.install(), equalTo(0)); - } - pkg.getServices().each { it.value.stop(); } - } - - oldRepo.removeRepo(); - } - - public void checkThat(String msg, Object value, Matcher<Object> matcher) { - PackageTestErrorProxy.checkThat(errors, msg, value, matcher); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/bigtop/blob/3a987865/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/TestPackagesPseudoDistributedUpgrade.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/TestPackagesPseudoDistributedUpgrade.groovy b/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/TestPackagesPseudoDistributedUpgrade.groovy index 7aa8ca6..448b705 100644 --- a/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/TestPackagesPseudoDistributedUpgrade.groovy +++ b/bigtop-tests/test-artifacts/package/src/main/groovy/org/apache/bigtop/itest/packagesmoke/TestPackagesPseudoDistributedUpgrade.groovy @@ -23,7 +23,6 @@ import org.junit.runner.RunWith @RunWith(Suite.class) @Suite.SuiteClasses([ -DeployCDH.class, TestServicesCreateState.class, TestPackagesPseudoDistributed.class, TestServicesCreateStateMissing.class,
