Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Beaker settings #122

Merged
merged 1 commit into from
Oct 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,11 @@ group :test do
end

group :system_tests do
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
else
gem 'beaker-rspec', :require => false
end
gem "beaker", '2.41.0', :require => false
gem "beaker-rspec", '5.6.0', :require => false
gem 'beaker-puppet_install_helper', :require => false
end



if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
else
gem 'facter', :require => false, :groups => [:test]
end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 4.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

Expand Down
11 changes: 11 additions & 0 deletions spec/acceptance/nodesets/centos-7-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HOSTS:
centos-7-x64:
platform: el-7-x86_64
hypervisor : docker
image: centos:7
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_preserve_image: true
CONFIG:
type: foss
log_level: debug
16 changes: 16 additions & 0 deletions spec/acceptance/nodesets/debian-8-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HOSTS:
debian-8:
roles:
- master
platform: debian-8-amd64
image: debian:8
hypervisor: docker
docker_cmd: ["/bin/systemd"]
docker_preserve_image: true
docker_image_commands:
- apt-get install -yq wget net-tools
- rm /lib/systemd/system/systemd*udev*
- rm /lib/systemd/system/getty.target
CONFIG:
type: foss
log_level: debug
13 changes: 13 additions & 0 deletions spec/acceptance/nodesets/ubuntu-1604-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
HOSTS:
ubuntu-16-04:
platform: ubuntu-16.04-amd64
image: ubuntu:16.04
hypervisor: docker
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get install -y net-tools wget curl'
- 'locale-gen en_US.UTF-8'
docker_preserve_image: true
CONFIG:
type: foss
log_level: debug
13 changes: 12 additions & 1 deletion spec/acceptance/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

describe 'redis' do
it 'should run successfully' do
case fact('osfamily')
when 'Debian'
redis_name = 'redis-server'
else
redis_name = 'redis'
end

pp = <<-EOS
Exec {
path => [ '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', ]
Expand All @@ -17,7 +24,11 @@ class { '::redis':
apply_manifest(pp, :catch_changes => true)
end

describe package('redis') do
describe package(redis_name) do
it { should be_installed }
end

describe service(redis_name) do
it { should be_running }
end
end
23 changes: 10 additions & 13 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
require 'beaker-rspec'
require 'beaker/puppet_install_helper'

unless ENV['RS_PROVISION'] == 'no'
hosts.each do |host|
# Install Puppet
if host.is_pe?
install_pe
else
install_puppet
end
end
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'

RSpec.configure do |c|
# Project root
Expand All @@ -23,9 +15,14 @@
puppet_module_install(:source => proj_root, :module_name => 'redis')

hosts.each do |host|
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")

shell('puppet module install puppetlabs-stdlib', { :acceptable_exit_codes => [0,1] })
if fact('osfamily') == 'Debian'
# These should be on all Deb-flavor machines by default...
# But Docker is often more slimline
shell('apt-get install apt-transport-https software-properties-common -y', { :acceptable_exit_codes => [0] })
end
on host, puppet('module', 'install', 'puppetlabs-stdlib -v 4.11.0'), { :acceptable_exit_codes => [0] }
on host, puppet('module', 'install', 'puppetlabs-apt -v 2.3.0'), { :acceptable_exit_codes => [0] }
on host, puppet('module', 'install', 'stahnma-epel -v 1.0.2'), { :acceptable_exit_codes => [0] }
end
end
end