From 3f9a1acbae3f306b192f9786c9142af1d371a000 Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Thu, 9 Jan 2020 16:18:49 +0100 Subject: [PATCH 1/3] add rhel8 to acceptance tests --- Gemfile | 4 ++-- examples/init_repo.pp | 6 ------ metadata.json | 9 ++++++--- spec/acceptance/class_spec.rb | 7 +++++-- spec/acceptance/nodesets/centos-8-x64.yml | 12 ++++++++++++ 5 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 spec/acceptance/nodesets/centos-8-x64.yml diff --git a/Gemfile b/Gemfile index e8adf52bf..a3d30ab27 100644 --- a/Gemfile +++ b/Gemfile @@ -77,7 +77,7 @@ end gem 'puppetlabs_spec_helper', '>= 2.0' gem 'puppet-lint', '>= 2.0.0' gem 'facter', '>= 2.4.0' -gem 'facterdb', '>= 0.5' +gem 'facterdb', '>= 1.0.0' gem 'rspec-puppet-facts', '>= 1.6.0' gem 'serverspec' gem 'r10k' @@ -87,4 +87,4 @@ gem 'beaker-rspec' gem 'beaker-vagrant' gem 'beaker-puppet_install_helper' -# vim: syntax=ruby \ No newline at end of file +# vim: syntax=ruby diff --git a/examples/init_repo.pp b/examples/init_repo.pp index 345241858..32273af69 100644 --- a/examples/init_repo.pp +++ b/examples/init_repo.pp @@ -4,12 +4,6 @@ } # RedHat } -case $::osfamily { - 'redhat': { - package { 'epel-release': } - } # RedHat -} - class { 'icinga2': manage_repo => true, } diff --git a/metadata.json b/metadata.json index 9eb4c1145..07e793711 100644 --- a/metadata.json +++ b/metadata.json @@ -30,21 +30,24 @@ "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 47a7307ac..27058d2dc 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -63,8 +63,11 @@ class { 'icinga2::feature::api': end describe service('icinga2') do - it { should be_enabled } - it { should be_running } + it { is_expected.to be_running } + end + + describe port(5665) do + it { is_expected.to be_listening } end describe command("mysql icinga2 -Ns -e 'select version from icinga_dbversion;'") do diff --git a/spec/acceptance/nodesets/centos-8-x64.yml b/spec/acceptance/nodesets/centos-8-x64.yml new file mode 100644 index 000000000..12a4278e0 --- /dev/null +++ b/spec/acceptance/nodesets/centos-8-x64.yml @@ -0,0 +1,12 @@ +--- +HOSTS: + i2centos8: + roles: + - agent + - default + platform: el-8-x86_64 + hypervisor: vagrant + box: bento/centos-8 + vagrant_memsize: 1024 +CONFIG: + type: aio From 2966a7cc6872ff3fa51677e16a3ef6d5fc0df7a0 Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Thu, 9 Jan 2020 16:30:29 +0100 Subject: [PATCH 2/3] add bunbler config --- .bundle/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bundle/config b/.bundle/config index 5d9a4d403..b2a5494d6 100644 --- a/.bundle/config +++ b/.bundle/config @@ -1,6 +1,6 @@ --- BUNDLE_JOBS: "4" -BUNDLE_PATH: "vendor/bundle" +BUNDLE_PATH: ".vendor/bundle" BUNDLE_DISABLE_SHARED_GEMS: "true" -BUNDLE_WITHOUT: "system_tests" BUNDLE_BUILD: "--no-ri --no-rdoc" +BUNDLE_WITHOUT: "system_tests" From c1d85459cc6ec170695b5ce5cc65dc189627a99d Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Fri, 10 Jan 2020 10:47:46 +0100 Subject: [PATCH 3/3] add acceptance test for rhel8 --- spec/acceptance/class_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 27058d2dc..197e62b84 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -5,10 +5,8 @@ describe 'with API, IDO mysql and pgsql' do let(:pp) do <<-MANIFEST - case $::osfamily { - 'redhat': { + if $facts['os']['name'] == 'centos' and Integer($facts['os']['release']['major']) < 8 { package { 'epel-release': } - } # RedHat } class { 'icinga2': manage_repo => true,