Update config to support RHEL/CENT8

This change updates our bindep configurations and local test runner
to ensure it works with RHEL/CENT8.

Change-Id: I5585fa8b6e2094132596073e6c441267a18aea90
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2019-10-09 07:58:40 -05:00
parent 7fa3b4ebae
commit 9c7f558684
No known key found for this signature in database
GPG Key ID: CE94BD890A47B20A
4 changed files with 57 additions and 8 deletions

View File

@ -18,12 +18,15 @@ gcc-c++ [platform:rpm]
git [platform:rpm] git [platform:rpm]
libffi-devel [platform:rpm] libffi-devel [platform:rpm]
openssl-devel [platform:rpm] openssl-devel [platform:rpm]
python-devel [platform:rpm] python-devel [platform:rpm !platform:rhel-8]
python3-devel [platform:rpm !platform:centos-7]
python2-dnf [platform:fedora] python2-dnf [platform:fedora]
# For SELinux # For SELinux
libselinux-python [platform:rpm] libselinux-python [platform:rpm !platform:rhel-8]
libsemanage-python [platform:redhat] libsemanage-python [platform:redhat !platform:rhel-8]
libselinux-python3 [platform:rpm !platform:centos-7]
libsemanage-python3 [platform:redhat !platform:rhel-7]
# Required for compressing collected log files in CI # Required for compressing collected log files in CI
gzip gzip

View File

@ -26,6 +26,15 @@ export PROJECT_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../"
export ROLE_NAME="${ROLE_NAME:-$1}" export ROLE_NAME="${ROLE_NAME:-$1}"
export TRIPLEO_JOB_ANSIBLE_ARGS=${TRIPLEO_JOB_ANSIBLE_ARGS:-"-v"} export TRIPLEO_JOB_ANSIBLE_ARGS=${TRIPLEO_JOB_ANSIBLE_ARGS:-"-v"}
## Functions -----------------------------------------------------------------
function run_pip {
"${HOME}/test-python/bin/pip" install \
-r "${PROJECT_DIR}/requirements.txt" \
-r "${PROJECT_DIR}/test-requirements.txt" \
-r "${PROJECT_DIR}/molecule-requirements.txt" ${@:-}
}
## Main ---------------------------------------------------------------------- ## Main ----------------------------------------------------------------------
# Source distribution information # Source distribution information
@ -36,7 +45,7 @@ PYTHON_EXEC=$(command -v python3 || command -v python)
# Install the one requirement we need to run any local test # Install the one requirement we need to run any local test
case "${ID,,}" in case "${ID,,}" in
amzn|rhel|centos|fedora) amzn|rhel|centos|fedora)
sudo "${RHT_PKG_MGR}" install -y python*-virtualenv sudo "${RHT_PKG_MGR}" install -y gcc python*-virtualenv
;; ;;
esac esac
@ -51,10 +60,15 @@ esac
if [[ -d "${HOME}/.cache/pip/wheels" ]]; then if [[ -d "${HOME}/.cache/pip/wheels" ]]; then
rm -rf "${HOME}/.cache/pip/wheels" rm -rf "${HOME}/.cache/pip/wheels"
fi fi
"${HOME}/test-python/bin/pip" install \ run_pip
-r "${PROJECT_DIR}/requirements.txt" \
-r "${PROJECT_DIR}/test-requirements.txt" \ # NOTE(cloudnull): In some cases ansible will not be installed due to wheel
-r "${PROJECT_DIR}/molecule-requirements.txt" # building issues, caused by pip. If this happens we
# re-install the packages with the force flag, which will
# ensure everything is rebuilt and installed correctly.
if [ ! -f "${HOME}/test-python/bin/ansible" ]; then
run_pip --force
fi
# Run local test # Run local test
PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate" PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate"

View File

@ -0,0 +1,23 @@
---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# 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.
test_deps_repo: https://trunk.rdoproject.org/fedora/current
test_deps_selinux_packages:
- python3-libselinux
test_deps_tripleo_packages:
- python3-tripleoclient
test_deps_tripleo_repos: current-tripleo

View File

@ -35,6 +35,15 @@
requirements: "{{ tripleo_ansible_project_path }}/molecule-requirements.txt" requirements: "{{ tripleo_ansible_project_path }}/molecule-requirements.txt"
virtualenv: "{{ ansible_user_dir }}/test-python" virtualenv: "{{ ansible_user_dir }}/test-python"
virtualenv_site_packages: true virtualenv_site_packages: true
# NOTE(cloudnull): This is being done because docker is not supported on RHEL-8
# and tests within this repo still require docker.
- name: Manual install container.io
become: true
package:
name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
when:
- (ansible_os_family | lower) == "redhat"
- (ansible_distribution_major_version | int) >= 8
tasks: tasks:
- name: Get Ansible Galaxy roles - name: Get Ansible Galaxy roles
command: >- command: >-