|
129 | 129 | end |
130 | 130 | end |
131 | 131 | end |
132 | | - when 'RedHat' |
| 132 | + when 'RedHat', 'CentOS' |
133 | 133 | case facts[:os]['release']['major'] |
134 | 134 | when '5' |
135 | 135 | # written for RHEL 5 |
|
204 | 204 | } |
205 | 205 | end |
206 | 206 |
|
207 | | - context 'scl' do |
208 | | - describe 'with manage_scl' do |
209 | | - context 'true' do |
210 | | - let(:params) { { provider: 'scl', manage_scl: true } } |
211 | | - |
212 | | - it { is_expected.to contain_package('centos-release-scl') } |
213 | | - it { is_expected.to contain_package('scl-utils') } |
214 | | - end |
215 | | - context 'false' do |
216 | | - let(:params) { { provider: 'scl', manage_scl: false } } |
217 | | - |
218 | | - it { is_expected.not_to contain_package('centos-release-scl') } |
219 | | - it { is_expected.not_to contain_package('scl-utils') } |
220 | | - end |
221 | | - end |
222 | | - end |
223 | | - |
224 | 207 | # python::provider |
225 | 208 | context 'default' do |
226 | 209 | let(:params) { { provider: '' } } |
|
262 | 245 | context 'on a Redhat 6 OS' do |
263 | 246 | it { is_expected.to contain_class('python::install') } |
264 | 247 | it { is_expected.to contain_package('pip').with_name('python-pip') } |
| 248 | + |
| 249 | + describe 'with python::provider' do |
| 250 | + context 'scl' do |
| 251 | + describe 'with version' do |
| 252 | + context '3.6 SCL package' do |
| 253 | + let(:params) { { version: 'rh-python36' } } |
| 254 | + |
| 255 | + it { is_expected.to compile } |
| 256 | + end |
| 257 | + end |
| 258 | + describe 'with manage_scl' do |
| 259 | + context 'true' do |
| 260 | + let(:params) { { provider: 'scl', manage_scl: true } } |
| 261 | + |
| 262 | + it { is_expected.to contain_package('centos-release-scl') } |
| 263 | + it { is_expected.to contain_package('scl-utils') } |
| 264 | + end |
| 265 | + context 'false' do |
| 266 | + let(:params) { { provider: 'scl', manage_scl: false } } |
| 267 | + |
| 268 | + it { is_expected.not_to contain_package('centos-release-scl') } |
| 269 | + it { is_expected.not_to contain_package('scl-utils') } |
| 270 | + end |
| 271 | + end |
| 272 | + end |
| 273 | + end |
265 | 274 | end |
| 275 | + |
266 | 276 | when '7' |
267 | 277 |
|
268 | 278 | context 'on a Redhat 7 OS' do |
269 | 279 | it { is_expected.to contain_class('python::install') } |
270 | 280 | it { is_expected.to contain_package('pip').with_name('python2-pip') } |
| 281 | + |
| 282 | + describe 'with python::provider' do |
| 283 | + context 'scl' do |
| 284 | + describe 'with version' do |
| 285 | + context '3.6 SCL package' do |
| 286 | + let(:params) { { version: 'rh-python36' } } |
| 287 | + |
| 288 | + it { is_expected.to compile } |
| 289 | + end |
| 290 | + end |
| 291 | + describe 'with manage_scl' do |
| 292 | + context 'true' do |
| 293 | + let(:params) { { provider: 'scl', manage_scl: true } } |
| 294 | + |
| 295 | + it { is_expected.to contain_package('centos-release-scl') } |
| 296 | + it { is_expected.to contain_package('scl-utils') } |
| 297 | + end |
| 298 | + context 'false' do |
| 299 | + let(:params) { { provider: 'scl', manage_scl: false } } |
| 300 | + |
| 301 | + it { is_expected.not_to contain_package('centos-release-scl') } |
| 302 | + it { is_expected.not_to contain_package('scl-utils') } |
| 303 | + end |
| 304 | + end |
| 305 | + end |
| 306 | + end |
271 | 307 | end |
272 | 308 | end |
273 | 309 | end |
|
0 commit comments