From acdba597901c108f781d573364ce5373c4901d24 Mon Sep 17 00:00:00 2001 From: Rehan Mahmood Date: Mon, 17 Feb 2020 15:52:29 -0500 Subject: [PATCH] - Added support for CentOS 8. - Updated os support matrix. - Updated `pdk` templates. --- .rubocop.yml | 7 ++++ .sync.yml | 11 +----- .travis.yml | 14 ++++++- Gemfile | 8 ++-- Rakefile | 15 +++++++- metadata.json | 39 ++++++++++---------- spec/acceptance/nodesets/centos-7-x64.yml | 10 ----- spec/acceptance/nodesets/debian-8-x64.yml | 10 ----- spec/acceptance/nodesets/docker/centos-8.yml | 12 ++++++ spec/default_facts.yml | 1 + spec/spec_helper.rb | 2 + 11 files changed, 73 insertions(+), 56 deletions(-) delete mode 100644 spec/acceptance/nodesets/centos-7-x64.yml delete mode 100644 spec/acceptance/nodesets/debian-8-x64.yml create mode 100644 spec/acceptance/nodesets/docker/centos-8.yml diff --git a/.rubocop.yml b/.rubocop.yml index de29175..c533f4d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -28,6 +28,7 @@ GetText/DecorateString: Description: We don't want to decorate test output. Exclude: - spec/**/* + Enabled: false RSpec/BeforeAfterAll: Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. @@ -91,6 +92,12 @@ Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true +GetText/DecorateFunctionMessage: + Enabled: false +GetText/DecorateStringFormattingUsingInterpolation: + Enabled: false +GetText/DecorateStringFormattingUsingPercent: + Enabled: false Layout/EndOfLine: Enabled: false Layout/IndentHeredoc: diff --git a/.sync.yml b/.sync.yml index b506147..b1c58ba 100644 --- a/.sync.yml +++ b/.sync.yml @@ -27,6 +27,7 @@ - set: docker/debian-10 - set: docker/debian-9 - set: docker/debian-8 + - set: docker/centos-8 - set: docker/centos-7 docker_defaults: @@ -57,13 +58,3 @@ locales/config.yaml: default_locale: 'en' source_files: - './lib/**/*.rb' - -spec/acceptance/nodesets/centos-7-x64.yml: -spec/acceptance/nodesets/debian-8-x64.yml: -spec/acceptance/nodesets/default.yml: -spec/acceptance/nodesets/docker/centos-7.yml: -spec/acceptance/nodesets/docker/debian-8.yml: -spec/acceptance/nodesets/docker/debian-9.yml: -spec/acceptance/nodesets/docker/ubuntu-14.04.yml: -spec/acceptance/nodesets/docker/ubuntu-16.04.yml: -spec/acceptance/nodesets/docker/ubuntu-18.04.yml: diff --git a/.travis.yml b/.travis.yml index bd5035c..d313dd3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,10 @@ cache: bundler before_install: - bundle -v - rm -f Gemfile.lock - - gem update --system $RUBYGEMS_VERSION + - "# 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: @@ -77,6 +80,15 @@ matrix: services: docker stage: acceptance sudo: required + - + bundler_args: --with system_tests + dist: trusty + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-8 BEAKER_TESTMODE=apply + rvm: 2.5.3 + script: bundle exec rake beaker + services: docker + stage: acceptance + sudo: required - bundler_args: --with system_tests dist: trusty diff --git a/Gemfile b/Gemfile index ab11400..57770cb 100644 --- a/Gemfile +++ b/Gemfile @@ -24,10 +24,10 @@ group :development do gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] - gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] - gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] + gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] + 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] end group :system_tests do gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby] diff --git a/Rakefile b/Rakefile index d9b223c..cb7ed0c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' @@ -15,8 +17,17 @@ end def changelog_project return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = nil || JSON.load(File.read('metadata.json'))['source'].match(%r{.*/([^/]*)})[1] - raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil? + + returnVal = nil + returnVal ||= begin + metadata_source = JSON.load(File.read('metadata.json'))['source'] + metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) + + metadata_source_match && metadata_source_match[1] + end + + raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? + puts "GitHubChangelogGenerator project:#{returnVal}" returnVal end diff --git a/metadata.json b/metadata.json index 455ef75..9e13ed8 100644 --- a/metadata.json +++ b/metadata.json @@ -21,7 +21,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "5", "6", "7", "8" @@ -30,32 +29,33 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "5", "6", - "7" + "7", + "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "5", "6", - "7" + "7", + "8" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ - "5", "6", - "7" + "7", + "8" ] }, { "operatingsystem": "Fedora", "operatingsystemrelease": [ - "29", - "30" + "30", + "31", + "32" ] }, { @@ -79,31 +79,32 @@ "operatingsystemrelease": [ "14.04", "16.04", - "17.10", "18.04", "18.10", - "19.04" + "19.04", + "19.10" ] }, { "operatingsystem": "FreeBSD", "operatingsystemrelease": [ - "9", "10", - "11" + "11", + "12" ] }, { "operatingsystem": "DragonFly", "operatingsystemrelease": [ - "3.6", - "3.8", "4.0", "4.2", "4.4", "4.6", "4.8", - "5.0" + "5.0", + "5.2", + "5.4", + "5.6" ] }, { @@ -123,7 +124,7 @@ "Public Key Infrastructure", "Certificate Managment" ], - "pdk-version": "1.12.0", - "template-url": "pdk-default#1.12.0", - "template-ref": "1.12.0-0-g55d9ae2" + "pdk-version": "1.16.0", + "template-url": "pdk-default#1.16.0", + "template-ref": "tags/1.16.0-0-gaf44904" } diff --git a/spec/acceptance/nodesets/centos-7-x64.yml b/spec/acceptance/nodesets/centos-7-x64.yml deleted file mode 100644 index 5eebdef..0000000 --- a/spec/acceptance/nodesets/centos-7-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-7-x64: - roles: - - agent - - default - platform: el-7-x86_64 - hypervisor: vagrant - box: puppetlabs/centos-7.2-64-nocm -CONFIG: - type: foss diff --git a/spec/acceptance/nodesets/debian-8-x64.yml b/spec/acceptance/nodesets/debian-8-x64.yml deleted file mode 100644 index fef6e63..0000000 --- a/spec/acceptance/nodesets/debian-8-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -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/spec/acceptance/nodesets/docker/centos-8.yml b/spec/acceptance/nodesets/docker/centos-8.yml new file mode 100644 index 0000000..6a25e5d --- /dev/null +++ b/spec/acceptance/nodesets/docker/centos-8.yml @@ -0,0 +1,12 @@ +HOSTS: + centos8-64: + docker_cmd: + - "/sbin/init" + image: centos:8 + platform: el-8-x86_64 + packaging_platform: el-8-x86_64 + docker_image_commands: + - cp /bin/true /sbin/agetty + - dnf install -y crontabs initscripts iproute openssl tar wget + hypervisor: docker + roles: [] diff --git a/spec/default_facts.yml b/spec/default_facts.yml index ea1e480..f777abf 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -3,5 +3,6 @@ # Facts specified here will override the values provided by rspec-puppet-facts. --- ipaddress: "172.16.254.254" +ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" is_pe: false macaddress: "AA:AA:AA:AA:AA:AA" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index feb5720..35a1408 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts'