Migrate molecule jobs from centos 7 to 8

- assure we have docker installed
- add .gitreview file
- Fix Python shebangs for packaging

Change-Id: If9d78891f9b5a1615a9fb1f4251801eec1f29ed5
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud (Strider) 2020-03-11 09:30:22 +01:00
parent 47945a87f8
commit b6d66646b8
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
22 changed files with 223 additions and 50 deletions

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.opendev.org
port=29418
project=openstack/validations-common.git

View File

@ -9,13 +9,6 @@ Contents
:maxdepth: 2
unreleased
train
stein
rocky
queens
pike
ocata
Indices and tables
==================

View File

@ -1,6 +0,0 @@
===================================
Ocata Series Release Notes
===================================
.. release-notes::
:branch: origin/stable/ocata

View File

@ -1,6 +0,0 @@
===================================
Pike Series Release Notes
===================================
.. release-notes::
:branch: stable/pike

View File

@ -1,6 +0,0 @@
===================================
Queens Series Release Notes
===================================
.. release-notes::
:branch: stable/queens

View File

@ -1,6 +0,0 @@
===================================
Rocky Series Release Notes
===================================
.. release-notes::
:branch: stable/rocky

View File

@ -1,6 +0,0 @@
===================================
Stein Series Release Notes
===================================
.. release-notes::
:branch: stable/stein

View File

@ -1,6 +0,0 @@
==========================
Train Series Release Notes
==========================
.. release-notes::
:branch: stable/train

View File

@ -3,4 +3,3 @@
# process, which may cause wedges in the gate later.
pbr>=3.1.1 # Apache-2.0
PyYAML

8
tools/test-setup.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -euxo pipefail
# Used by Zuul CI to perform extra bootstrapping
# Workaround for a potential:
# Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
# See https://docs.docker.com/install/linux/linux-postinstall/
newgrp docker || true

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#

15
zuul.d/base.yaml Normal file
View File

@ -0,0 +1,15 @@
---
- job:
description: Base validations-common job
name: validations-common-centos-8-base
nodeset: centos-8
parent: base
success-url: "reports.html"
failure-url: "reports.html"
pre-run:
- tests/prepare-test-host.yml
- zuul.d/playbooks/pre.yml
run:
- zuul.d/playbooks/run.yml
timeout: 1800
voting: true

14
zuul.d/layout.yaml Normal file
View File

@ -0,0 +1,14 @@
- project:
templates:
- openstack-python3-ussuri-jobs
- validations-common-molecule-jobs
- check-requirements
- release-notes-jobs-python3
check:
jobs:
- openstack-tox-linters
- openstack-tox-lower-constraints
gate:
jobs:
- openstack-tox-linters
- openstack-tox-lower-constraints

115
zuul.d/molecule.yaml Normal file
View File

