diff --git a/.gitignore b/.gitignore index ca915f6..f6e7540 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -modules/ -modulesync.yml +/modules/ +/modulesync.yml +/.bundle/ +/Gemfile.lock diff --git a/README.md b/README.md index 5324bce..751c5e1 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ config_defaults.yml might look like: You can add additional environments for a specific module to test by adding an extras: section with the same format to the module's .sync.yml. +By setting the `docker_sets`, the .travis.yml file sets up full-system tests running in a docker container. `docker_defaults` allows you to specify or replace global defaults. Use the `options` entry on a docker set, to override individual options. + **`moduleroot/.rspec`** Flat file containing recommended default rspec options. diff --git a/config_defaults.yml b/config_defaults.yml index 2523969..87599a7 100644 --- a/config_defaults.yml +++ b/config_defaults.yml @@ -1,15 +1,30 @@ --- .travis.yml: script: "\"bundle exec rake validate lint spec\"" + docker_sets: + - set: docker/ubuntu-14.04 + - set: docker/centos-7 + docker_defaults: + # values will replace @@SET@@ with the docker_sets' value + rvm: 2.1.6 + sudo: required + dist: trusty + services: docker + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=@@SET@@ + script: bundle exec rake beaker includes: - rvm: 2.1.6 env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes" + bundler_args: --without system_tests - rvm: 2.1.5 env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" + bundler_args: --without system_tests - rvm: 2.1.5 env: PUPPET_GEM_VERSION="~> 3.0" + bundler_args: --without system_tests - rvm: 1.9.3 env: PUPPET_GEM_VERSION="~> 3.0" + bundler_args: --without system_tests Gemfile: required: ':development, :unit_tests': diff --git a/moduleroot/.travis.yml b/moduleroot/.travis.yml index c249029..6505df9 100644 --- a/moduleroot/.travis.yml +++ b/moduleroot/.travis.yml @@ -3,26 +3,44 @@ sudo: false language: ruby cache: bundler -bundler_args: --without system_tests script: <%= @configs['script'] %> matrix: fast_finish: true include: -<% @configs['includes'].each do |include| -%> - - rvm: <%= include['rvm'] %> - env: <%= include['env'] %> +<% if @configs['docker_sets'] -%> +<% @configs['docker_sets'].each do |set| -%> +<% job = @configs['docker_defaults'].merge(set['options'] || {}) -%> + - rvm: <%= job['rvm'] %> +<% job.keys.sort.each do |k| -%> +<% next if k == 'rvm' -%> + <%= k %>: <%= job[k].gsub(/@@SET@@/, set['set']) %> +<% end -%> +<% end -%> +<% end -%> +<% @configs['includes'].each do |job| -%> + - rvm: <%= job['rvm'] %> +<% job.keys.sort.each do |k| -%> +<% next if k == 'rvm' -%> + <%= k %>: <%= job[k] %> +<% end -%> <% end -%> <% if @configs['extras'] -%> -<% @configs['extras'].each do |extra| -%> - - rvm: <%= extra['rvm'] %> - env: <%= extra['env'] %> +<% @configs['extras'].each do |job| -%> + - rvm: <%= job['rvm'] %> +<% job.keys.sort.each do |k| -%> +<% next if k == 'rvm' -%> + <%= k %>: <%= job[k] %> +<% end -%> <% end -%> <% end -%> <% if @configs['allow_failures'] -%> -<% @configs['allow_failures'].each do |allow_failures| -%> allow_failures: - - rvm: <%= allow_failures['rvm'] %> - env: <%= allow_failures['env'] %> +<% @configs['allow_failures'].each do |job| -%> + - rvm: <%= job['rvm'] %> +<% job.keys.sort.each do |k| -%> +<% next if k == 'rvm' -%> + <%= k %>: <%= job[k] %> +<% end -%> <% end -%> <% end -%> notifications: diff --git a/moduleroot/spec/acceptance/nodesets/centos-59-x64.yml b/moduleroot/spec/acceptance/nodesets/centos-59-x64.yml deleted file mode 100644 index 2ad90b8..0000000 --- a/moduleroot/spec/acceptance/nodesets/centos-59-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-59-x64: - roles: - - master - platform: el-5-x86_64 - box : centos-59-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: git diff --git a/moduleroot/spec/acceptance/nodesets/centos-64-x64-pe.yml b/moduleroot/spec/acceptance/nodesets/centos-64-x64-pe.yml deleted file mode 100644 index 7d9242f..0000000 --- a/moduleroot/spec/acceptance/nodesets/centos-64-x64-pe.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - centos-64-x64: - roles: - - master - - database - - dashboard - platform: el-6-x86_64 - box : centos-64-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: pe diff --git a/moduleroot/spec/acceptance/nodesets/centos-65-x64.yml b/moduleroot/spec/acceptance/nodesets/centos-65-x64.yml deleted file mode 100644 index 4e2cb80..0000000 --- a/moduleroot/spec/acceptance/nodesets/centos-65-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-65-x64: - roles: - - master - platform: el-6-x86_64 - box : centos-65-x64-vbox436-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/moduleroot/spec/acceptance/nodesets/centos-7-x64.yml b/moduleroot/spec/acceptance/nodesets/centos-7-x64.yml new file mode 100644 index 0000000..1a40c89 --- /dev/null +++ b/moduleroot/spec/acceptance/nodesets/centos-7-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-7-x64: + roles: + - agent + - default + platform: redhat-7-x86_64 + hypervisor: vagrant + box: puppetlabs/centos-7.2-64-nocm +CONFIG: + type: foss diff --git a/moduleroot/spec/acceptance/nodesets/debian-8-x64.yml b/moduleroot/spec/acceptance/nodesets/debian-8-x64.yml new file mode 100644 index 0000000..fef6e63 --- /dev/null +++ b/moduleroot/spec/acceptance/nodesets/debian-8-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-8-x64: + roles: + - agent + - default + platform: debian-8-amd64 + hypervisor: vagrant + box: puppetlabs/debian-8.2-64-nocm +CONFIG: + type: foss diff --git a/moduleroot/spec/acceptance/nodesets/default.yml b/moduleroot/spec/acceptance/nodesets/default.yml new file mode 100644 index 0000000..dba339c --- /dev/null +++ b/moduleroot/spec/acceptance/nodesets/default.yml @@ -0,0 +1,10 @@ +HOSTS: + ubuntu-1404-x64: + roles: + - agent + - default + platform: ubuntu-14.04-amd64 + hypervisor: vagrant + box: puppetlabs/ubuntu-14.04-64-nocm +CONFIG: + type: foss diff --git a/moduleroot/spec/acceptance/nodesets/docker/centos-7.yml b/moduleroot/spec/acceptance/nodesets/docker/centos-7.yml new file mode 100644 index 0000000..a3333aa --- /dev/null +++ b/moduleroot/spec/acceptance/nodesets/docker/centos-7.yml @@ -0,0 +1,12 @@ +HOSTS: + centos-7-x64: + platform: el-7-x86_64 + hypervisor: docker + image: centos:7 + docker_preserve_image: true + docker_cmd: '["/usr/sbin/init"]' + # install various tools required to get the image up to usable levels + docker_image_commands: + - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' +CONFIG: + trace_limit: 200 diff --git a/moduleroot/spec/acceptance/nodesets/docker/debian-8.yml b/moduleroot/spec/acceptance/nodesets/docker/debian-8.yml new file mode 100644 index 0000000..df5c319 --- /dev/null +++ b/moduleroot/spec/acceptance/nodesets/docker/debian-8.yml @@ -0,0 +1,11 @@ +HOSTS: + debian-8-x64: + platform: debian-8-amd64 + hypervisor: docker + image: debian:8 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen' +CONFIG: + trace_limit: 200 diff --git a/moduleroot/spec/acceptance/nodesets/docker/ubuntu-14.04.yml b/moduleroot/spec/acceptance/nodesets/docker/ubuntu-14.04.yml new file mode 100644 index 0000000..b1efa58 --- /dev/null +++ b/moduleroot/spec/acceptance/nodesets/docker/ubuntu-14.04.yml @@ -0,0 +1,12 @@ +HOSTS: + ubuntu-1404-x64: + platform: ubuntu-14.04-amd64 + hypervisor: docker + image: ubuntu:14.04 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + # ensure that upstart is booting correctly in the container + - 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8' +CONFIG: + trace_limit: 200 diff --git a/moduleroot/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml b/moduleroot/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml deleted file mode 100644 index 5ca1514..0000000 --- a/moduleroot/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-server-10044-x64: - roles: - - master - platform: ubuntu-10.04-amd64 - box : ubuntu-server-10044-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/moduleroot/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml b/moduleroot/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml deleted file mode 100644 index d065b30..0000000 --- a/moduleroot/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-server-12042-x64: - roles: - - master - platform: ubuntu-12.04-amd64 - box : ubuntu-server-12042-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/moduleroot/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/moduleroot/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml deleted file mode 100644 index cba1cd0..0000000 --- a/moduleroot/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -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