From ef3c5dc9b7294b38b95c4e900bd142987472f976 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 13 Jul 2020 00:11:19 +0200 Subject: [PATCH] Add Puppet Litmus and remove Puppet 5 testing This patch adds the needed bits to replace Beaker with Puppet Litmus. Since Puppet Litmus only supports Puppet 6 we need to remove Puppet 5 testing. The probability that we break Puppet 5 support (we have promised to keep it in Victoria) this late in the cycle is very low hence we should try to get this through. When this is merged we can move all modules over to use Litmus and then cleanup all Beaker things. Change-Id: I73f18345ed3e6481f86ad7af7d68f66b19d2250e --- Puppetfile_unit | 5 +++ manifests/repos.pp | 23 ++++++++++---- playbooks/prepare-node-litmus.yaml | 24 ++++++++++++++ playbooks/run-litmus-tests.yaml | 34 ++++++++++++++++++++ zuul.d/base.yaml | 2 +- zuul.d/beaker.yaml | 2 +- zuul.d/layout.yaml | 6 ---- zuul.d/libraries.yaml | 7 ---- zuul.d/linters.yaml | 13 -------- zuul.d/litmus.yaml | 51 ++++++++++++++++++++++++++++++ zuul.d/unit.yaml | 9 ------ 11 files changed, 132 insertions(+), 44 deletions(-) create mode 100644 playbooks/prepare-node-litmus.yaml create mode 100644 playbooks/run-litmus-tests.yaml create mode 100644 zuul.d/litmus.yaml diff --git a/Puppetfile_unit b/Puppetfile_unit index 4c123cd46..72b0dd842 100644 --- a/Puppetfile_unit +++ b/Puppetfile_unit @@ -18,3 +18,8 @@ mod 'yumrepo_core', mod 'mount_core', :git => 'https://github.com/puppetlabs/puppetlabs-mount_core', :ref => '1.0.4' + +# NOTE(tobias-urdin): Needed by p-o-i. +mod 'selinux_core', + :git => 'https://github.com/puppetlabs/puppetlabs-selinux_core', + :ref => '1.0.4' diff --git a/manifests/repos.pp b/manifests/repos.pp index d54294750..583b8500f 100644 --- a/manifests/repos.pp +++ b/manifests/repos.pp @@ -1,10 +1,10 @@ class openstack_integration::repos { - # To make beaker tests work. - if $::ceph_version != '' { + # To make litmus tests work. + if defined('$::ceph_version') and $::ceph_version != '' { $ceph_version_real = $::ceph_version } else { - $ceph_version_real = 'mimic' + $ceph_version_real = 'nautilus' } case $::osfamily { 'Debian': { @@ -30,7 +30,7 @@ class openstack_integration::repos { } # Ceph is both packaged on UCA and official download.ceph.com packages # which we mirror. We want to use the official packages or our mirror. - if $::nodepool_mirror_host != '' { + if defined('$::nodepool_mirror_host') and $::nodepool_mirror_host != '' { $ceph_version_cap = capitalize($ceph_version_real) apt::pin { 'ceph': priority => 1001, @@ -47,10 +47,15 @@ class openstack_integration::repos { $ceph_mirror = pick($::ceph_mirror_host, "http://download.ceph.com/debian-${ceph_version_real}/") } 'RedHat': { + if defined('$::centos_mirror_host') and $::centos_mirror_host != '' { + $centos_mirror = $::centos_mirror_host + } else { + $centos_mirror = 'http://mirror.centos.org' + } class { 'openstack_extras::repo::redhat::redhat': manage_rdo => false, manage_epel => false, - centos_mirror_url => $::centos_mirror_host, + centos_mirror_url => $centos_mirror, repo_source_hash => { 'delorean.repo' => "https://trunk.rdoproject.org/centos${::os['release']['major']}-master/puppet-passed-ci/delorean.repo", 'delorean-deps.repo' => "https://trunk.rdoproject.org/centos${::os['release']['major']}-master/delorean-deps.repo" @@ -60,9 +65,13 @@ class openstack_integration::repos { # NOTE(tobias-urdin): Mimic was never released by Storage SIG to official mirros. $ceph_mirror_fallback = $ceph_version_real ? { 'mimic' => "https://trunk.rdoproject.org/centos${::os['release']['major']}/deps/storage/storage${::os['release']['major']}-ceph-mimic/x86_64/", - default => "${::centos_mirror_host}/centos/${::os['release']['major']}/storage/x86_64/ceph-${ceph_version_real}/" + default => "${centos_mirror}/centos/${::os['release']['major']}/storage/x86_64/ceph-${ceph_version_real}/" + } + if defined('$::ceph_mirror_host') and $::ceph_mirror_host != '' { + $ceph_mirror = pick($::ceph_mirror_host, $ceph_mirror_fallback) + } else { + $ceph_mirror = $ceph_mirror_fallback } - $ceph_mirror = pick($::ceph_mirror_host, $ceph_mirror_fallback) # On CentOS, deploy Ceph using SIG repository and get rid of EPEL. # https://wiki.centos.org/SpecialInterestGroup/Storage/ if $::operatingsystem == 'CentOS' { diff --git a/playbooks/prepare-node-litmus.yaml b/playbooks/prepare-node-litmus.yaml new file mode 100644 index 000000000..1873cd98d --- /dev/null +++ b/playbooks/prepare-node-litmus.yaml @@ -0,0 +1,24 @@ +- hosts: all + tasks: + - shell: + cmd: | + set -e + set -x + + if [ -d /home/zuul/src/opendev.org/$ZUUL_PROJECT ]; then + cp -dR /home/zuul/src/opendev.org/$ZUUL_PROJECT/. . + else + git clone https://opendev.org/$ZUUL_PROJECT . + fi + if [ -d /home/zuul/src/opendev.org/openstack/puppet-openstack-integration ]; then + [ ! -d puppet-openstack-integration ] && mkdir puppet-openstack-integration + cp -dR /home/zuul/src/opendev.org/openstack/puppet-openstack-integration/. puppet-openstack-integration + else + git clone https://opendev.org/openstack/puppet-openstack-integration puppet-openstack-integration + fi + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - include_role: + name: bindep diff --git a/playbooks/run-litmus-tests.yaml b/playbooks/run-litmus-tests.yaml new file mode 100644 index 000000000..7275c8303 --- /dev/null +++ b/playbooks/run-litmus-tests.yaml @@ -0,0 +1,34 @@ +- hosts: all + tasks: + - name: Run Litmus + shell: + cmd: | + set -e + function trap_exit_sig() { + # NOTE(tobias-urdin): Litmus does not execute spec_clean rake task after a run. + $GEM_BIN_DIR/bundle exec rake spec_clean + + {{ ansible_user_dir }}/workspace/puppet-openstack-integration/copy_logs.sh + } + trap trap_exit_sig EXIT + export CEPH_VERSION={{ ceph }} + if [ "{{ puppet_gem_version }}" != "latest" ]; then + export PUPPET_GEM_VERSION='~> {{ puppet_gem_version }}' + fi + mkdir .bundled_gems + export GEM_HOME=`pwd`/.bundled_gems + export GEM_BIN_DIR=$GEM_HOME/bin + ruby <