Bring Redhat support to acceptance tests

OpenStack Infra has jobs to run this on both Ubuntu Trusty and CentOS7.

* Add minitest to Gemfile (dependency to run beaker on centos - see
  http://projects.theforeman.org/issues/2650 for details)
* separate nodepool files to have trusty & centos7 support in OS infra
* spec: add case for repo configuration and support
  RH systems.
* rabbitmq: install module from source
* apt: pin the module
* don't try to install designate on centos (packaging not ready)

Change-Id: I687e6b274938d622860063cb1a2494f0e7f4635f
Closes-bug: #1444736
This commit is contained in:
Emilien Macchi 2015-05-11 16:00:20 -04:00
parent 3ea04aca8c
commit bee3621298
5 changed files with 80 additions and 33 deletions

View File

@ -3,6 +3,7 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 2.1.0', :require => false
gem 'minitest', '~> 4.7', :require => 'minitest/unit'
gem 'metadata-json-lint'
gem 'puppet-lint-param-docs'

View File

@ -9,10 +9,33 @@ describe 'basic designate' do
Exec { logoutput => 'on_failure' }
# Common resources
include ::apt
class { '::openstack_extras::repo::debian::ubuntu':
release => 'kilo',
package_require => true,
case $::osfamily {
'Debian': {
include ::apt
class { '::openstack_extras::repo::debian::ubuntu':
release => 'kilo',
package_require => true,
}
$package_provider = 'apt'
}
'RedHat': {
class { '::openstack_extras::repo::redhat::redhat':
# Kilo is not GA yet, so let's use the testing repo
manage_rdo => false,
repo_hash => {
'rdo-kilo-testing' => {
'baseurl' => 'https://repos.fedorapeople.org/repos/openstack/openstack-kilo/testing/el7/',
# packages are not GA so not signed
'gpgcheck' => '0',
'priority' => 97,
},
},
}
$package_provider = 'yum'
}
default: {
fail("Unsupported osfamily (${::osfamily})")
}
}
class { '::mysql::server': }
@ -20,6 +43,7 @@ describe 'basic designate' do
class { '::rabbitmq':
delete_guest_user => true,
erlang_cookie => 'secrete',
package_provider => $package_provider,
}
rabbitmq_vhost { '/':
@ -62,33 +86,40 @@ describe 'basic designate' do
admin_url => "https://${::fqdn}:35357/",
}
# Designate resources
class { '::designate::db::mysql':
password => 'a_big_secret',
case $::osfamily {
'Debian': {
# Designate resources
class { '::designate::db::mysql':
password => 'a_big_secret',
}
class { '::designate::keystone::auth':
password => 'a_big_secret',
}
class { '::designate':
rabbit_userid => 'designate',
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
}
class { '::designate::api':
enabled => true,
auth_strategy => 'keystone',
keystone_password => 'a_big_secret',
}
class { '::designate::backend::bind9':
rndc_config_file => '',
rndc_key_file => '',
}
include ::designate::client
class { '::designate::agent': }
class { '::designate::db':
database_connection => 'mysql://designate:a_big_secret@127.0.0.1/designate?charset=utf8',
}
include ::designate::dns
}
'RedHat': {
warning("Designate packaging is not ready on ${::osfamily}.")
}
}
class { '::designate::keystone::auth':
password => 'a_big_secret',
}
class { '::designate':
rabbit_userid => 'designate',
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
}
class { '::designate::api':
enabled => true,
auth_strategy => 'keystone',
keystone_password => 'a_big_secret',
}
class { '::designate::backend::bind9':
rndc_config_file => '',
rndc_key_file => '',
}
include ::designate::client
class { '::designate::agent': }
class { '::designate::db':
database_connection => 'mysql://designate:a_big_secret@127.0.0.1/designate?charset=utf8',
}
include ::designate::dns
EOS
@ -98,8 +129,10 @@ describe 'basic designate' do
apply_manifest(pp, :catch_failures => true)
end
describe port(9001) do
it { is_expected.to be_listening.with('tcp') }
if os[:family] == 'Debian'
describe port(9001) do
it { is_expected.to be_listening.with('tcp') }
end
end
end

View File

@ -0,0 +1,9 @@
HOSTS:
centos-70-x64:
roles:
- master
platform: el-7-x86_64
hypervisor : none
ip: 127.0.0.1
CONFIG:
type: foss

View File

@ -27,16 +27,20 @@ RSpec.configure do |c|
# install library modules from the forge
on host, puppet('module','install','puppetlabs-inifile'), { :acceptable_exit_codes => 0 }
# pin apt module until openstack_extras use >= 2.0.0 version
on host, puppet('module','install','puppetlabs-apt','--version','1.8.0'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','theforeman/dns'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','puppetlabs-mysql'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','dprince/qpid'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','stahnma-epel'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','puppetlabs-rabbitmq'), { :acceptable_exit_codes => 0 }
# install puppet modules from git, use master
shell('git clone https://git.openstack.org/stackforge/puppet-openstacklib /etc/puppet/modules/openstacklib')
shell('git clone https://git.openstack.org/stackforge/puppet-keystone /etc/puppet/modules/keystone')
shell('git clone https://git.openstack.org/stackforge/puppet-openstack_extras /etc/puppet/modules/openstack_extras')
# TODO(EmilienM) Cloning RabbitMQ module for now because we wait for a release including
# https://github.com/enovance/puppetlabs-rabbitmq/commit/0227f762070ffbbea3c28d6a60174de98fa4cc1c
shell('git clone https://github.com/puppetlabs/puppetlabs-rabbitmq/ /etc/puppet/modules/rabbitmq')
# Install the module being tested
puppet_module_install(:source => proj_root, :module_name => 'designate')