From 25f6cd2ed9248e6cc5a5a38ecf6f102bbf8248df Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 17 Aug 2023 17:23:05 +0200 Subject: [PATCH 1/3] modulesync 7.0.0 --- .github/CONTRIBUTING.md | 11 +++++++---- .github/workflows/ci.yml | 4 +++- .msync.yml | 2 +- .rubocop.yml | 3 +-- Gemfile | 2 +- spec/spec_helper.rb | 1 + 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8b466cfb..6aaa603f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -232,18 +232,21 @@ simple tests against it after applying the module. You can run this with: ```sh -BEAKER_setfile=debian11-64 bundle exec rake beaker +BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker ``` -You can replace the string `debian10` with any common operating system. +You can replace the string `debian11` with any common operating system. The following strings are known to work: -* ubuntu1804 * ubuntu2004 -* debian10 +* ubuntu2204 * debian11 * centos7 * centos8 +* centos9 +* almalinux8 +* almalinux9 +* fedora36 For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49981e36..8a077911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,4 +13,6 @@ concurrency: jobs: puppet: name: Puppet - uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1 + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1 + with: + pidfile_workaround: 'false' diff --git a/.msync.yml b/.msync.yml index b929160c..dd3e9572 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '6.0.0' +modulesync_config_version: '7.0.0' diff --git a/.rubocop.yml b/.rubocop.yml index ea22bff8..fded90cf 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,7 @@ --- -inherit_from: .rubocop_todo.yml - # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ +inherit_from: .rubocop_todo.yml inherit_gem: voxpupuli-test: rubocop.yml diff --git a/Gemfile b/Gemfile index 98a04cfb..db21d3b5 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 6.0', :require => false + gem 'voxpupuli-test', '~> 7.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 3.0', :require => false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a489d4f8..3b8712f9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,3 +21,4 @@ add_custom_fact name.to_sym, value end end +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } From a28e131131ccb4f2828685f245d6f72a4469afad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 17 Aug 2023 15:38:34 -1000 Subject: [PATCH 2/3] Auto-correct rubocop offenses --- lib/puppet/provider/selinux_fcontext/semanage.rb | 4 ++-- spec/unit/puppet/provider/selinux_fcontext/semanage_spec.rb | 4 ++-- .../provider/selinux_fcontext_equivalence/semanage_spec.rb | 2 +- spec/unit/puppet/provider/selinux_permissive/semanage_spec.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/puppet/provider/selinux_fcontext/semanage.rb b/lib/puppet/provider/selinux_fcontext/semanage.rb index 8b64ddda..c17c3106 100644 --- a/lib/puppet/provider/selinux_fcontext/semanage.rb +++ b/lib/puppet/provider/selinux_fcontext/semanage.rb @@ -90,14 +90,14 @@ def self.prefetch(resources) def create # is there really no way to have a provider-global helper function cleanly? args = ['fcontext', '-a', '-t', @resource[:seltype], '-f', @resource[:file_type]] - args.concat(['-s', @resource[:seluser]]) if @resource[:seluser] + args.push('-s', @resource[:seluser]) if @resource[:seluser] args.push(@resource[:pathspec]) semanage(*args) end def destroy args = ['fcontext', '-d', '-t', @property_hash[:seltype], '-f', @property_hash[:file_type]] - args.concat(['-s', @property_hash[:seluser]]) if @property_hash[:seluser] + args.push('-s', @property_hash[:seluser]) if @property_hash[:seluser] args.push(@property_hash[:pathspec]) semanage(*args) end diff --git a/spec/unit/puppet/provider/selinux_fcontext/semanage_spec.rb b/spec/unit/puppet/provider/selinux_fcontext/semanage_spec.rb index 0a66318d..a2e718c1 100644 --- a/spec/unit/puppet/provider/selinux_fcontext/semanage_spec.rb +++ b/spec/unit/puppet/provider/selinux_fcontext/semanage_spec.rb @@ -147,7 +147,7 @@ def selinux_file_context_path it 'finds provider for /foobar' do p = resources['/foobar_a'].provider - expect(p).not_to eq(nil) + expect(p).not_to be_nil end context 'has the correct attributes' do @@ -174,7 +174,7 @@ def selinux_file_context_path it 'finds provider for /var/log' do p = resources['/var/log_a'].provider - expect(p).not_to eq(nil) + expect(p).not_to be_nil end context 'has the correct attributes from the system policy' do diff --git a/spec/unit/puppet/provider/selinux_fcontext_equivalence/semanage_spec.rb b/spec/unit/puppet/provider/selinux_fcontext_equivalence/semanage_spec.rb index f2b1e510..281c148b 100644 --- a/spec/unit/puppet/provider/selinux_fcontext_equivalence/semanage_spec.rb +++ b/spec/unit/puppet/provider/selinux_fcontext_equivalence/semanage_spec.rb @@ -102,7 +102,7 @@ def selinux_file_context_subs_path it 'finds provider for /foobar' do p = resources['/foobar'].provider - expect(p).not_to eq(nil) + expect(p).not_to be_nil end context 'has the correct target' do diff --git a/spec/unit/puppet/provider/selinux_permissive/semanage_spec.rb b/spec/unit/puppet/provider/selinux_permissive/semanage_spec.rb index e3a25f05..6e249563 100644 --- a/spec/unit/puppet/provider/selinux_permissive/semanage_spec.rb +++ b/spec/unit/puppet/provider/selinux_permissive/semanage_spec.rb @@ -90,7 +90,7 @@ it 'matches the provider' do semanage_provider.prefetch('test_t' => resource, 'tlp_t' => permissive.new(seltype: 'tlp_t', ensure: :present)) - expect(resource.provider.exists?).to eq(true) + expect(resource.provider.exists?).to be(true) end end From b9990f6c90f6a362773d468873def7bc264a105a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 21 Aug 2023 10:12:52 +0200 Subject: [PATCH 3/3] dont run acceptance tests on GitHub --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a077911..49981e36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,4 @@ concurrency: jobs: puppet: name: Puppet - uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1 - with: - pidfile_workaround: 'false' + uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1