Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RHEL, Alma, Rocky 8,9, Debian 11, 12 and Ubuntu 20.04 and 22.04 #3

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3
with:
pidfile_workaround: 'false'
beaker_facter: 'memory.system.total:TotalMemory:100 MiB'
beaker_hypervisor: 'vagrant_libvirt'
8 changes: 8 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
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'
27 changes: 20 additions & 7 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,36 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"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 }