From 146bf34d8684d6dcd840b881383b91f54f09eac5 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Mon, 3 Apr 2017 13:11:07 +0100 Subject: [PATCH] More test environments --- its/environments/README.md | 60 +++++++++---------- its/environments/debian-jdk7/Dockerfile | 18 ++++++ its/environments/debian-jdk8/Dockerfile | 18 ++++++ its/environments/fedora-jdk8/Dockerfile | 31 ++++++++++ its/environments/solaris-10-jdk7/.gitignore | 1 + its/environments/solaris-10-jdk7/Makefile | 6 +- its/environments/solaris-10-jdk7/Vagrantfile | 6 +- its/environments/solaris-10-jdk8/.gitignore | 3 + its/environments/solaris-10-jdk8/Makefile | 29 +++++++++ its/environments/solaris-10-jdk8/Vagrantfile | 51 ++++++++++++++++ its/environments/solaris-10-jdk8/admin | 10 ++++ .../solaris-10-jdk8/apache-maven-3.3.9.patch | 22 +++++++ 12 files changed, 220 insertions(+), 35 deletions(-) create mode 100644 its/environments/debian-jdk7/Dockerfile create mode 100644 its/environments/debian-jdk8/Dockerfile create mode 100644 its/environments/fedora-jdk8/Dockerfile create mode 100644 its/environments/solaris-10-jdk8/.gitignore create mode 100644 its/environments/solaris-10-jdk8/Makefile create mode 100644 its/environments/solaris-10-jdk8/Vagrantfile create mode 100644 its/environments/solaris-10-jdk8/admin create mode 100644 its/environments/solaris-10-jdk8/apache-maven-3.3.9.patch diff --git a/its/environments/README.md b/its/environments/README.md index dde0617efa..bb8df3fa89 100644 --- a/its/environments/README.md +++ b/its/environments/README.md @@ -1,38 +1,38 @@ - - http://www.apache.org/licenses/LICENSE-2.0 + # Integration Test Environments -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. ---> -Integration Test Environments -============================= +This directory contains definitions for different test environments. -This directory contains [Vagrant](https://www.vagrantup.com/) definitions for the more exotic test environments. +## Linux based test environments -The test environments all require [Virtualbox](https://www.virtualbox.org/wiki/Downloads) as the vargrant provider. +The linux based test environments use [Docker] and will have a `Dockerfile`. -NOTE: Where there are additional downloads required to populate the base box image, there will be a `Makefile` in the environment directory. -In these cases you will need to run `make build` before `vagrant up` will work. +The test procedure will typically be something like this: + +``` +$ ID=$(docker build -q .) && docker run --rm -t -i $ID bash +$ cd $HOME +$ git clone https://git-wip-us.apache.org/repos/asf/maven.git +$ ( cd maven && mvn clean verify ) +$ git clone https://git-wip-us.apache.org/repos/asf/maven-integration-testing.git +$ ( cd maven-integration-testing && mvn clean install -Prun-its -Dmaven.repo.local=$HOME/work/repo -DmavenDistro=$HOME/maven/apache-maven/target/apache-maven-...-bin.zip ) +``` + +## Other operating systems + +The non-linux based test environments use [Vagrant](https://www.vagrantup.com/) and will have a `Vagrantfile`. + +The Vagrant based test environments all require [Virtualbox](https://www.virtualbox.org/wiki/Downloads) as the vagrant provider. + +NOTE: Where there are additional downloads required to populate the base box image, there will be a `Makefile` in the environment directory. In these cases you will need to run `make` before `vagrant up` will work. For most unixes the test procedure will be something like: - $ vagrant ssh - $ git clone https://git-wip-us.apache.org/repos/asf/maven.git - $ cd maven - $ mvn clean verify -D - $ cd .. - $ git clone https://git-wip-us.apache.org/repos/asf/maven-integration-testing.git - $ cd maven-integration-testing - $ mvn clean install -Prun-its -Dmaven.repo.local=$HOME/work/repo -DmavenDistro=$HOME/maven/apache-maven/target/apache-maven-...-bin.zip +``` +$ vagrant ssh +$ git clone https://git-wip-us.apache.org/repos/asf/maven.git +$ ( cd maven && mvn clean verify ) +$ git clone https://git-wip-us.apache.org/repos/asf/maven-integration-testing.git +$ ( cd maven-integration-testing && mvn clean install -Prun-its -Dmaven.repo.local=$HOME/work/repo -DmavenDistro=$HOME/maven/apache-maven/target/apache-maven-...-bin.zip ) +``` diff --git a/its/environments/debian-jdk7/Dockerfile b/its/environments/debian-jdk7/Dockerfile new file mode 100644 index 0000000000..dbaa8d1152 --- /dev/null +++ b/its/environments/debian-jdk7/Dockerfile @@ -0,0 +1,18 @@ +# 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. + +FROM maven:3-jdk-7 diff --git a/its/environments/debian-jdk8/Dockerfile b/its/environments/debian-jdk8/Dockerfile new file mode 100644 index 0000000000..ed4fcab175 --- /dev/null +++ b/its/environments/debian-jdk8/Dockerfile @@ -0,0 +1,18 @@ +# 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. + +FROM maven:3-jdk-8 diff --git a/its/environments/fedora-jdk8/Dockerfile b/its/environments/fedora-jdk8/Dockerfile new file mode 100644 index 0000000000..bcbd42d57f --- /dev/null +++ b/its/environments/fedora-jdk8/Dockerfile @@ -0,0 +1,31 @@ +# 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. + +FROM fedora:latest + +RUN dnf update -y && dnf install -y java-1.8.0-openjdk-devel git && dnf clean all + +ARG MAVEN_VERSION=3.3.9 +ARG USER_HOME_DIR="/root" + +RUN mkdir -p /usr/share/maven /usr/share/maven/ref \ + && curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \ + | tar -xzC /usr/share/maven --strip-components=1 \ + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn + +ENV MAVEN_HOME /usr/share/maven +ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2" diff --git a/its/environments/solaris-10-jdk7/.gitignore b/its/environments/solaris-10-jdk7/.gitignore index 3b8269141d..5df164ca0d 100644 --- a/its/environments/solaris-10-jdk7/.gitignore +++ b/its/environments/solaris-10-jdk7/.gitignore @@ -1,2 +1,3 @@ +.vagrant/ *.Z *.gz diff --git a/its/environments/solaris-10-jdk7/Makefile b/its/environments/solaris-10-jdk7/Makefile index 35c6719f4b..f8880f3787 100644 --- a/its/environments/solaris-10-jdk7/Makefile +++ b/its/environments/solaris-10-jdk7/Makefile @@ -5,15 +5,17 @@ # 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. +.PHONY: default +default: build clean: rm -f jdk-7u80-solaris-i586.tar.Z jdk-7u80-solaris-x64.tar.Z apache-maven-3.3.9-bin.tar.gz diff --git a/its/environments/solaris-10-jdk7/Vagrantfile b/its/environments/solaris-10-jdk7/Vagrantfile index 893bd53cf8..bbfacea98e 100644 --- a/its/environments/solaris-10-jdk7/Vagrantfile +++ b/its/environments/solaris-10-jdk7/Vagrantfile @@ -8,9 +8,9 @@ # 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 @@ -44,7 +44,7 @@ Vagrant.configure("2") do |config| sudo patch -i apache-maven-3.3.9.patch /opt/apache-maven-3.3.9/bin/mvn &&\ sudo ln -s /opt/apache-maven-3.3.9/bin/mvn /usr/bin/mvn &&\ rm -rf apache-maven-3.3.9-bin.tar.gz apache-maven-3.3.9.patch &&\ - sudo sh -c "echo JAVA_HOME= >> /etc/profile" &&\ + sudo sh -c "echo JAVA_HOME=/usr/jdk/jdk1.7.0_80 >> /etc/profile" &&\ sudo sh -c "echo export JAVA_HOME >> /etc/profile" &&\ sudo sh -c "echo MAVEN_HOME=/opt/apache-maven-3.3.9 >> /etc/profile" &&\ sudo sh -c "echo export MAVEN_HOME >> /etc/profile" &&\ diff --git a/its/environments/solaris-10-jdk8/.gitignore b/its/environments/solaris-10-jdk8/.gitignore new file mode 100644 index 0000000000..5df164ca0d --- /dev/null +++ b/its/environments/solaris-10-jdk8/.gitignore @@ -0,0 +1,3 @@ +.vagrant/ +*.Z +*.gz diff --git a/its/environments/solaris-10-jdk8/Makefile b/its/environments/solaris-10-jdk8/Makefile new file mode 100644 index 0000000000..dae0e3c6bf --- /dev/null +++ b/its/environments/solaris-10-jdk8/Makefile @@ -0,0 +1,29 @@ +# 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. +.PHONY: default +default: build + +clean: + rm -f jdk-7u80-solaris-x64.tar.Z apache-maven-3.3.9-bin.tar.gz + +jdk-8u121-solaris-x64.tar.Z: + wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-solaris-x64.tar.Z + +apache-maven-3.3.9-bin.tar.gz: + wget --no-check-certificate https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz + +build: jdk-8u121-solaris-x64.tar.Z apache-maven-3.3.9-bin.tar.gz diff --git a/its/environments/solaris-10-jdk8/Vagrantfile b/its/environments/solaris-10-jdk8/Vagrantfile new file mode 100644 index 0000000000..1bfb6eed39 --- /dev/null +++ b/its/environments/solaris-10-jdk8/Vagrantfile @@ -0,0 +1,51 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +# +# 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. + +Vagrant.configure("2") do |config| + config.vm.box = "tnarik/solaris10-minimal" + + config.vm.provider "virtualbox" do |v| + v.memory = 2048 + v.cpus = 2 + end + + config.vm.provision "file", source:"jdk-8u121-solaris-x64.tar.Z", destination:"jdk-8u121-solaris-x64.tar.Z" + config.vm.provision "file", source:"apache-maven-3.3.9-bin.tar.gz", destination:"apache-maven-3.3.9-bin.tar.gz" + config.vm.provision "file", source:"apache-maven-3.3.9.patch", destination:"apache-maven-3.3.9.patch" + config.vm.provision "file", source:"admin", destination:"admin" + config.vm.provision "shell", inline: <<-SHELL + sudo pkgadd -d http://get.opencsw.org/now -a/export/home/vagrant/admin CSWpkgutil &&\ + sudo /opt/csw/bin/pkgutil -U &&\ + sudo /opt/csw/bin/pkgutil -y -i git &&\ + zcat jdk-8u121-solaris-x64.tar.Z | tar xf - > /dev/null 2>&1 &&\ + sudo pkgadd -n -a/export/home/vagrant/admin -d . SUNWj8rt SUNWj8dev SUNWj8cfg SUNWj8man > /dev/null 2>&1 &&\ + sudo rm -rf jdk-8u121-solaris-x64.tar.Z SUNWj8cfg SUNWj8dev SUNWj8jmp SUNWj8man SUNWj8rt COPYRIGHT LICENSE README.html THIRDPARTYLICENSEREADME.txt admin > /dev/null 2>&1 &&\ + gunzip -c apache-maven-3.3.9-bin.tar.gz | sudo sh -c "cd /opt; tar xf - " 2>&1 &&\ + sudo patch -i apache-maven-3.3.9.patch /opt/apache-maven-3.3.9/bin/mvn &&\ + sudo ln -s /opt/apache-maven-3.3.9/bin/mvn /usr/bin/mvn &&\ + rm -rf apache-maven-3.3.9-bin.tar.gz apache-maven-3.3.9.patch &&\ + sudo sh -c "echo JAVA_HOME=/usr/jdk/jdk1.8.0_121 >> /etc/profile" &&\ + sudo sh -c "echo export JAVA_HOME >> /etc/profile" &&\ + sudo sh -c "echo MAVEN_HOME=/opt/apache-maven-3.3.9 >> /etc/profile" &&\ + sudo sh -c "echo export MAVEN_HOME >> /etc/profile" &&\ + sudo sh -c "echo PATH=${MAVEN_HOME}/bin:${PATH} >> /etc/profile" &&\ + sudo sh -c "echo export PATH >> /etc/profile" + SHELL +end diff --git a/its/environments/solaris-10-jdk8/admin b/its/environments/solaris-10-jdk8/admin new file mode 100644 index 0000000000..07b56b27fc --- /dev/null +++ b/its/environments/solaris-10-jdk8/admin @@ -0,0 +1,10 @@ +mail=overwrite +partial=nocheck +runlevel=nocheck +idepend=nocheck +rdepend=nocheck +space=nocheck +setuid=nocheck +conflict=nocheck +action=nocheck +basedir=default diff --git a/its/environments/solaris-10-jdk8/apache-maven-3.3.9.patch b/its/environments/solaris-10-jdk8/apache-maven-3.3.9.patch new file mode 100644 index 0000000000..e6d436c7d1 --- /dev/null +++ b/its/environments/solaris-10-jdk8/apache-maven-3.3.9.patch @@ -0,0 +1,22 @@ +200,203c200,201 +< local basedir +< local wdir +< basedir="$(pwd)" +< wdir="$(pwd)" +--- +> basedir=`pwd` +> wdir=`pwd` +209c207 +< wdir="$(cd "$wdir/.."; pwd)" +--- +> wdir=`cd "$wdir/.."; pwd` +217c215 +< echo "$(tr -s '\n' ' ' < "$1")" +--- +> echo "`tr -s '\n' ' ' < "$1"`" +221,222c219,220 +< MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(find_maven_basedir)}" +< MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" +--- +> MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir`}" +> MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"` $MAVEN_OPTS"