Skip to content

Commit

Permalink
Merge pull request #30 from rehanone/develop/fix
Browse files Browse the repository at this point in the history
- added `puppet 7` as a  supported version.
  • Loading branch information
rehanone authored May 6, 2021
2 parents 60452a7 + 26ffd69 commit 2a368ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 37 deletions.
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 5.5.10 < 7.0.0"
"version_requirement": ">= 5.5.10 < 8.0.0"
}
],
"tags": [
Expand Down
40 changes: 4 additions & 36 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require 'puppet'
require 'beaker-rspec'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'

run_puppet_install_helper
UNSUPPORTED_PLATFORMS = ['windows', 'darwin'].freeze

run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'].match?(%r{pe}i)
install_module_on(hosts)
install_module_dependencies_on(hosts)

UNSUPPORTED_PLATFORMS = ['windows', 'AIX', 'Solaris'].freeze

RSpec.configure do |c|
# Readable test descriptions
c.formatter = :documentation
Expand All @@ -22,35 +22,3 @@
def return_puppet_version
(on default, puppet('--version')).output.chomp
end

RSpec.shared_context 'with faked facts' do
let(:facts_d) do
puppet_version = return_puppet_version
if fact('osfamily').match?(%r{windows}i)
if fact('kernelmajversion').to_f < 6.0
'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d'
else
'C:/ProgramData/PuppetLabs/facter/facts.d'
end
elsif Puppet::Util::Package.versioncmp(puppet_version, '4.0.0') < 0 && fact('is_pe', '--puppet') == 'true'
'/etc/puppetlabs/facter/facts.d'
else
'/etc/facter/facts.d'
end
end

before :each do
# No need to create on windows, PE creates by default
if fact('osfamily').match?(%r{windows}i)
shell("mkdir -p '#{facts_d}'")
end
end

after :each do
shell("rm -f '#{facts_d}/fqdn.txt'", acceptable_exit_codes: [0, 1])
end

def fake_fact(name, value)
shell("echo #{name}=#{value} > '#{facts_d}/#{name}.txt'")
end
end

0 comments on commit 2a368ef

Please sign in to comment.