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/.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/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/lib/puppet/type/openldap_database.rb b/lib/puppet/type/openldap_database.rb index 68815547..1ca1c165 100644 --- a/lib/puppet/type/openldap_database.rb +++ b/lib/puppet/type/openldap_database.rb @@ -94,17 +94,17 @@ def insync?(is) when %r{^\{MD5\}.+} "{MD5}#{Digest::MD5.hexdigest(should)}" == is when %r{^\{SMD5\}.+} - salt = is[16..-1] + salt = is[16..] md5_hash_with_salt = "#{Digest::MD5.digest(should + salt)}#{salt}" is == "{SMD5}#{[md5_hash_with_salt].pack('m').delete("\n")}" when %r{^\{SSHA\}.+} decoded = Base64.decode64(is.gsub(%r{^\{SSHA\}}, '')) - salt = decoded[20..-1] + salt = decoded[20..] "{SSHA}#{Base64.encode64("#{Digest::SHA1.digest("#{should}#{salt}")}#{salt}").chomp}" == is when %r{^\{SHA\}.+} "{SHA}#{Digest::SHA1.hexdigest(should)}" == is when %r{^\{(SHA(256|384|512))\}} - matches = is.match("^\{(SHA[\\d]{,3})\}") + matches = is.match('^{(SHA[\\d]{,3})}') raise ArgumentError, "Invalid password format: #{is}" if matches.nil? crypto = matches[1] diff --git a/spec/functions/openldap_password_spec.rb b/spec/functions/openldap_password_spec.rb index bfd8a972..082d97d4 100644 --- a/spec/functions/openldap_password_spec.rb +++ b/spec/functions/openldap_password_spec.rb @@ -4,7 +4,7 @@ # rubocop:disable RSpec/DescribeSymbol describe :openldap_password do - it { is_expected.not_to eq(nil) } + it { is_expected.not_to be_nil } it 'fails with wrong number of arguments' do is_expected.to run.with_params.and_raise_error(StandardError) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6515b7bf..9efb4ae6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,3 +17,4 @@ add_custom_fact name.to_sym, value end end +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index d3a6e23c..2681792e 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -5,6 +5,6 @@ require 'voxpupuli/acceptance/spec_helper_acceptance' -configure_beaker +configure_beaker(modules: :metadata) Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }