Add Vagrant support for openSUSE Leap 42.1

There are currently no openSUSE images on OpenStack CI so add openSUSE
Leap 42.1 in the Vagrantfile as a temporary solution for testing this
ansible module.

Change-Id: I36755fb7305628a0ee6a783af0c770f8aaa14bf5
This commit is contained in:
Markos Chandras 2017-03-27 07:19:49 +01:00
parent 0ea8c8ee66
commit 871e31911d
3 changed files with 71 additions and 33 deletions

10
Vagrantfile vendored
View File

@ -12,4 +12,14 @@ Vagrant.configure(2) do |config|
./run_tests.sh
SHELL
end
config.vm.define "opensuse421" do |leap421|
leap421.vm.box = "opensuse/openSUSE-42.1-x86_64"
leap421.vm.provision "shell", inline: <<-SHELL
sudo su -
cd /vagrant
./run_tests.sh
SHELL
end
end

View File

@ -18,25 +18,34 @@ libffi-dev [platform:dpkg]
python2.7 [platform:dpkg]
python-dev [platform:dpkg]
# Base requirements for CentOS
# Base requirements for RPM distros
gcc [platform:rpm]
gcc-c++ [platform:rpm]
git [platform:rpm]
python-devel [platform:rpm]
libffi-devel [platform:rpm]
openssl-devel [platform:rpm]
# Base requirements for CentOS
git [platform:centos]
libffi-devel [platform:centos]
openssl-devel [platform:centos]
# Base requirements for openSUSE Leap 42.1
git-core [platform:suselinux]
libffi-devel-gcc5 [platform:suselinux]
libopenssl-devel [platform:suselinux]
# For SELinux
libselinux-python [platform:rpm]
libsemanage-python [platform:rpm]
libselinux-python [platform:centos]
libsemanage-python [platform:centos]
# For SSL SNI support
python-pyasn1 [platform:dpkg]
python-openssl [platform:dpkg]
python-ndg-httpsclient [platform:ubuntu]
python2-pyasn1 [platform:rpm]
python2-pyOpenSSL [platform:rpm]
python-ndg_httpsclient [platform:rpm]
python2-pyasn1 [platform:rpm !platform:suselinux]
python-pyasn1 [platform:suselinux]
python2-pyOpenSSL [platform:rpm !platform:suselinux]
python-pyOpenSSL [platform:suselinux]
python-ndg_httpsclient [platform:rpm !platform:suselinux]
# Required for compressing collected log files in CI
gzip

View File

@ -13,24 +13,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -o pipefail
set -euov
FUNCTIONAL_TEST=${FUNCTIONAL_TEST:-true}
# Install python2 for Ubuntu 16.04 and CentOS 7
# Start fresh
rm -rf .tox
if which apt-get; then
sudo apt-get update && sudo apt-get install -y python
fi
if which yum; then
sudo yum install -y python
# Install python2 for Ubuntu 16.04,CentOS 7 and openSUSE Leap 42.1
if which apt-get &>/dev/null && ! which zypper &>/dev/null; then
sudo apt-get update && sudo apt-get install -y python-dev
elif which yum &>/dev/null; then
sudo yum install -y python-devel
elif which zypper &>/dev/null; then
# Need to pull libffi and python-pyOpenSSL early
# because we install ndg-httpsclient from pip
sudo zypper -n in python-devel libffi-devel python-pyOpenSSL
fi
# Install pip
if [ ! "$(which pip)" ]; then
curl --silent --show-error --retry 5 \
https://bootstrap.pypa.io/get-pip.py | sudo python2.7
if ! which pip &>/dev/null; then
curl --silent --show-error --retry 5 \
https://bootstrap.pypa.io/get-pip.py | sudo python2.7
fi
# Install bindep and tox
@ -39,27 +44,41 @@ sudo pip install bindep tox
# CentOS 7 requires two additional packages:
# redhat-lsb-core - for bindep profile support
# epel-release - required to install python-ndg_httpsclient/python2-pyasn1
if [ "$(which yum)" ]; then
if which yum &>/dev/null; then
sudo yum -y install redhat-lsb-core epel-release
# openSUSE 42.1 does not have python-ndg-httpsclient
elif which zypper &>/dev/null; then
pip install ndg-httpsclient
fi
# Get a list of packages to install with bindep. If packages need to be
# installed, bindep exits with an exit code of 1.
BINDEP_PKGS=$(bindep -b -f bindep.txt test || true)
echo "Packages to install: ${BINDEP_PKGS}"
# Install OS packages using bindep
if apt-get -v >/dev/null 2>&1 ; then
sudo apt-get update
DEBIAN_FRONTEND=noninteractive \
sudo apt-get -q --option "Dpkg::Options::=--force-confold" \
--assume-yes install `bindep -b -f bindep.txt test`
else
sudo yum install -y `bindep -b -f bindep.txt test`
if [[ ${#BINDEP_PKGS} > 0 ]]; then
if which apt-get &>/dev/null && ! which zypper &>/dev/null ; then
sudo apt-get update
DEBIAN_FRONTEND=noninteractive \
sudo apt-get -q --option "Dpkg::Options::=--force-confold" \
--assume-yes install `bindep -b -f bindep.txt test`
elif which yum &>/dev/null; then
sudo yum install -y $BINDEP_PKGS
elif which zypper &>/dev/null; then
sudo zypper -n in $BINDEP_PKGS
fi
fi
# run through each tox env and execute the test
for tox_env in $(awk -F= '/envlist/ {print $2}' tox.ini | sed 's/,/ /g'); do
if [ "${tox_env}" != "ansible-functional" ]; then
tox -e ${tox_env}
elif [ "${tox_env}" == "ansible-functional" ]; then
if ${FUNCTIONAL_TEST}; then
tox -e ${tox_env}
if [ "${tox_env}" != "ansible-functional" ]; then
tox -e ${tox_env}
elif [ "${tox_env}" == "ansible-functional" ]; then
if ${FUNCTIONAL_TEST}; then
tox -e ${tox_env}
fi
fi
fi
done
# vim: set ts=4 sw=4 expandtab: