diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f82c4c..ca362aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' diff --git a/.sync.yml b/.sync.yml index 7388376..f49b3d8 100644 --- a/.sync.yml +++ b/.sync.yml @@ -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' diff --git a/metadata.json b/metadata.json index e1796c2..d020010 100644 --- a/metadata.json +++ b/metadata.json @@ -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" ] } ], diff --git a/spec/acceptance/nodesets/Vagrantfile-vagrant_custom b/spec/acceptance/nodesets/Vagrantfile-vagrant_custom deleted file mode 100644 index a78fcb2..0000000 --- a/spec/acceptance/nodesets/Vagrantfile-vagrant_custom +++ /dev/null @@ -1,11 +0,0 @@ -Vagrant.configure("2") do |c| - c.ssh.insert_key = false - c.vm.define 'centos-7-x64' do |v| - v.vm.hostname = 'centos-7-x64' - v.vm.box = 'centos/7' - v.vm.box_check_update = 'true' - v.vm.provider :libvirt do |node| - node.memory = 512 - end - end -end diff --git a/spec/acceptance/nodesets/centos-7-x64-vagrant_libvirt.yml b/spec/acceptance/nodesets/centos-7-x64-vagrant_libvirt.yml deleted file mode 100644 index 5cf9a9b..0000000 --- a/spec/acceptance/nodesets/centos-7-x64-vagrant_libvirt.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - centos-7-x64: - roles: - - default - platform: el-7-x86_64 - box : centos/7 - hypervisor : vagrant_libvirt -CONFIG: - type: foss - log_level: verbose - network_mac: '5a:65:a9:97:e4:e4' diff --git a/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml b/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml deleted file mode 100644 index b4bdfb4..0000000 --- a/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - ubuntu-server-1204-x64: - roles: - - master - platform: ubuntu-12.04-amd64 - box : puppetlabs/ubuntu-12.04-64-nocm - box_url : https://vagrantcloud.com/puppetlabs/ubuntu-12.04-64-nocm - hypervisor : vagrant -CONFIG: - log_level: debug - type: foss \ No newline at end of file diff --git a/spec/acceptance/swap_file_class_spec.rb b/spec/acceptance/swap_file_class_spec.rb index c5b0191..187164c 100644 --- a/spec/acceptance/swap_file_class_spec.rb +++ b/spec/acceptance/swap_file_class_spec.rb @@ -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 diff --git a/spec/acceptance/swap_file_files_fallocate_command.rb b/spec/acceptance/swap_file_files_fallocate_command.rb index de3ad42..4ec6ead 100644 --- a/spec/acceptance/swap_file_files_fallocate_command.rb +++ b/spec/acceptance/swap_file_files_fallocate_command.rb @@ -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': diff --git a/spec/acceptance/swap_file_files_multiple_spec.rb b/spec/acceptance/swap_file_files_multiple_spec.rb index 8b39595..15159a2 100644 --- a/spec/acceptance/swap_file_files_multiple_spec.rb +++ b/spec/acceptance/swap_file_files_multiple_spec.rb @@ -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': diff --git a/spec/acceptance/swap_file_files_parameters_spec.rb b/spec/acceptance/swap_file_files_parameters_spec.rb index fa438eb..16be70d 100644 --- a/spec/acceptance/swap_file_files_parameters_spec.rb +++ b/spec/acceptance/swap_file_files_parameters_spec.rb @@ -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 @@ -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]) @@ -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]) diff --git a/spec/acceptance/swap_file_files_spec.rb b/spec/acceptance/swap_file_files_spec.rb index 77ece10..bb23c03 100644 --- a/spec/acceptance/swap_file_files_spec.rb +++ b/spec/acceptance/swap_file_files_spec.rb @@ -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 diff --git a/spec/acceptance/swap_file_resizing_spec.rb b/spec/acceptance/swap_file_resizing_spec.rb index 47c8c49..65b5758 100644 --- a/spec/acceptance/swap_file_resizing_spec.rb +++ b/spec/acceptance/swap_file_resizing_spec.rb @@ -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 diff --git a/spec/acceptance/swap_file_resizing_stringify_true_spec.rb b/spec/acceptance/swap_file_resizing_stringify_true_spec.rb index a590da9..85a6a6e 100644 --- a/spec/acceptance/swap_file_resizing_stringify_true_spec.rb +++ b/spec/acceptance/swap_file_resizing_stringify_true_spec.rb @@ -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 diff --git a/spec/acceptance/swap_file_swappiness_spec.rb b/spec/acceptance/swap_file_swappiness_spec.rb index 9aa2601..6252800 100644 --- a/spec/acceptance/swap_file_swappiness_spec.rb +++ b/spec/acceptance/swap_file_swappiness_spec.rb @@ -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 diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 3d92584..2681792 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -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 }