Add Zuulv3 jobs for puppet functional testing

We need to abandon rspec as a functional testing framework. It
constantly breaks as ruby gems change their dependencies, no one likes
to deal with it and it did not help bring new people from the puppet
community to help maintain the modules. This patch adds a Zuulv3-native
job that can act as a framework for the future of puppet functional
testing. Puppet modules will need to have the files
tests/scenarios/*/{manifest.pp,tests.sh} in order to use this.
Eventually this should replace the legacy-puppet-beaker jobs.

Change-Id: Ic47e93fb091a9cdc876981674cff6b452a1afe87
This commit is contained in:
Colleen Murphy 2018-04-30 19:49:18 +02:00 committed by Andreas Jaeger
parent 5af35c8e6e
commit 0474b75e86
6 changed files with 140 additions and 0 deletions

View File

@ -0,0 +1,14 @@
- hosts: all
tasks:
- name: Install puppet
command: ./install_puppet.sh
args:
chdir: "{{ zuul.projects['git.openstack.org/openstack-infra/system-config'].src_dir }}"
become: yes
- name: Install modules
command: ./tools/install_modules_acceptance.sh
args:
chdir: "{{ zuul.projects['git.openstack.org/openstack-infra/system-config'].src_dir }}"
become: yes

View File

@ -0,0 +1,3 @@
- hosts: all
roles:
- infra-puppet-functional

View File

@ -0,0 +1,9 @@
- name: Get scenarios
command: "find {{ zuul.project.src_dir }}/tests/scenarios/ -maxdepth 1 -mindepth 1"
register: scenarios
- name: Test scenarios
include: scenario.yaml
with_items: "{{ scenarios.stdout_lines }}"
loop_control:
loop_var: scenario

View File

@ -0,0 +1,14 @@
- name: Run puppet apply
command: env PATH=$PATH:/opt/puppetlabs/bin puppet apply --detailed-exitcodes {{ scenario }}/manifest.pp
become: yes
register: puppet_result
failed_when: puppet_result.rc != 2
- name: Run puppet apply again to check for idempotence
command: env PATH=$PATH:/opt/puppetlabs/bin puppet apply --detailed-exitcodes {{ scenario }}/manifest.pp
become: yes
register: puppet_result
failed_when: puppet_result.rc != 0
- name: Check results
command: ./{{ scenario }}/tests.sh

View File

@ -1212,6 +1212,105 @@
vars:
puppet_version: 4
- job:
name: infra-puppet-functional
required-projects:
- openstack-infra/system-config
- openstack-infra/project-config
- openstack-infra/puppet-accessbot
- openstack-infra/puppet-ansible
- openstack-infra/puppet-apparmor
- openstack-infra/puppet-askbot
- openstack-infra/puppet-asterisk
- openstack-infra/puppet-bandersnatch
- openstack-infra/puppet-bugdaystats
- openstack-infra/puppet-bup
- openstack-infra/puppet-cgit
- openstack-infra/puppet-ciwatch
- openstack-infra/puppet-diskimage_builder
- openstack-infra/puppet-docker_registry
- openstack-infra/puppet-drupal
- openstack-infra/puppet-elastic_recheck
- openstack-infra/puppet-elasticsearch
- openstack-infra/puppet-ethercalc
- openstack-infra/puppet-etherpad_lite
- openstack-infra/puppet-exim
- openstack-infra/puppet-featuretracker
- openstack-infra/puppet-germqtt
- openstack-infra/puppet-gerrit
- openstack-infra/puppet-gerritbot
- openstack-infra/puppet-github
- openstack-infra/puppet-grafyaml
- openstack-infra/puppet-graphite
- openstack-infra/puppet-haveged
- openstack-infra/puppet-hound
- openstack-infra/puppet-httpd
- openstack-infra/puppet-infracloud
- openstack-infra/puppet-infra-cookiecutter
- openstack-infra/puppet-ipsilon
- openstack-infra/puppet-iptables
- openstack-infra/puppet-jeepyb
- openstack-infra/puppet-jenkins
- openstack-infra/puppet-kerberos
- openstack-infra/puppet-kibana
- openstack-infra/puppet-lodgeit
- openstack-infra/puppet-log_processor
- openstack-infra/puppet-logrotate
- openstack-infra/puppet-logstash
- openstack-infra/puppet-lpmqtt
- openstack-infra/puppet-mailman
- openstack-infra/puppet-mediawiki
- openstack-infra/puppet-meetbot
- openstack-infra/puppet-mosquitto
- openstack-infra/puppet-mqtt_statsd
- openstack-infra/puppet-mysql_backup
- openstack-infra/puppet-nodepool
- openstack-infra/puppet-odsreg
- openstack-infra/puppet-openafs
- openstack-infra/puppet-openstackci
- openstack-infra/puppet-openstack_health
- openstack-infra/puppet-openstackid
- openstack-infra/puppet-openstack_infra_spec_helper
- openstack-infra/puppet-os_client_config
- openstack-infra/puppet-packagekit
- openstack-infra/puppet-pgsql_backup
- openstack-infra/puppet-phabricator
- openstack-infra/puppet-pip
- openstack-infra/puppet-planet
- openstack-infra/puppet-project_config
- openstack-infra/puppet-ptgbot
- openstack-infra/puppet-puppet
- openstack-infra/puppet-redis
- openstack-infra/puppet-refstack
- openstack-infra/puppet-releasestatus
- openstack-infra/puppet-reviewday
- openstack-infra/puppet-simpleproxy
- openstack-infra/puppet-snmpd
- openstack-infra/puppet-ssh
- openstack-infra/puppet-ssl_cert_check
- openstack-infra/puppet-stackalytics
- openstack-infra/puppet-statusbot
- openstack-infra/puppet-storyboard
- openstack-infra/puppet-subunit2sql
- openstack-infra/puppet-sudoers
- openstack-infra/puppet-tmpreaper
- openstack-infra/puppet-translation_checksite
- openstack-infra/puppet-ulimit
- openstack-infra/puppet-unattended_upgrades
- openstack-infra/puppet-unbound
- openstack-infra/puppet-user
- openstack-infra/puppet-vcsrepo
- openstack-infra/puppet-vinz
- openstack-infra/puppet-yum
- openstack-infra/puppet-zanata
- openstack-infra/puppet-zuul
pre-run: playbooks/infra-puppet-functional/pre.yaml
run: playbooks/infra-puppet-functional/run.yaml
- job:
name: infra-puppet-functional-3-ubuntu-xenial
parent: infra-puppet-functional
- job:
name: ansible-role-functional-base
abstract: true

View File

@ -64,6 +64,7 @@
jobs:
- infra-puppet-apply-4-centos-7
- infra-puppet-apply-4-ubuntu-xenial
- infra-puppet-functional-3-ubuntu-xenial
- project-template:
name: infra-puppet-check-jobs