-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from jhoblitt/plumbing/update
update build/test plumbing
- Loading branch information
Showing
16 changed files
with
148 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
sudo: false | ||
language: ruby | ||
bundler_args: --without beaker | ||
bundler_args: --without release beaker | ||
rvm: | ||
- 2.0 | ||
- 2.1 | ||
- 2.2 | ||
- '2.0' | ||
- '2.1' | ||
- '2.2' | ||
env: | ||
- PUPPET_GEM_VERSION="~> 3.7" | ||
- PUPPET_GEM_VERSION="~> 4.0" | ||
- PUPPET_GEM_VERSION="~> 4.9" | ||
matrix: | ||
include: | ||
- rvm: '2.2' | ||
sudo: required | ||
services: docker | ||
env: BEAKER_set="centos-7-docker" | ||
script: travis_retry bundle exec rake beaker | ||
bundler_args: --without release | ||
exclude: | ||
- rvm: 2.2 | ||
- rvm: '2.2' | ||
env: PUPPET_GEM_VERSION="~> 3.7" | ||
- rvm: '2.0' | ||
env: PUPPET_GEM_VERSION="~> 4.9" | ||
fast_finish: true | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,22 @@ | ||
source 'https://rubygems.org' | ||
|
||
if puppetversion = ENV['PUPPET_GEM_VERSION'] | ||
gem 'puppet', puppetversion, :require => false | ||
else | ||
gem 'puppet', :require => false | ||
end | ||
|
||
if facterversion = ENV['FACTER_GEM_VERSION'] | ||
gem 'facter', facterversion, :require => false | ||
else | ||
gem 'facter', :require => false | ||
end | ||
gem 'metadata-json-lint', :require => false | ||
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 4.9', :require => false | ||
gem 'puppetlabs_spec_helper', '~> 1.2', :require => false | ||
gem 'puppet-lint', '~> 2.0', :require => false | ||
gem 'puppet-syntax', :require => false | ||
gem 'rake', :require => false | ||
gem 'rspec-puppet', '~> 2.5.0', :require => false | ||
gem 'travis', '~> 1.8', :require => false | ||
|
||
group :development, :test do | ||
gem 'rake', :require => false | ||
# https://github.com/rspec/rspec-core/issues/1864 | ||
gem 'rspec', '< 3.2.0', {"platforms"=>["ruby_18"]} | ||
gem 'puppetlabs_spec_helper', :require => false | ||
gem 'puppet-lint', '>= 1.1.0', :require => false | ||
gem 'puppet-syntax', :require => false | ||
gem 'rspec-puppet', '~> 2.1.0', :require => false | ||
gem 'metadata-json-lint', :require => false | ||
group :release do | ||
gem 'puppet-blacksmith', :require => false | ||
end | ||
|
||
group :beaker do | ||
gem 'serverspec', :require => false | ||
gem 'beaker', '<= 2.26.0', :require => false | ||
gem 'beaker-rspec', :require => false | ||
gem 'pry', :require => false | ||
gem 'travis-lint', :require => false | ||
gem 'puppet-blacksmith', :require => false | ||
gem 'beaker-puppet_install_helper', :require => false | ||
gem 'beaker-rspec', '~> 6.0.0', :require => false | ||
gem 'serverspec', :require => false | ||
end | ||
|
||
# vim:ft=ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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: | ||
- 'yum install -y crontabs tar wget' | ||
default_apply_opts: | ||
disable_warnings: deprecations | ||
CONFIG: | ||
type: foss | ||
log_level: debug |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM centos:7 | ||
ENV container docker | ||
|
||
# beaker default behavior | ||
RUN yum clean all | ||
RUN yum install -y sudo openssh-server openssh-clients curl ntpdate | ||
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key | ||
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key | ||
RUN mkdir -p /var/run/sshd | ||
RUN echo root:root | chpasswd | ||
RUN sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config | ||
RUN sed -ri 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config | ||
RUN yum install -y crontabs tar wget | ||
EXPOSE 22 | ||
|
||
# based on https://github.com/slafs/dockerfiles/blob/master/centos7-systemd/Dockerfile | ||
RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs | ||
RUN systemctl mask dev-mqueue.mount dev-hugepages.mount \ | ||
systemd-remount-fs.service sys-kernel-config.mount \ | ||
sys-kernel-debug.mount sys-fs-fuse-connections.mount \ | ||
display-manager.service systemd-logind.service | ||
RUN systemctl disable graphical.target; systemctl enable multi-user.target | ||
RUN systemctl enable sshd.service | ||
VOLUME ["/sys/fs/cgroup"] | ||
|
||
# provides /usr/sbin/service required by the service redhat provider | ||
RUN yum install -y initscripts | ||
|
||
CMD ["/usr/lib/systemd/systemd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
docker_preserve_image: true | ||
dockerfile: spec/acceptance/nodesets/centos-7-docker.Dockerfile | ||
default_apply_opts: | ||
disable_warnings: deprecations | ||
CONFIG: | ||
type: foss | ||
log_level: debug |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
HOSTS: | ||
ubuntu-14.04-x64: | ||
platform: ubuntu-14.04-amd64 | ||
hypervisor : docker | ||
#image: ubuntu:14.04 | ||
image: electrical/ubuntu:14.04 | ||
docker_preserve_image: true | ||
docker_cmd: '["/sbin/init"]' | ||
default_apply_opts: | ||
disable_warnings: deprecations | ||
CONFIG: | ||
type: foss | ||
log_level: debug |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,57 @@ | ||
require 'beaker-rspec/spec_helper' | ||
require 'beaker-rspec/helpers/serverspec' | ||
require 'beaker/puppet_install_helper' | ||
|
||
unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no' | ||
# This will install the latest available package on el and deb based | ||
# systems fail on windows and osx, and install via gem on other *nixes | ||
foss_opts = {:default_action => 'gem_install'} | ||
|
||
if default.is_pe?; then | ||
install_pe; | ||
else | ||
install_puppet(foss_opts); | ||
end | ||
|
||
hosts.each do |host| | ||
on hosts, "mkdir -p #{host['distmoduledir']}" | ||
end | ||
# Install Puppet | ||
unless ENV['RS_PROVISION'] == 'no' | ||
ENV['PUPPET_INSTALL_TYPE'] ||= 'agent' | ||
# puppet_install_helper does not understand pessimistic version constraints | ||
# so we are ignoring PUPPET_VERSION. Use PUPPET_INSTALL_VERSION instead. | ||
ENV.delete 'PUPPET_VERSION' | ||
run_puppet_install_helper | ||
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 | ||
puppet_module_install(:source => proj_root, :module_name => 'udev') | ||
hosts.each do |host| | ||
copy_module_to(host, :source => proj_root, :module_name => 'udev') | ||
|
||
on host, puppet('module', 'install', 'puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]} | ||
on host, puppet('module', 'install', 'stahnma-epel'), {:acceptable_exit_codes => [0, 1]} | ||
end | ||
end | ||
end | ||
|
||
def apply(pp, options = {}) | ||
if ENV.key?('PUPPET_DEBUG') | ||
options[:debug] = true | ||
end | ||
|
||
apply_manifest(pp, options) | ||
end | ||
|
||
# Run it twice and test for idempotency | ||
def apply2(pp) | ||
apply(pp, :catch_failures => true) | ||
apply(pp, :catch_changes => true) | ||
end | ||
|
||
# probe stolen from: | ||
# https://github.com/camptocamp/puppet-systemd/blob/master/lib/facter/systemd.rb#L26 | ||
# | ||
# See these issues for an explination of why this is nessicary rather than | ||
# using fact() from beaker-facter in the DSL: | ||
# | ||
# https://tickets.puppetlabs.com/browse/BKR-1040 | ||
# https://tickets.puppetlabs.com/browse/BKR-1041 | ||
# | ||
if shell('ps -p 1 -o comm=').stdout =~ /systemd/ | ||
$systemd = true | ||
else | ||
$systemd = false | ||
end |