From c94063df097fd7df31ca3b2bbd7c07d7293a34e7 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Tue, 6 Apr 2021 10:23:51 -0400 Subject: [PATCH] Major updates (read description) * Drop Puppet 5 support * Add Puppet 7 support * Drop Debian 8 support * Support perfSONAR 4.3.x --- .fixtures.yml | 2 +- .github/workflows/ci.yaml | 84 ++++++++++++ .github/workflows/release.yaml | 30 +++++ .sync.yml | 42 +++--- .travis.yml | 133 ------------------- Gemfile | 13 +- manifests/firewall.pp | 1 + manifests/repo.pp | 4 +- metadata.json | 21 +-- spec/acceptance/lsregistrationdaemon_spec.rb | 5 +- spec/acceptance/nodesets/centos-7.yml | 4 + spec/acceptance/nodesets/debian-8.yml | 25 ---- spec/acceptance/nodesets/debian-9.yml | 4 + spec/acceptance/nodesets/ubuntu-1604.yml | 4 + spec/acceptance/nodesets/ubuntu-1804.yml | 4 + spec/acceptance/pscheduler_agent_spec.rb | 5 +- spec/spec_helper.rb | 2 +- spec/spec_helper_acceptance.rb | 10 -- spec/spec_helper_acceptance_setup.rb | 6 +- 19 files changed, 175 insertions(+), 224 deletions(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release.yaml delete mode 100644 .travis.yml delete mode 100644 spec/acceptance/nodesets/debian-8.yml diff --git a/.fixtures.yml b/.fixtures.yml index 6b28726..91fdc97 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -14,7 +14,7 @@ fixtures: firewall: repo: https://github.com/puppetlabs/puppetlabs-firewall.git epel: - repo: https://github.com/stahnma/puppet-module-epel.git + repo: https://github.com/voxpupuli/puppet-epel.git httpauth: repo: https://github.com/jamtur01/jamtur01-httpauth.git symlinks: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c0bd6f8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,84 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: + +jobs: + unit: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.allow_failure }} + strategy: + fail-fast: false + matrix: + include: + - ruby: 2.5.7 + puppet: 6 + fixtures: .fixtures.yml + allow_failure: false + - ruby: 2.7.0 + puppet: 7 + fixtures: .fixtures.yml + allow_failure: false + env: + BUNDLE_WITHOUT: system_tests:release + PUPPET_GEM_VERSION: "~> ${{ matrix.puppet }}.0" + FACTER_GEM_VERSION: "< 4.0" + FIXTURES_YML: ${{ matrix.fixtures }} + name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + bundler: '2.1.0' + - name: Validate + run: bundle exec rake check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint + - name: Run tests + run: bundle exec rake parallel_spec + acceptance: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + set: + - "centos-7" + - "debian-9" + - "ubuntu-1604" + - "ubuntu-1804" + puppet: + - "puppet6" + - "puppet7" + env: + BUNDLE_WITHOUT: development:release + BEAKER_debug: true + name: ${{ matrix.puppet }} ${{ matrix.set }} + steps: + - name: Enable IPv6 on docker + run: | + echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + sudo service docker restart + # https://github.com/actions/virtual-environments/issues/181#issuecomment-610874237 + - name: apparmor + run: | + set -x + sudo apt-get remove mysql-server --purge + sudo apt-get install apparmor-profiles + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld + - uses: actions/checkout@v2 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + bundler: '2.1.0' + - name: Run tests + run: bundle exec rake beaker + env: + BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }} + BEAKER_set: ${{ matrix.set }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..495a715 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +name: Release + +on: + push: + tags: + - '*' + +env: + BUNDLE_WITHOUT: system_tests + +jobs: + deploy: + name: 'deploy to forge' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + bundler: '2.1.0' + - name: Build and Deploy + env: + # Configure secrets here: + # https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets + BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}' + BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}' + run: bundle exec rake module:push diff --git a/.sync.yml b/.sync.yml index 6e8af0f..fe21fe3 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,34 +1,26 @@ --- -.travis.yml: - dist: xenial - docker_defaults: - dist: xenial - docker_sets: - - set: centos-7 - collection: puppet5 - - set: centos-7 - collection: puppet6 - - set: debian-9 - collection: puppet5 - - set: debian-9 - collection: puppet6 - - set: ubuntu-1604 - collection: puppet5 - - set: ubuntu-1604 - collection: puppet6 - - set: ubuntu-1804 - collection: puppet5 - - set: ubuntu-1804 - collection: puppet6 - user: treydock - secure: "muLzPZHN/E/gScJPe5Um2Nh5BqmQlT6KJumO92zlusSFLP8FOxwV7Nhc9HdoHPcUJ1feGto6Fkwgwqe+YycDGXqgwAtts3sOICvVqkV+2PjqQAmw2AIC9p8ppDCzMAdGPXDIBwKPs+0uhY/pIB1+EToRFvXELSj5Gl3UK49YRSNjtgIrNB1ALzHDWMobNjsk1uiJupyDoyDKytyQiX6xTbmE03SA96UuD7bN7IqIPDhCe8xzx+VGCiHPnlV9tSLwhXkzHslXwfCCd33N8VpmqpE+8/gXiiB3Ee3TBXd7+HlzbkmUperigPzyCC0uRTy8Ugvk8TGBDFcLfdZPN+UK6md1rAhWfrvSAoEpiPkZHtfnb6ziWLG7HzXPrC731h1/Ohd6ojEGEqxryGSFQNpjiapYqtiUg+usQgUGU26Jzs5ES6sNdE7Rp1Uy/cGnFH/+rYp5HYPiXmAgVQuwsd6sxi5fNIG+5f97bfhFcZ0QHmdNoG3S46XSwHC0Jc0z9WNQZjd4JsGD5QfD6GGlBv3ZkLu2Ob4bRmvfzpoy3ggxgfgdRngAX+z/RSaPdeDL5QcFBN8I7C8R5g6kAH15UwLE5/Tv9grXBb1CarhZblkqdbJkK9udiA7VBPYlsYa8C24K4f5Fiq9jIWcC0s5Spy6j0B9m1SjXtJhrKgjkOqLgmzQ=" +.github/workflows/ci.yaml: + acceptance_matrix: + set: + - centos-7 + - ---centos-8 + - debian-9 + - ubuntu-1604 + - ubuntu-1804 .gitlab-ci.yml: delete: true appveyor.yml: delete: true -spec/acceptance/nodesets/centos-6.yml: - delete: true +Gemfile: + required: + ':development': + - gem: rspec-json_expectations spec/acceptance/nodesets/centos-8.yml: delete: true spec/acceptance/nodesets/debian-10.yml: delete: true +spec/acceptance/nodesets/ubuntu-2004.yml: + delete: true +spec/spec_helper.rb: + spec_overrides: + - "require 'rspec/json_expectations'" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index af7db0a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,133 +0,0 @@ ---- -os: linux -dist: xenial -language: ruby -cache: bundler -before_install: - - bundle -v - - rm -f Gemfile.lock - - "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner" - - "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used" - - "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set" - - '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION' - - gem --version - - bundle -v -script: - - 'bundle exec rake $CHECK' -bundler_args: --without system_tests -rvm: - - 2.5.7 -env: - global: - - FACTER_GEM_VERSION="< 4.0" -stages: - - static - - spec - - acceptance - - - if: tag =~ ^v\d - name: deploy -jobs: - fast_finish: true - include: - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=centos-7 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=centos-7 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=debian-9 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=debian-9 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=ubuntu-1604 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=ubuntu-1604 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=ubuntu-1804 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - bundler_args: --with system_tests - dist: xenial - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=ubuntu-1804 BEAKER_TESTMODE=apply - rvm: 2.5.7 - script: bundle exec rake beaker - services: docker - stage: acceptance - sudo: required - - - env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" - stage: static - - - env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec - rvm: 2.4.9 - stage: spec - - - env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec - rvm: 2.5.7 - stage: spec - - - env: DEPLOY_TO_FORGE=yes - stage: deploy -branches: - only: - - master - - /^v\d/ -notifications: - email: treydock@gmail.com -deploy: - provider: puppetforge - username: treydock - password: - secure: "muLzPZHN/E/gScJPe5Um2Nh5BqmQlT6KJumO92zlusSFLP8FOxwV7Nhc9HdoHPcUJ1feGto6Fkwgwqe+YycDGXqgwAtts3sOICvVqkV+2PjqQAmw2AIC9p8ppDCzMAdGPXDIBwKPs+0uhY/pIB1+EToRFvXELSj5Gl3UK49YRSNjtgIrNB1ALzHDWMobNjsk1uiJupyDoyDKytyQiX6xTbmE03SA96UuD7bN7IqIPDhCe8xzx+VGCiHPnlV9tSLwhXkzHslXwfCCd33N8VpmqpE+8/gXiiB3Ee3TBXd7+HlzbkmUperigPzyCC0uRTy8Ugvk8TGBDFcLfdZPN+UK6md1rAhWfrvSAoEpiPkZHtfnb6ziWLG7HzXPrC731h1/Ohd6ojEGEqxryGSFQNpjiapYqtiUg+usQgUGU26Jzs5ES6sNdE7Rp1Uy/cGnFH/+rYp5HYPiXmAgVQuwsd6sxi5fNIG+5f97bfhFcZ0QHmdNoG3S46XSwHC0Jc0z9WNQZjd4JsGD5QfD6GGlBv3ZkLu2Ob4bRmvfzpoy3ggxgfgdRngAX+z/RSaPdeDL5QcFBN8I7C8R5g6kAH15UwLE5/Tv9grXBb1CarhZblkqdbJkK9udiA7VBPYlsYa8C24K4f5Fiq9jIWcC0s5Spy6j0B9m1SjXtJhrKgjkOqLgmzQ=" - on: - tags: true - all_branches: true - condition: "$DEPLOY_TO_FORGE = yes" diff --git a/Gemfile b/Gemfile index f6cb73f..24c9df4 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,6 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments minor_version = ruby_version_segments[0..1].join('.') group :development do - gem "facter", '< 4.0', require: false gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') @@ -30,18 +29,18 @@ group :development do gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-lint-param-docs", require: false - gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2') - gem "rspec-json_expectations" + gem "rspec-json_expectations", require: false + gem "github_changelog_generator", require: false end group :system_tests do - gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby] - gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-module-posix-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:ruby] + gem "puppet-module-win-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.0') gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1') gem "beaker-pe", require: false gem "beaker-hostgenerator" gem "beaker-rspec" - gem "beaker-docker" + gem "beaker-docker", *location_for(ENV['BEAKER_DOCKER_VERSION'] || '~> 0.7.0') gem "beaker-puppet" end @@ -51,6 +50,8 @@ hiera_version = ENV['HIERA_GEM_VERSION'] gems = {} +gems['rake'] = [require: false] +gems['puppetlabs_spec_helper'] = [require: false] gems['puppet'] = location_for(puppet_version) # If facter or hiera versions have been specified via the environment diff --git a/manifests/firewall.pp b/manifests/firewall.pp index d06c861..2e9338a 100644 --- a/manifests/firewall.pp +++ b/manifests/firewall.pp @@ -37,6 +37,7 @@ {'name' => 'ndt-test', 'dport' => '3001-3003', 'proto' => ['tcp']}, {'name' => 'ndt-control', 'dport' => '7123', 'proto' => ['tcp']}, {'name' => 'ndt-flash', 'dport' => '843', 'proto' => ['tcp']}, + {'name' => 'simplestream', 'dport' => '5890-5900', 'proto' => ['tcp']}, ] ($ipv4_firewall_rules + $firewall_rules).each |Integer $index, Hash $rule| { diff --git a/manifests/repo.pp b/manifests/repo.pp index 92e8d8c..fd878e8 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -4,8 +4,8 @@ assert_private() if $facts['os']['family'] == 'RedHat' { - if $::perfsonar::manage_epel { - include ::epel + if $perfsonar::manage_epel { + contain 'epel' } yumrepo { 'perfSONAR': descr => 'perfSONAR RPM Repository - software.internet2.edu - main', diff --git a/metadata.json b/metadata.json index a4f90e6..91d30e6 100644 --- a/metadata.json +++ b/metadata.json @@ -10,19 +10,19 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.13.1 <6.0.0" + "version_requirement": ">= 4.13.1 <8.0.0" }, { "name": "puppetlabs/apt", - "version_requirement": ">= 6.0.0 <8.0.0" + "version_requirement": ">= 6.0.0 <9.0.0" }, { "name": "puppetlabs/firewall", - "version_requirement": ">= 1.0.0 <3.0.0" + "version_requirement": ">= 1.0.0 <4.0.0" }, { - "name": "stahnma/epel", - "version_requirement": ">= 1.0.0 <2.0.0" + "name": "puppet/epel", + "version_requirement": ">= 3.0.0 <4.0.0" }, { "name": "jamtur01/httpauth", @@ -48,16 +48,9 @@ "7" ] }, - { - "operatingsystem": "Scientific", - "operatingsystemrelease": [ - "7" - ] - }, { "operatingsystem": "Debian", "operatingsystemrelease": [ - "8", "9" ] }, @@ -72,10 +65,10 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 5.0.0 < 7.0.0" + "version_requirement": ">= 6.0.0 < 8.0.0" } ], "pdk-version": "1.17.0", "template-url": "https://github.com/treydock/pdk-templates.git#master", - "template-ref": "heads/master-0-g58023b5" + "template-ref": "heads/master-0-g1d2967a" } diff --git a/spec/acceptance/lsregistrationdaemon_spec.rb b/spec/acceptance/lsregistrationdaemon_spec.rb index 7123270..e1e8a86 100644 --- a/spec/acceptance/lsregistrationdaemon_spec.rb +++ b/spec/acceptance/lsregistrationdaemon_spec.rb @@ -13,7 +13,10 @@ class { 'perfsonar': EOS end - it_behaves_like 'an idempotent resource' + it 'runs successfully' do + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end describe service('perfsonar-lsregistrationdaemon') do it { is_expected.not_to be_enabled } diff --git a/spec/acceptance/nodesets/centos-7.yml b/spec/acceptance/nodesets/centos-7.yml index 4366bc2..95413f7 100644 --- a/spec/acceptance/nodesets/centos-7.yml +++ b/spec/acceptance/nodesets/centos-7.yml @@ -10,6 +10,10 @@ HOSTS: - '/usr/sbin/init' docker_image_commands: - 'yum install -y wget which cronie iproute initscripts' + docker_env: + - LANG=en_US.UTF-8 + - LANGUAGE=en_US.UTF-8 + - LC_ALL=en_US.UTF-8 docker_container_name: 'perfsonar-el7' CONFIG: log_level: debug diff --git a/spec/acceptance/nodesets/debian-8.yml b/spec/acceptance/nodesets/debian-8.yml deleted file mode 100644 index 9112a88..0000000 --- a/spec/acceptance/nodesets/debian-8.yml +++ /dev/null @@ -1,25 +0,0 @@ -HOSTS: - debian8: - roles: - - agent - platform: debian-8-amd64 - hypervisor: docker - image: debian:8 - docker_preserve_image: true - docker_cmd: - - '/sbin/init' - docker_image_commands: - - 'apt-get install -y wget net-tools locales apt-transport-https ca-certificates' - - 'rm -f /usr/sbin/policy-rc.d' - - 'echo "LC_ALL=en_US.UTF-8" >> /etc/environment' - - 'echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen' - - 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' - - 'locale-gen en_US.UTF-8' - docker_container_name: 'perfsonar-debian8' -CONFIG: - log_level: debug - type: foss -ssh: - password: root - auth_methods: ["password"] - diff --git a/spec/acceptance/nodesets/debian-9.yml b/spec/acceptance/nodesets/debian-9.yml index d93dd62..4dd776f 100644 --- a/spec/acceptance/nodesets/debian-9.yml +++ b/spec/acceptance/nodesets/debian-9.yml @@ -14,6 +14,10 @@ HOSTS: - 'echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen' - 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' - 'locale-gen en_US.UTF-8' + docker_env: + - LANG=en_US.UTF-8 + - LANGUAGE=en_US.UTF-8 + - LC_ALL=en_US.UTF-8 docker_container_name: 'perfsonar-debian9' CONFIG: log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-1604.yml b/spec/acceptance/nodesets/ubuntu-1604.yml index 303073f..e5181fe 100644 --- a/spec/acceptance/nodesets/ubuntu-1604.yml +++ b/spec/acceptance/nodesets/ubuntu-1604.yml @@ -10,6 +10,10 @@ HOSTS: docker_image_commands: - 'apt-get install -y wget net-tools locales apt-transport-https ca-certificates' - 'locale-gen en_US.UTF-8' + docker_env: + - LANG=en_US.UTF-8 + - LANGUAGE=en_US.UTF-8 + - LC_ALL=en_US.UTF-8 docker_container_name: 'perfsonar-ubuntu1604' CONFIG: log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-1804.yml b/spec/acceptance/nodesets/ubuntu-1804.yml index 0af8b66..bade857 100644 --- a/spec/acceptance/nodesets/ubuntu-1804.yml +++ b/spec/acceptance/nodesets/ubuntu-1804.yml @@ -11,6 +11,10 @@ HOSTS: - "rm -f /etc/dpkg/dpkg.cfg.d/excludes" - 'apt-get install -y wget net-tools locales apt-transport-https ca-certificates' - 'locale-gen en_US.UTF-8' + docker_env: + - LANG=en_US.UTF-8 + - LANGUAGE=en_US.UTF-8 + - LC_ALL=en_US.UTF-8 docker_container_name: 'perfsonar-ubuntu1804' CONFIG: log_level: debug diff --git a/spec/acceptance/pscheduler_agent_spec.rb b/spec/acceptance/pscheduler_agent_spec.rb index c3f6367..512fb7c 100644 --- a/spec/acceptance/pscheduler_agent_spec.rb +++ b/spec/acceptance/pscheduler_agent_spec.rb @@ -17,7 +17,10 @@ class { 'perfsonar': EOS end - it_behaves_like 'an idempotent resource' + it 'runs successfully' do + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end describe service('psconfig-pscheduler-agent') do it { is_expected.to be_enabled } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 638220b..3a1034f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,6 @@ require 'rspec-puppet-facts' require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) -require 'rspec/json_expectations' include RspecPuppetFacts @@ -60,3 +59,4 @@ def ensure_module_defined(module_name) end # 'spec_overrides' from sync.yml will appear below this line +require 'rspec/json_expectations' diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index b7831b4..0f66cf4 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -18,13 +18,3 @@ require 'spec_helper_acceptance_setup' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_setup.rb')) # 'spec_overrides' from sync.yml will appear below this line - -shared_examples 'an 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 diff --git a/spec/spec_helper_acceptance_setup.rb b/spec/spec_helper_acceptance_setup.rb index 74bf1e6..38f46f5 100644 --- a/spec/spec_helper_acceptance_setup.rb +++ b/spec/spec_helper_acceptance_setup.rb @@ -1,10 +1,6 @@ -collection = ENV['BEAKER_PUPPET_COLLECTION'] || 'puppet5' - RSpec.configure do |c| c.before :suite do - if collection == 'puppet6' - on hosts, puppet('module', 'install', 'puppetlabs-yumrepo_core', '--version', '">= 1.0.1 < 2.0.0"'), acceptable_exit_codes: [0, 1] - end + on hosts, puppet('module', 'install', 'puppetlabs-yumrepo_core', '--version', '">= 1.0.1 < 2.0.0"'), acceptable_exit_codes: [0, 1] end end