Skip to content

Commit

Permalink
Support Current RHEL, Debian, Ubuntu, Rocky, Alma OSes
Browse files Browse the repository at this point in the history
Support declared for:

* RedHat 7, 8 and 9
* Alma 8 and 9.
* Rocky 8 and 9
* Debian 11 and 12
* Ubuntu 20.04 and 22.04
  • Loading branch information
traylenator committed Apr 28, 2024
1 parent 1687302 commit 05a6daa
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
beaker_facter: 'memory.system.total:TotalMemory:100 MiB'
beaker_hypervisor: 'vagrant_libvirt'
7 changes: 7 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ spec/spec_helper.rb:
hiera_config: '"spec/fixtures/hiera/hiera.yaml"'
mock_with: ':mocha'

spec/spec_helper_acceptance.rb:
unmanaged: false

# Minimum size that mkswap will accept is 40MB.
.github/workflows/ci.yml:
beaker_hypervisor: 'vagrant_libvirt'
beaker_facter: 'memory.system.total:TotalMemory:100 MiB'
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ end

group :system_tests do
gem 'voxpupuli-acceptance', '~> 3.0', :require => false
gem 'beaker-vagrant', :require => false
end

group :release do
Expand Down
28 changes: 21 additions & 7 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,37 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7"
"7",
"8",
"9"
]
},
{
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"6",
"7"
"11",
"12"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"12.04",
"14.04"
"20.04",
"22.04"
]
}
],
Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/nodesets/Vagrantfile-vagrant_custom

This file was deleted.

11 changes: 0 additions & 11 deletions spec/acceptance/nodesets/centos-7-x64-vagrant_libvirt.yml

This file was deleted.

11 changes: 0 additions & 11 deletions spec/acceptance/nodesets/ubuntu-server-12042-x64.yml

This file was deleted.

2 changes: 1 addition & 1 deletion spec/acceptance/swap_file_class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'swap_file class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'swap_file class' do
context 'swap_file' do
context 'ensure => present' do
it 'works with no errors' do
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/swap_file_files_fallocate_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'spec_helper_acceptance'

describe 'swap_file::files defined type', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'fallocate command', unless: ['FreeBSD'].include?(fact('osfamily')) do
describe 'swap_file::files defined type' do
context 'fallocate command', unless: ['FreeBSD'].include?(fact('os.family')) do
it 'works with no errors' do
pp = <<-EOS
swap_file::files { 'default':
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/swap_file_files_multiple_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'spec_helper_acceptance'

describe 'swap_file::files defined type', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'multiple swap_file::files', unless: ['FreeBSD'].include?(fact('osfamily')) do
describe 'swap_file::files defined type' do
context 'multiple swap_file::files', unless: ['FreeBSD'].include?(fact('os.family')) do
it 'works with no errors' do
pp = <<-EOS
swap_file::files { 'tmp file swap 1':
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/swap_file_files_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'swap_file::files defined type', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'swap_file::files defined type' do
context 'swap_file' do
context 'custom parameters' do
it 'works with no errors' do
Expand All @@ -18,7 +18,7 @@
end

it 'contains the given swapfile' do
if ['FreeBSD'].include?(fact('osfamily'))
if ['FreeBSD'].include?(fact('os.family'))
shell('/usr/sbin/swapinfo | grep /dev/md99', acceptable_exit_codes: [0])
else
shell('/sbin/swapon -s | grep /tmp/swapfile', acceptable_exit_codes: [0])
Expand All @@ -27,7 +27,7 @@

it 'contains the given fstab setting' do
shell('cat /etc/fstab | grep /tmp/swapfile', acceptable_exit_codes: [0])
if ['FreeBSD'].include?(fact('osfamily'))
if ['FreeBSD'].include?(fact('os.family'))
shell('cat /etc/fstab | grep md99', acceptable_exit_codes: [0])
else
shell('cat /etc/fstab | grep defaults', acceptable_exit_codes: [0])
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/swap_file_files_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'swap_file::files defined type', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'swap_file::files defined type' do
context 'swap_file' do
context 'ensure => present' do
it 'works with no errors' do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/swap_file_resizing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'swap_file class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'swap_file class' do
context 'swap_file' do
context 'swapfilesize => 100' do
it 'works with no errors' do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/swap_file_resizing_stringify_true_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'swap_file class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'swap_file class' do
context 'swap_file' do
context 'swapfilesize => 100' do
it 'works with no errors' do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/swap_file_swappiness_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'swap_file::swappiness class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
describe 'swap_file::swappiness class' do
context 'swap_file::swappiness' do
context 'swappiness => 75, permanent => false' do
it 'works with no errors' do
Expand Down
35 changes: 5 additions & 30 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
# frozen_string_literal: true

require 'beaker-rspec'
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

unless ENV['RS_PROVISION'] == 'no'
hosts.each do |host|
if host.is_pe?
install_pe
else
install_puppet
on host, "mkdir -p #{host['distmoduledir']}"
end
end
end
require 'voxpupuli/acceptance/spec_helper_acceptance'

UNSUPPORTED_PLATFORMS = ['windows'].freeze
configure_beaker(modules: :metadata)

RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))

# Readable test descriptions
c.formatter = :documentation

# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
puppet_module_install(source: proj_root, module_name: 'swap_file')
hosts.each do |_host|
shell('puppet module install puppetlabs-stdlib --version 4.7.0', { acceptable_exit_codes: [0] })
shell('puppet module install herculesteam/augeasproviders_core --version 2.1.0', { acceptable_exit_codes: [0] })
shell('puppet module install herculesteam/augeasproviders_sysctl --version 2.1.0', { acceptable_exit_codes: [0] })
end
end
end
Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }

0 comments on commit 05a6daa

Please sign in to comment.