@ -0,0 +1,115 @@
---
- project-template:
check:
jobs:
- validations-common-centos-8-molecule-advanced_format_512e_support
- validations-common-centos-8-molecule-check_latest_packages_version
- validations-common-centos-8-molecule-dns
- validations-common-centos-8-molecule-haproxy
- validations-common-centos-8-molecule-ntp
- validations-common-centos-8-molecule-service_status
- validations-common-centos-8-molecule-check_cpu
- validations-common-centos-8-molecule-check_disk_space
- validations-common-centos-8-molecule-check_ram
- validations-common-centos-8-molecule-check_selinux_mode
- validations-common-centos-8-molecule-validate_selinux
- validations-common-centos-8-molecule-xfs_check_ftype
gate:
jobs:
- validations-common-centos-8-molecule-check_latest_packages_version
- validations-common-centos-8-molecule-dns
- validations-common-centos-8-molecule-haproxy
- validations-common-centos-8-molecule-check_cpu
- validations-common-centos-8-molecule-check_disk_space
- validations-common-centos-8-molecule-check_ram
- validations-common-centos-8-molecule-validate_selinux
name: validations-common-molecule-jobs
- job:
files:
- ^roles/check_selinux_mode/.*
name: validations-common-centos-8-molecule-check_selinux_mode
parent: validations-common-centos-8-base
vars:
validations_common_role_name: check_selinux_mode
voting: false
- job:
files:
- ^roles/ntp/.*
name: validations-common-centos-8-molecule-ntp
parent: validations-common-centos-8-base
vars:
validations_common_role_name: ntp
voting: false
- job:
files:
- ^roles/service_status/.*
name: validations-common-centos-8-molecule-service_status
parent: validations-common-centos-8-base
vars:
validations_common_role_name: service_status
voting: false
- job:
files:
- ^roles/advanced_format_512e_support/.*
name: validations-common-centos-8-molecule-advanced_format_512e_support
parent: validations-common-centos-8-base
vars:
validations_common_role_name: advanced_format_512e_support
voting: false
- job:
files:
- ^roles/dns/.*
name: validations-common-centos-8-molecule-dns
parent: validations-common-centos-8-base
vars:
validations_common_role_name: dns
- job:
files:
- ^roles/haproxy/.*
name: validations-common-centos-8-molecule-haproxy
parent: validations-common-centos-8-base
vars:
validations_common_role_name: haproxy
- job:
files:
- ^roles/check_cpu/.*
name: validations-common-centos-8-molecule-check_cpu
parent: validations-common-centos-8-base
vars:
validations_common_role_name: check_cpu
- job:
files:
- ^roles/check_ram/.*
name: validations-common-centos-8-molecule-check_ram
parent: validations-common-centos-8-base
vars:
validations_common_role_name: check_ram
- job:
files:
- ^roles/check_disk_space/.*
name: validations-common-centos-8-molecule-check_disk_space
parent: validations-common-centos-8-base
vars:
validations_common_role_name: check_disk_space
- job:
files:
- ^roles/xfs_check_ftype/.*
name: validations-common-centos-8-molecule-xfs_check_ftype
parent: validations-common-centos-8-base
vars:
validations_common_role_name: xfs_check_ftype
voting: false
- job:
files:
- ^roles/check_latest_packages_version/.*
name: validations-common-centos-8-molecule-check_latest_packages_version
parent: validations-common-centos-8-base
vars:
validations_common_role_name: check_latest_packages_version
- job:
files:
- ^roles/validate_selinux/.*
name: validations-common-centos-8-molecule-validate_selinux
parent: validations-common-centos-8-base
vars:
validations_common_role_name: validate_selinux

28
zuul.d/playbooks/pre.yml Normal file
View File

@ -0,0 +1,28 @@
---
- hosts: all
pre_tasks:
- name: Ensure output dirs
file:
path: "{{ ansible_user_dir }}/zuul-output/logs"
state: directory
- name: Setup bindep
pip:
name: "bindep"
virtualenv: "{{ ansible_user_dir }}/test-python"
virtualenv_site_packages: true
- name: Run bindep
shell: |-
. {{ ansible_user_dir }}/test-python/bin/activate
{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/scripts/bindep-install
become: true
changed_when: false
- name: Setup test-python
pip:
requirements: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/molecule-requirements.txt"
virtualenv: "{{ ansible_user_dir }}/test-python"
virtualenv_site_packages: true
roles:
- role: install-docker

View File

@ -0,0 +1,13 @@
---
- hosts: all
tasks:
- name: set basic zuul fact
set_fact:
zuul:
project:
src_dir: "{{ tripleo_src }}"
ansible_connection: ssh
- import_playbook: pre.yml
- import_playbook: run.yml

20
zuul.d/playbooks/run.yml Normal file
View File

@ -0,0 +1,20 @@
---
- hosts: all
environment:
ANSIBLE_LOG_PATH: "{{ ansible_user_dir }}/zuul-output/logs/ansible-execution.log"
tasks:
- name: Run role test job
shell: |-
. {{ ansible_user_dir }}/test-python/bin/activate
. {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/ansible-test-env.rc
pytest --color=no \
--html={{ ansible_user_dir }}/zuul-output/logs/reports.html \
--self-contained-html \
--ansible-args='{{ tripleo_job_ansible_args | default("") }}' \
{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/test_molecule.py
args:
chdir:
"{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/validations_common/roles/{{ validations_common_role_name }}"
executable: /bin/bash
changed_when: false