diff --git a/.sync.yml b/.sync.yml index ca841d2..240fb8d 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,15 +1,16 @@ --- .travis.yml: beaker_sets: - centos6-64 - debian9-64 - debian10-64 + - ubuntu1804-64 env: global: - PARALLEL_TEST_PROCESSORS=8 beaker_puppet_collections: - puppet5 - puppet6 Rakefile: param_docs_pattern: - manifests/init.pp diff --git a/.travis.yml b/.travis.yml index c04e954..bfbacec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,71 +1,93 @@ --- # This file is managed centrally by modulesync # https://github.com/theforeman/foreman-installer-modulesync env: global: - PARALLEL_TEST_PROCESSORS=8 matrix: fast_finish: true include: - rvm: 2.4.1 env: PUPPET_VERSION=5.0 - rvm: 2.5.1 env: PUPPET_VERSION=6.0 # Acceptance tests - rvm: 2.5.1 env: - BEAKER_PUPPET_COLLECTION=puppet5 - BEAKER_setfile=centos6-64{hostname=centos6-64.example.com} script: bundle exec rake beaker services: docker bundler_args: --without development before_install: - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - rvm: 2.5.1 env: - BEAKER_PUPPET_COLLECTION=puppet6 - BEAKER_setfile=centos6-64{hostname=centos6-64.example.com} script: bundle exec rake beaker services: docker bundler_args: --without development before_install: - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - rvm: 2.5.1 env: - BEAKER_PUPPET_COLLECTION=puppet5 - BEAKER_setfile=debian9-64{hostname=debian9-64.example.com} script: bundle exec rake beaker services: docker bundler_args: --without development before_install: - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - rvm: 2.5.1 env: - BEAKER_PUPPET_COLLECTION=puppet6 - BEAKER_setfile=debian9-64{hostname=debian9-64.example.com} script: bundle exec rake beaker services: docker bundler_args: --without development before_install: - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - rvm: 2.5.1 env: - BEAKER_PUPPET_COLLECTION=puppet6 - BEAKER_setfile=debian10-64{hostname=debian10-64.example.com} script: bundle exec rake beaker services: docker bundler_args: --without development before_install: - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - sudo service docker restart + - rvm: 2.5.1 + env: + - BEAKER_PUPPET_COLLECTION=puppet5 + - BEAKER_setfile=ubuntu1804-64{hostname=ubuntu1804-64.example.com} + script: bundle exec rake beaker + services: docker + bundler_args: --without development + before_install: + - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + - sudo service docker restart + + - rvm: 2.5.1 + env: + - BEAKER_PUPPET_COLLECTION=puppet6 + - BEAKER_setfile=ubuntu1804-64{hostname=ubuntu1804-64.example.com} + script: bundle exec rake beaker + services: docker + bundler_args: --without development + before_install: + - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + - sudo service docker restart + bundler_args: --without system_tests development dist: xenial diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 2106d84..f46b526 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,56 +1,59 @@ ENV['PUPPET_INSTALL_TYPE'] ||= 'agent' ENV['BEAKER_IS_PE'] ||= 'no' ENV['BEAKER_PUPPET_COLLECTION'] ||= 'puppet6' ENV['BEAKER_debug'] ||= 'true' ENV['BEAKER_setfile'] ||= 'centos7-64{hostname=centos7-64.example.com}' ENV['BEAKER_HYPERVISOR'] ||= 'docker' require 'beaker-puppet' require 'beaker-rspec' require 'beaker/puppet_install_helper' require 'beaker/module_install_helper' run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' install_module_on(hosts) install_module_dependencies_on(hosts) install_module_from_forge('camptocamp-systemd', '>= 2.0.0 < 3.0.0') RSpec.configure do |c| # Readable test descriptions c.formatter = :documentation # Configure all nodes in nodeset c.before :suite do # Install module and dependencies hosts.each do |host| 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 + if fact_on(host, 'operatingsystem') == 'Ubuntu' + on host, 'apt-get -qq -y install cron' + 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 shared_examples 'the example' do |name| let(:pp) do path = File.join(File.dirname(File.dirname(__FILE__)), 'examples', name) File.read(path) end include_examples 'a idempotent resource' end Dir["./spec/support/acceptance/**/*.rb"].sort.each { |f| require f }