Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

Commit

Permalink
Modulesync update
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Mar 24, 2017
1 parent 4570c62 commit 42a4d3f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ matrix:
# Only Puppet >= 4.4 supports Ruby 2.3. Also limit the OS set we test Ruby 2.3 with.
- rvm: 2.3.0
env: PUPPET_VERSION=4.4 ONLY_OS=redhat-7-x86_64,centos-7-x86_64
bundler_args: --without development
bundler_args: --without system_tests development
sudo: false
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 3.5'
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 3.5'

gem 'rake'
gem 'rspec', '~> 3.0'
Expand All @@ -21,10 +21,13 @@ gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-strict_indent-check'
gem 'simplecov'
gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]}
gem 'json', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'beaker-rspec', {"groups"=>["system_tests"]}
gem 'beaker-puppet_install_helper', {"groups"=>["system_tests"]}
gem 'metadata-json-lint'
gem 'kafo_module_lint'

Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/nodesets/docker/centos-6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/Katello/foreman-installer-modulesync
HOSTS:
centos-6-x64:
platform: el-6-x86_64
hypervisor: docker
image: centos:6
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'rm -rf /var/run/network/*'
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
- 'rm /etc/init/tty.conf'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
19 changes: 19 additions & 0 deletions spec/acceptance/nodesets/docker/centos-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/Katello/foreman-installer-modulesync
HOSTS:
centos-7-x64:
platform: el-7-x86_64
hypervisor: docker
image: centos:7
docker_preserve_image: true
docker_cmd: '["/usr/sbin/init"]'
docker_image_commands:
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which ss'
- 'systemctl mask getty@tty1.service'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
28 changes: 23 additions & 5 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'

hosts.each do |host|
# Install Puppet
install_puppet
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'

RSpec.configure do |c|
# Project root
Expand All @@ -18,7 +16,27 @@
# Install module and dependencies
puppet_module_install(:source => proj_root, :module_name => 'crane')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-unknown', 'puppetlabs-apache', 'puppet-foreman', 'puppetlabs-concat', 'puppet-certs', 'puppet-common'), { :acceptable_exit_codes => [0,1] }
["puppetlabs-stdlib"].each do |mod|
on host, puppet('module', 'install', mod), { :acceptable_exit_codes => [0] }
end

if fact_on(host, 'osfamily') == 'RedHat'
# don't delete downloaded rpm for use with BEAKER_provision=no +
# BEAKER_destroy=no
on host, 'sed -i "s/keepcache=.*/keepcache=1/" /etc/yum.conf'
# refresh check if cache needs refresh on next yum command
on host, 'yum clean expire-cache'
end
end
end
end

shared_examples 'a idempotent resource' do
it 'applies with no errors' do
apply_manifest(pp, catch_failures: true)
end

it 'applies a second time without changes' do
apply_manifest(pp, catch_changes: true)
end
end

0 comments on commit 42a4d3f

Please sign in to comment.