From edca617537676897998f4fc410fc0ff50ec1bb50 Mon Sep 17 00:00:00 2001 From: Cloud User Date: Tue, 29 May 2018 16:35:15 +0000 Subject: [PATCH] Add new scenario to test python3 services Also modify provision manifest to skip provisioning some services. The new scenario will be used for testing py3 services starting with keystone and glance. Also update puppet-apache reference to the required commit, this can be updated once a new tag is released with the commit. Change-Id: I55558f35068457175e2ef508f9e5989151db4aa2 --- Puppetfile | 2 +- fixtures/scenario-py3.pp | 50 +++++++++++++ functions | 5 ++ manifests/provision.pp | 155 ++++++++++++++++++++++----------------- 4 files changed, 145 insertions(+), 67 deletions(-) create mode 100644 fixtures/scenario-py3.pp diff --git a/Puppetfile b/Puppetfile index 0e61c3064..cd73b9a37 100644 --- a/Puppetfile +++ b/Puppetfile @@ -172,7 +172,7 @@ mod 'staging', mod 'apache', :git => 'https://github.com/puppetlabs/puppetlabs-apache', - :ref => '3.1.0' + :ref => '74fa040be21689e32f156f73ed1a71f08a94eb49' mod 'apt', :git => 'https://github.com/puppetlabs/puppetlabs-apt', diff --git a/fixtures/scenario-py3.pp b/fixtures/scenario-py3.pp new file mode 100644 index 000000000..d7bfef251 --- /dev/null +++ b/fixtures/scenario-py3.pp @@ -0,0 +1,50 @@ +# +# Copyright 2015 Red Hat, Inc. +# +# 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. +# + +if ($::os_package_type == 'debian') { + $wsgi_mod_package = 'libapache2-mod-wsgi-py3' + $wsgi_mod_lib = undef +} +elsif ($::operatingsystem == 'Fedora') { + $wsgi_mod_package = 'python3-mod_wsgi' + $wsgi_mod_lib = 'mod_wsgi_python3.so' +} +if ($::os_package_type == 'debian') or ($::operatingsystem == 'Fedora') { + include ::apache::params + class { '::apache': + mod_packages => merge($::apache::params::mod_packages, { + 'wsgi' => $wsgi_mod_package, + }), + mod_libs => merge($::apache::params::mod_libs, { + 'wsgi' => $wsgi_mod_lib, + }) + } +} + +include ::openstack_integration +include ::openstack_integration::rabbitmq +include ::openstack_integration::mysql +include ::openstack_integration::keystone +include ::openstack_integration::glance +class { '::openstack_integration::provision': + neutron => false, + nova => false, +} + +class { '::openstack_integration::tempest': + neutron => false, + nova => false, +} diff --git a/functions b/functions index 69bbecc2c..44852d244 100644 --- a/functions +++ b/functions @@ -196,6 +196,11 @@ function catch_selinux_alerts() { # https://bugzilla.redhat.com/show_bug.cgi?id=1341738 if $SUDO grep -iqE 'denied.*system_r:rabbitmq_t' /var/log/audit/audit.log; then echo "non-critical RabbitMQ AVC, ignoring it now." + # FIXME(ykarel) catch_selinux_alerts not work with non ssl scenarios(no rabbitmq alert), + # currently running scenario-py3 without ssl because glance py3 has issues when + # running with eventlet + ssl: https://bugs.launchpad.net/glance/+bug/1769006 + elif [[ ! -f /etc/fedora-release && "$SCENARIO" = "scenario-py3" ]]; then + echo "non ssl scenario-py3, ignoring it now." else echo "Please file a bug on https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20OpenStack&component=openstack-selinux showing sealert output." exit 1 diff --git a/manifests/provision.pp b/manifests/provision.pp index 3b796802d..b021770b1 100644 --- a/manifests/provision.pp +++ b/manifests/provision.pp @@ -1,75 +1,98 @@ # Deploy OpenStack resources needed to run Tempest - -class openstack_integration::provision { +# Provision based on service enabled +# +# [*glance*] +# (optional) Define if Glance Resources needs to be created. +# Default to true. +# +# [*neutron*] +# (optional) Define if Neutron Resources needs to be created. +# Default to true. +# +# [*nova*] +# (optional) Define if Nova Resources needs to be created. +# Default to true. +# +class openstack_integration::provision ( + $glance = true, + $nova = true, + $neutron = true, +){ include ::openstack_integration::config - nova_flavor { 'm1.nano': - ensure => present, - id => '42', - ram => '128', - disk => '0', - vcpus => '1', - } - nova_flavor { 'm1.micro': - ensure => present, - id => '84', - ram => '128', - disk => '0', - vcpus => '1', - } - # NOTE(ykarel): "m1.small" flavor is required by murano scenario tests - nova_flavor { 'm1.small': - ensure => present, - id => '2', - ram => '128', - disk => '0', - vcpus => '1', - } - # NOTE(amoralej): "m1.tiny" flavor is required by murano scenario tests - # https://review.openstack.org/#/c/480848/ moved jobs from m1.small - nova_flavor { 'm1.tiny': - ensure => present, - id => '1', - ram => '128', - disk => '0', - vcpus => '1', - } - Keystone_user_role <||>-> Nova_flavor<||> - Keystone_endpoint <||>-> Nova_flavor<||> - Keystone_user_role['admin@openstack'] -> Nova_flavor<||> - - neutron_network { 'public': - tenant_name => 'openstack', - router_external => true, - provider_physical_network => 'external', - provider_network_type => 'flat', - } - Keystone_user_role['admin@openstack'] -> Neutron_network<||> - - neutron_subnet { 'public-subnet': - cidr => '172.24.5.0/24', - ip_version => '4', - allocation_pools => ['start=172.24.5.10,end=172.24.5.200'], - gateway_ip => '172.24.5.1', - enable_dhcp => false, - network_name => 'public', - tenant_name => 'openstack', + if $nova { + nova_flavor { 'm1.nano': + ensure => present, + id => '42', + ram => '128', + disk => '0', + vcpus => '1', + } + nova_flavor { 'm1.micro': + ensure => present, + id => '84', + ram => '128', + disk => '0', + vcpus => '1', + } + # NOTE(ykarel): "m1.small" flavor is required by murano scenario tests + nova_flavor { 'm1.small': + ensure => present, + id => '2', + ram => '128', + disk => '0', + vcpus => '1', + } + # NOTE(amoralej): "m1.tiny" flavor is required by murano scenario tests + # https://review.openstack.org/#/c/480848/ moved jobs from m1.small + nova_flavor { 'm1.tiny': + ensure => present, + id => '1', + ram => '128', + disk => '0', + vcpus => '1', + } + Keystone_user_role <||>-> Nova_flavor<||> + Keystone_endpoint <||>-> Nova_flavor<||> + Keystone_user_role['admin@openstack'] -> Nova_flavor<||> } - glance_image { 'cirros': - ensure => present, - container_format => 'bare', - disk_format => 'qcow2', - is_public => 'yes', - source => '/tmp/openstack/image/cirros-0.4.0-x86_64-disk.img' + if $neutron { + neutron_network { 'public': + tenant_name => 'openstack', + router_external => true, + provider_physical_network => 'external', + provider_network_type => 'flat', + } + Keystone_user_role['admin@openstack'] -> Neutron_network<||> + + neutron_subnet { 'public-subnet': + cidr => '172.24.5.0/24', + ip_version => '4', + allocation_pools => ['start=172.24.5.10,end=172.24.5.200'], + gateway_ip => '172.24.5.1', + enable_dhcp => false, + network_name => 'public', + tenant_name => 'openstack', + } } - glance_image { 'cirros_alt': - ensure => present, - container_format => 'bare', - disk_format => 'qcow2', - is_public => 'yes', - source => '/tmp/openstack/image/cirros-0.4.0-x86_64-disk.img' + + if $glance { + glance_image { 'cirros': + ensure => present, + container_format => 'bare', + disk_format => 'qcow2', + is_public => 'yes', + source => '/tmp/openstack/image/cirros-0.4.0-x86_64-disk.img' + } + glance_image { 'cirros_alt': + ensure => present, + container_format => 'bare', + disk_format => 'qcow2', + is_public => 'yes', + source => '/tmp/openstack/image/cirros-0.4.0-x86_64-disk.img' + } + Keystone_user_role['admin@openstack'] -> Glance_image<||> } - Keystone_user_role['admin@openstack'] -> Glance_image<||> }