Skip to content

Commit

Permalink
test: different python version on rhel8
Browse files Browse the repository at this point in the history
  • Loading branch information
teluq-pbrideau committed Jul 11, 2024
1 parent 3610b53 commit 15df7a6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8",
"9"
]
},
Expand Down
40 changes: 40 additions & 0 deletions spec/classes/apache/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,46 @@
'ensure' => 'file'
)
end

if ['RedHat'].include?(facts[:os]['family']) && facts[:os]['release']['major'] == '8'
['3.6', '3.8', '3.9'].each do |python_version|
context "with python_versions #{python_version}" do
let(:pre_condition) do
[
"class { 'puppetboard':
python_version => \"#{python_version}\",
secret_key => 'this_should_be_a_long_secret_string',
}"
]
end

case python_version
when '3.6'
package_name = 'python3-mod_wsgi'
when '3.8'
package_name = 'python38-mod_wsgi'
when '3.9'
package_name = 'python39-mod_wsgi'
end

it { is_expected.to contain_class('apache::mod::wsgi').with(package_name: package_name) }
end
end

context 'with unsupported python_versions' do
let(:pre_condition) do
[
"class { 'puppetboard':
python_version => '3.7',
secret_key => 'this_should_be_a_long_secret_string',
}
"
]
end

it { is_expected.to raise_error(Puppet::Error, %r{python version not supported}) }
end
end
end
end
end
Expand Down

0 comments on commit 15df7a6

Please sign in to comment.