From b7787288c875cccb5758ca8398c628ba229fb539 Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Mon, 7 Dec 2020 21:40:17 -0500 Subject: [PATCH] (SIMP-8823) Fix EL7+ support (#46) Fixed: - Fix the main class to work with EL7+ - Fix the acceptance tests Changed: - Removed EL6 support SIMP-8823 #close --- CHANGELOG | 5 +++ manifests/init.pp | 24 ++++--------- metadata.json | 7 ++-- spec/acceptance/nodesets/default.yml | 14 +------- spec/acceptance/nodesets/oel.yml | 14 +------- .../suites/default/00_default_spec.rb | 33 +++++++++++++++++ spec/acceptance/suites/default/class_spec.rb | 36 ------------------- 7 files changed, 48 insertions(+), 85 deletions(-) create mode 100644 spec/acceptance/suites/default/00_default_spec.rb delete mode 100644 spec/acceptance/suites/default/class_spec.rb diff --git a/CHANGELOG b/CHANGELOG index 24f492961..9ae3d51aa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +* Wed Dec 02 2020 Trevor Vaughan - 1.2.1-0 +- Remove EL6 support +- Fix the main class to work with EL7+ +- Fix the acceptance tests + * Fri Dec 06 2019 Trevor Vaughan - 1.2.0-0 - Add EL8 support diff --git a/manifests/init.pp b/manifests/init.pp index 25af178e4..f1b6c023d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,23 +16,11 @@ package { 'acpid': ensure => $ensure } - if $facts['osfamily'] in ['RedHat'] { - service { 'acpid': - ensure => 'running', - enable => true, - hasstatus => true, - hasrestart => true, - start => '/sbin/service haldaemon stop; /sbin/service acpid start; /sbin/service haldaemon start', - require => Package['acpid'] - } - } - else { - service { 'acpid': - ensure => 'running', - enable => true, - hasstatus => true, - hasrestart => true, - require => Package['acpid'] - } + service { 'acpid': + ensure => 'running', + enable => true, + hasstatus => true, + hasrestart => true, + require => Package['acpid'] } } diff --git a/metadata.json b/metadata.json index 1ebfbc8ad..4c754acdf 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-acpid", - "version": "1.2.0", + "version": "1.2.1", "author": "SIMP Team", "summary": "Manages ACPI daemon", "license": "Apache-2.0", @@ -25,7 +25,6 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "6", "7", "8" ] @@ -33,7 +32,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "6", "7", "8" ] @@ -41,7 +39,6 @@ { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "6", "7", "8" ] @@ -50,7 +47,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 5.0.0 < 7.0.0" + "version_requirement": ">= 5.0.0 < 8.0.0" } ] } diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml index 02f3b1f5e..dc0567f33 100644 --- a/spec/acceptance/nodesets/default.yml +++ b/spec/acceptance/nodesets/default.yml @@ -6,26 +6,14 @@ end -%> HOSTS: - el6: - roles: - - server - - default - - master - - client - platform: el-6-x86_64 - box: centos/6 - hypervisor: <%= hypervisor %> - el7: roles: - - client + - default platform: el-7-x86_64 box: centos/7 hypervisor: <%= hypervisor %> el8: - roles: - - client platform: el-8-x86_64 box: centos/8 hypervisor: <%= hypervisor %> diff --git a/spec/acceptance/nodesets/oel.yml b/spec/acceptance/nodesets/oel.yml index 2b4a2cecd..32b617201 100644 --- a/spec/acceptance/nodesets/oel.yml +++ b/spec/acceptance/nodesets/oel.yml @@ -6,26 +6,14 @@ end -%> HOSTS: - oel6: - roles: - - server - - default - - master - - client - platform: el-6-x86_64 - box: onyxpoint/oel-6-x86_64 - hypervisor: <%= hypervisor %> - oel7: roles: - - client + - default platform: el-7-x86_64 box: onyxpoint/oel-7-x86_64 hypervisor: <%= hypervisor %> oel8: - roles: - - client platform: el-8-x86_64 box: generic/oracle8 hypervisor: <%= hypervisor %> diff --git a/spec/acceptance/suites/default/00_default_spec.rb b/spec/acceptance/suites/default/00_default_spec.rb new file mode 100644 index 000000000..ab71a6205 --- /dev/null +++ b/spec/acceptance/suites/default/00_default_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper_acceptance' + +test_name 'acpid class' + +describe 'acpid class' do + let(:manifest) { + <<-EOS + include '::acpid' + EOS + } + + hosts.each do |host| + context "on #{host}" do + # Using puppet_apply as a helper + it 'should work with no errors' do + apply_manifest(manifest, :catch_failures => true) + end + + it 'should be idempotent' do + apply_manifest(manifest, {:catch_changes => true}) + end + + describe package('acpid') do + it { is_expected.to be_installed } + end + + describe service('acpid') do + it { is_expected.to be_enabled } + it { is_expected.to be_running } + end + end + end +end diff --git a/spec/acceptance/suites/default/class_spec.rb b/spec/acceptance/suites/default/class_spec.rb deleted file mode 100644 index ece71b3cd..000000000 --- a/spec/acceptance/suites/default/class_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'spec_helper_acceptance' - -test_name 'acpid class' - -describe 'acpid class' do - let(:manifest) { - <<-EOS - include '::acpid' - EOS - } - - # We need this for our tests to run properly! - on 'client', puppet('config set stringify_facts false') - - context 'with defaults' do - - # Using puppet_apply as a helper - it 'should work with no errors' do - apply_manifest(manifest, :catch_failures => true) - end - - it 'should be idempotent' do - apply_manifest(manifest, {:catch_changes => true}) - end - - describe package('acpid') do - it { is_expected.to be_installed } - end - - describe service('acpid') do - it { is_expected.to be_enabled } - it { is_expected.to be_running } - end - - end -end