Add SUSE support
Add support for SUSE based distributions. We also update the bindep.txt, run_tests.sh and Vagrantfile files from the openstack-ansible-tests repository. Change-Id: Id96d9eec52e136b4be5acbd4657de3ebd4f25980
This commit is contained in:
parent
efd7b21798
commit
a1fbb19ddd
|
@ -61,6 +61,7 @@ ChangeLog
|
||||||
releasenotes/build
|
releasenotes/build
|
||||||
|
|
||||||
# Test temp files
|
# Test temp files
|
||||||
|
tests/common
|
||||||
tests/plugins
|
tests/plugins
|
||||||
tests/playbooks
|
tests/playbooks
|
||||||
tests/test.retry
|
tests/test.retry
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
config.vm.define "ubuntu" do |ubuntu|
|
config.vm.provider "virtualbox" do |v|
|
||||||
ubuntu.vm.box = "ubuntu/xenial64"
|
v.memory = 2048
|
||||||
ubuntu.vm.provision "shell", inline: <<-SHELL
|
v.cpus = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "ubuntu1604" do |xenial|
|
||||||
|
xenial.vm.box = "ubuntu/xenial64"
|
||||||
|
xenial.vm.provision "shell", inline: <<-SHELL
|
||||||
sudo su -
|
sudo su -
|
||||||
cd /vagrant
|
cd /vagrant
|
||||||
./run_tests.sh
|
./run_tests.sh
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
config.vm.define "centos" do |centos|
|
|
||||||
centos.vm.box = "centos/7"
|
config.vm.define "opensuse421" do |leap421|
|
||||||
centos.vm.provision "shell", inline: <<-SHELL
|
leap421.vm.box = "opensuse/openSUSE-42.1-x86_64"
|
||||||
|
leap421.vm.provision "shell", inline: <<-SHELL
|
||||||
sudo su -
|
sudo su -
|
||||||
cd /vagrant
|
cd /vagrant
|
||||||
./run_tests.sh
|
./run_tests.sh
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.vm.define "centos7" do |centos7|
|
||||||
|
centos7.vm.box = "centos/7"
|
||||||
|
centos7.vm.provision "shell", inline: <<-SHELL
|
||||||
|
sudo su -
|
||||||
|
cd /vagrant
|
||||||
|
./run_tests.sh
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
32
bindep.txt
32
bindep.txt
|
@ -3,12 +3,24 @@
|
||||||
#
|
#
|
||||||
# See the following for details:
|
# See the following for details:
|
||||||
# - http://docs.openstack.org/infra/bindep/
|
# - http://docs.openstack.org/infra/bindep/
|
||||||
# - https://github.com/openstack-infra/bindep
|
# - https://git.openstack.org/cgit/openstack-infra/bindep
|
||||||
#
|
#
|
||||||
# Even if the role does not make use of this facility, it
|
# Even if the role does not make use of this facility, it
|
||||||
# is better to have this file empty, otherwise OpenStack-CI
|
# is better to have this file empty, otherwise OpenStack-CI
|
||||||
# will fall back to installing its default packages which
|
# will fall back to installing its default packages which
|
||||||
# will potentially be detrimental to the tests executed.
|
# will potentially be detrimental to the tests executed.
|
||||||
|
#
|
||||||
|
# Note:
|
||||||
|
# This file is maintained in the openstack-ansible-tests repository.
|
||||||
|
# https://git.openstack.org/cgit/openstack/openstack-ansible-tests/tree/bindep.txt
|
||||||
|
# If you need to remove or add extra dependencies, you should modify
|
||||||
|
# the central file instead and once your change is accepted then update
|
||||||
|
# this file as well. The purpose of this file is to ensure that Python and
|
||||||
|
# Ansible have all their necessary binary requirements on the test host before
|
||||||
|
# tox executes. Any binary requirements needed by services/roles should be
|
||||||
|
# installed by those roles in their applicable package install tasks, not through
|
||||||
|
# using this file.
|
||||||
|
#
|
||||||
|
|
||||||
# Base requirements for Ubuntu
|
# Base requirements for Ubuntu
|
||||||
build-essential [platform:dpkg]
|
build-essential [platform:dpkg]
|
||||||
|
@ -18,24 +30,26 @@ libffi-dev [platform:dpkg]
|
||||||
python2.7 [platform:dpkg]
|
python2.7 [platform:dpkg]
|
||||||
python-dev [platform:dpkg]
|
python-dev [platform:dpkg]
|
||||||
|
|
||||||
# Base requirements for CentOS
|
# Base requirements for RPM distros
|
||||||
gcc [platform:rpm]
|
gcc [platform:rpm]
|
||||||
gcc-c++ [platform:rpm]
|
gcc-c++ [platform:rpm]
|
||||||
git [platform:rpm]
|
git [platform:rpm]
|
||||||
python-devel [platform:rpm]
|
|
||||||
libffi-devel [platform:rpm]
|
libffi-devel [platform:rpm]
|
||||||
openssl-devel [platform:rpm]
|
openssl-devel [platform:rpm]
|
||||||
|
python-devel [platform:rpm]
|
||||||
|
|
||||||
# For SELinux
|
# For SELinux
|
||||||
libselinux-python [platform:rpm]
|
libselinux-python [platform:centos]
|
||||||
|
libsemanage-python [platform:centos]
|
||||||
|
|
||||||
# For SSL SNI support
|
# For SSL SNI support
|
||||||
python-pyasn1 [platform:dpkg]
|
python-pyasn1 [platform:dpkg platform:suselinux]
|
||||||
python-openssl [platform:dpkg]
|
python-openssl [platform:dpkg platform:suselinux]
|
||||||
python-ndg-httpsclient [platform:ubuntu]
|
python-ndg-httpsclient [platform:ubuntu]
|
||||||
python2-pyasn1 [platform:rpm]
|
python2-pyasn1 [platform:centos]
|
||||||
python2-pyOpenSSL [platform:rpm]
|
python2-pyOpenSSL [platform:centos]
|
||||||
python-ndg_httpsclient [platform:rpm]
|
python-pyOpenSSL [platform:suselinux]
|
||||||
|
python-ndg_httpsclient [platform:centos]
|
||||||
|
|
||||||
# Required for compressing collected log files in CI
|
# Required for compressing collected log files in CI
|
||||||
gzip
|
gzip
|
||||||
|
|
|
@ -26,6 +26,9 @@ galaxy_info:
|
||||||
- name: EL
|
- name: EL
|
||||||
versions:
|
versions:
|
||||||
- 7
|
- 7
|
||||||
|
- name: opensuse
|
||||||
|
versions:
|
||||||
|
- all
|
||||||
categories:
|
categories:
|
||||||
- cloud
|
- cloud
|
||||||
- rsyslog
|
- rsyslog
|
||||||
|
|
77
run_tests.sh
77
run_tests.sh
|
@ -13,62 +13,35 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
set -xeuo pipefail
|
set -xeu
|
||||||
|
|
||||||
FUNCTIONAL_TEST=${FUNCTIONAL_TEST:-true}
|
source /etc/os-release || /usr/lib/os-release
|
||||||
|
|
||||||
# Install python2 for Ubuntu 16.04 and CentOS 7
|
install_pkg_deps() {
|
||||||
if which apt-get; then
|
pkg_deps="git"
|
||||||
sudo apt-get update && sudo apt-get install -y python
|
|
||||||
fi
|
|
||||||
|
|
||||||
if which yum; then
|
case ${ID,,} in
|
||||||
sudo yum install -y python
|
*suse*) pkg_mgr_cmd="zypper -n in" ;;
|
||||||
fi
|
centos|rhel) pkg_mgr_cmd="yum install -y" ;;
|
||||||
|
fedora) pkg_mgr_cmd="dnf -y install" ;;
|
||||||
|
ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;;
|
||||||
|
*) echo "unsupported distribution: ${ID,,}"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Install pip.
|
eval sudo $pkg_mgr_cmd $pkg_deps
|
||||||
if ! which pip; then
|
}
|
||||||
curl --silent --show-error --retry 5 \
|
|
||||||
https://bootstrap.pypa.io/get-pip.py | sudo python2.7
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install bindep and tox with pip.
|
git_clone_repo() {
|
||||||
sudo pip install bindep tox
|
if [[ ! -d tests/common ]]; then
|
||||||
|
git clone https://git.openstack.org/openstack/openstack-ansible-tests tests/common
|
||||||
# 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
|
|
||||||
sudo yum -y install redhat-lsb-core epel-release
|
|
||||||
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 a list of OS packages provided by bindep.
|
|
||||||
if which apt-get; then
|
|
||||||
sudo apt-get update
|
|
||||||
DEBIAN_FRONTEND=noninteractive \
|
|
||||||
sudo apt-get -q --option "Dpkg::Options::=--force-confold" \
|
|
||||||
--assume-yes install $BINDEP_PKGS
|
|
||||||
elif which yum; then
|
|
||||||
# Don't run yum with an empty list of packages.
|
|
||||||
# It will fail and cause the script to exit with an error.
|
|
||||||
if [[ ${#BINDEP_PKGS} > 0 ]]; then
|
|
||||||
sudo yum install -y $BINDEP_PKGS
|
|
||||||
fi
|
fi
|
||||||
fi
|
}
|
||||||
|
|
||||||
# Loop through each tox environment and run tests.
|
install_pkg_deps
|
||||||
for tox_env in $(awk -F= '/envlist/ { gsub(",", " "); print $2 }' tox.ini); do
|
|
||||||
echo "Executing tox environment: ${tox_env}"
|
git_clone_repo
|
||||||
if [[ ${tox_env} == ansible-functional ]]; then
|
|
||||||
if ${FUNCTIONAL_TEST}; then
|
# start executing the main test script
|
||||||
tox -e ${tox_env}
|
source tests/common/run_tests.sh
|
||||||
fi
|
|
||||||
else
|
# vim: set ts=4 sw=4 expandtab:
|
||||||
tox -e ${tox_env}
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
# Copyright 2017, SUSE LINUX GmbH.
|
||||||
|
#
|
||||||
|
# Licensed 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.
|
||||||
|
|
||||||
|
- name: Install rsyslog zypper packages
|
||||||
|
zypper:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: "{{ rsyslog_server_package_state }}"
|
||||||
|
register: install_zypper_packages
|
||||||
|
until: install_zypper_packages | success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
with_items: "{{ rsyslog_server_distro_packages }}"
|
||||||
|
tags:
|
||||||
|
- rsyslog-zypper-packages
|
|
@ -13,14 +13,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- include: install-apt.yml
|
- include: install-{{ ansible_pkg_mgr }}.yml
|
||||||
when:
|
|
||||||
- ansible_pkg_mgr == 'apt'
|
|
||||||
tags:
|
tags:
|
||||||
- install-apt
|
- install-apt
|
||||||
|
|
||||||
- include: install-yum.yml
|
|
||||||
when:
|
|
||||||
- ansible_pkg_mgr == 'yum'
|
|
||||||
tags:
|
|
||||||
- install-yum
|
- install-yum
|
||||||
|
- install-zypper
|
||||||
|
|
|
@ -36,3 +36,10 @@
|
||||||
- "{{ rsyslog_server_spool_directory }}"
|
- "{{ rsyslog_server_spool_directory }}"
|
||||||
tags:
|
tags:
|
||||||
- rsyslog-server-dirs
|
- rsyslog-server-dirs
|
||||||
|
|
||||||
|
- name: Remove conflicting distro packages
|
||||||
|
package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
with_items:
|
||||||
|
- "{{ rsyslog_server_distro_packages_remove | default([]) }}"
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
# Copyright 2017, SUSE LINUX GmbH.
|
||||||
|
#
|
||||||
|
# Licensed 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.
|
||||||
|
|
||||||
|
rsyslog_server_distro_packages:
|
||||||
|
- rsyslog
|
||||||
|
- logrotate
|
||||||
|
|
||||||
|
rsyslog_server_distro_packages_remove:
|
||||||
|
- systemd-logger # conflicts with rsyslog
|
||||||
|
|
||||||
|
rsyslog_pid_name: rsyslogd.pid
|
Loading…
Reference in New Issue