File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5757 " 20.04" ,
5858 " 22.04"
5959 ]
60+ },
61+ {
62+ "operatingsystem" : " RedHat" ,
63+ "operatingsystemrelease" : [
64+ " 8"
65+ ]
6066 }
6167 ],
6268 "requirements" : [
Original file line number Diff line number Diff line change 4646 'ensure' => 'file'
4747 )
4848 end
49+
50+ if [ 'RedHat' ] . include? ( facts [ :os ] [ 'family' ] ) && facts [ :os ] [ 'release' ] [ 'major' ] == '8'
51+ [ '3.6' , '3.8' , '3.9' ] . each do |python_version |
52+ context "with python_versions #{ python_version } " do
53+ let ( :pre_condition ) do
54+ [
55+ "class { 'puppetboard':
56+ python_version => \" #{ python_version } \" ,
57+ secret_key => 'this_should_be_a_long_secret_string',
58+ }"
59+ ]
60+ end
61+
62+ case python_version
63+ when '3.6'
64+ package_name = 'python3-mod_wsgi'
65+ when '3.8'
66+ package_name = 'python38-mod_wsgi'
67+ when '3.9'
68+ package_name = 'python39-mod_wsgi'
69+ end
70+
71+ it { is_expected . to contain_class ( 'apache::mod::wsgi' ) . with ( package_name : package_name ) }
72+ end
73+ end
74+
75+ context 'with unsupported python_versions' do
76+ let ( :pre_condition ) do
77+ [
78+ "class { 'puppetboard':
79+ python_version => '3.7',
80+ secret_key => 'this_should_be_a_long_secret_string',
81+ }
82+ "
83+ ]
84+ end
85+
86+ it { is_expected . to raise_error ( Puppet ::Error , %r{python version not supported} ) }
87+ end
88+ end
4989 end
5090 end
5191 end
You can’t perform that action at this time.
0 commit comments