Skip to content

Commit

Permalink
(SIMP-8823) Fix EL7+ support (#46)
Browse files Browse the repository at this point in the history
Fixed:
  - Fix the main class to work with EL7+
  - Fix the acceptance tests

Changed:
  - Removed EL6 support

SIMP-8823 #close
  • Loading branch information
trevor-vaughan authored Dec 8, 2020
1 parent ccb8d6b commit b778728
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 85 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* Wed Dec 02 2020 Trevor Vaughan <[email protected]> - 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 <[email protected]> - 1.2.0-0
- Add EL8 support

Expand Down
24 changes: 6 additions & 18 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
}
7 changes: 2 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -25,23 +25,20 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7",
"8"
]
Expand All @@ -50,7 +47,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 5.0.0 < 7.0.0"
"version_requirement": ">= 5.0.0 < 8.0.0"
}
]
}
14 changes: 1 addition & 13 deletions spec/acceptance/nodesets/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
14 changes: 1 addition & 13 deletions spec/acceptance/nodesets/oel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
33 changes: 33 additions & 0 deletions spec/acceptance/suites/default/00_default_spec.rb
Original file line number Diff line number Diff line change
@@ -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
36 changes: 0 additions & 36 deletions spec/acceptance/suites/default/class_spec.rb

This file was deleted.

0 comments on commit b778728

Please sign in to comment.