Add beaker boilerplate to openstackci
Updated for suggestions from crinkle. Left spec_helper_acceptance alone because jeblair's change is the right place to make that modification. Change-Id: Ic1aa2a0a78ea74661e95399e1e6393af5cf687b0
This commit is contained in:
committed by
Spencer Krum
parent
21783c7571
commit
cdc03e1cc8
24
spec/acceptance/basic_spec.rb
Executable file
24
spec/acceptance/basic_spec.rb
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
|
describe 'basic openstackci' do
|
||||||
|
|
||||||
|
if fact('osfamily') == 'Debian'
|
||||||
|
|
||||||
|
context 'default parameters' do
|
||||||
|
|
||||||
|
it 'should work with no errors' do
|
||||||
|
|
||||||
|
base_path = File.dirname(__FILE__)
|
||||||
|
pp_path = File.join(base_path, 'fixtures', 'default.pp')
|
||||||
|
pp = File.read(pp_path)
|
||||||
|
|
||||||
|
# Run it twice and test for idempotency
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
apply_manifest(pp, :catch_changes => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
5
spec/acceptance/fixtures/default.pp
Normal file
5
spec/acceptance/fixtures/default.pp
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# This test only runs on Debian flavors
|
||||||
|
class { '::openstackci::logserver':
|
||||||
|
domain => 'foo.openstack.org',
|
||||||
|
jenkins_ssh_key => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDW+zftKW0GvHKnIAZuE+WCcgLYzSj5LaJ1BEg1DXtBU8yKpTmdunjtJ47F0nVap/6nmbi3Xif4KHYEMoSkmyU+hqEbpFX/GzoJ0i69Kf+FYHfP5ZC8MD9NjdZ7pyPNIXvKTqRUc+ghDVwyDdtVOEiUtOTVrzDsKrDheZi9TvXTZ4fHj4ykuwDQeNwUoEBuhYZSg6/82+Bs1v/l5lOuZrOOOLikOK733KhBvXhEaeChxT2Tc0biaUuJFa7w+i/lc7uBuF3jY8H5cSd/FpKNgAMd4VaebX6m0WqYSWz+VlLARqyz8AP0jlK/2cHiB8Yu0zK34Q+os1tBzc6dc8jyxyjUA5ydDsUnRXaYlHAwsPGygb5EyCgll78EXR2MjSCWX6kfbG4NTM1T00Ezftld0jbcNG5t6skkYPnZQhTpesnauwc6Kj+ME+kftHpyd1HxWM24IeCRG0PznJuxNxBp8PlSMWDZtf1f5+ez7Z9rj0Qxi0Jd53EOMGSfYQUuMXRpnk7M/rX50J9wRts/+OnoH/4AxUAU5yB2ELzi6f4lt2Scqruj7Xp78SW++0nbdQQwYTqiNfLA789jIGaM2r1GAn06oX7jyEpniglaNf/9KGZVb+Y4WWLV4Wr8xfPrsQf1i5YK94qhN4C8NrXOG7hEcYT7Rvu2pKZ4dhwGxh4SmWNY0Q==',
|
||||||
|
}
|
||||||
11
spec/acceptance/nodesets/default.yml
Normal file
11
spec/acceptance/nodesets/default.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
HOSTS:
|
||||||
|
ubuntu-server-1404-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-14.04-amd64
|
||||||
|
box: puppetlabs/ubuntu-14.04-64-nocm
|
||||||
|
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
|
||||||
|
hypervisor: vagrant
|
||||||
|
CONFIG:
|
||||||
|
log_level: debug
|
||||||
|
type: git
|
||||||
10
spec/acceptance/nodesets/nodepool-centos7.yml
Normal file
10
spec/acceptance/nodesets/nodepool-centos7.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-70-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-7-x86_64
|
||||||
|
hypervisor: none
|
||||||
|
ip: 127.0.0.1
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
set_env: false
|
||||||
10
spec/acceptance/nodesets/nodepool-trusty.yml
Normal file
10
spec/acceptance/nodesets/nodepool-trusty.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
ubuntu-14.04-amd64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-14.04-amd64
|
||||||
|
hypervisor: none
|
||||||
|
ip: 127.0.0.1
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
set_env: false
|
||||||
41
spec/spec_helper_acceptance.rb
Normal file
41
spec/spec_helper_acceptance.rb
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
require 'beaker-rspec'
|
||||||
|
|
||||||
|
hosts.each do |host|
|
||||||
|
|
||||||
|
install_puppet
|
||||||
|
|
||||||
|
on host, "mkdir -p #{host['distmoduledir']}"
|
||||||
|
end
|
||||||
|
|
||||||
|
RSpec.configure do |c|
|
||||||
|
# Project root
|
||||||
|
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||||
|
|
||||||
|
# Readable test descriptions
|
||||||
|
c.formatter = :documentation
|
||||||
|
|
||||||
|
# Configure all nodes in nodeset
|
||||||
|
c.before :suite do
|
||||||
|
# Install module and dependencies
|
||||||
|
hosts.each do |host|
|
||||||
|
|
||||||
|
# install git
|
||||||
|
install_package host, 'git'
|
||||||
|
|
||||||
|
# clean out any module cruft
|
||||||
|
shell('rm -fr /etc/puppet/modules/*')
|
||||||
|
|
||||||
|
# install library modules from the forge
|
||||||
|
on host, puppet('module','install','puppetlabs-apache', '--version', '0.0.4'), { :acceptable_exit_codes => 0 }
|
||||||
|
|
||||||
|
# install puppet modules from git, use master, TODO: zuul-cloner this
|
||||||
|
shell('git clone https://git.openstack.org/openstack-infra/puppet-jenkins /etc/puppet/modules/jenkins')
|
||||||
|
shell('git clone https://git.openstack.org/openstack-infra/puppet-vcsrepo /etc/puppet/modules/vcsrepo')
|
||||||
|
|
||||||
|
# Install the module being tested
|
||||||
|
puppet_module_install(:source => proj_root, :module_name => 'openstackci')
|
||||||
|
# List modules installed to help with debugging
|
||||||
|
on hosts[0], puppet('module','list'), { :acceptable_exit_codes => 0 }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user