|
342 | 342 | }
|
343 | 343 | end
|
344 | 344 |
|
| 345 | + context 'with manage_repo enabled and a user defined PE version' do |
| 346 | + let(:params) do |
| 347 | + { |
| 348 | + manage_repo: true, |
| 349 | + package_version: package_version, |
| 350 | + alternate_pe_version: '2222.2.2', |
| 351 | + } |
| 352 | + end |
| 353 | + |
| 354 | + it { |
| 355 | + is_expected.to contain_ini_setting('zypper pc_repo baseurl') |
| 356 | + .with({ |
| 357 | + 'path' => '/etc/zypp/repos.d/pc_repo.repo', |
| 358 | + 'section' => 'pc_repo', |
| 359 | + 'setting' => 'baseurl', |
| 360 | + 'value' => "https://master.example.vm:8140/packages/2222.2.2/sles-#{os_version}-x86_64?ssl_verify=no", |
| 361 | + }) |
| 362 | + } |
| 363 | + end |
| 364 | + |
345 | 365 | it do
|
346 | 366 | is_expected.to contain_package('puppet-agent')
|
347 | 367 | end
|
|
369 | 389 | end
|
370 | 390 |
|
371 | 391 | describe 'package source', if: os_version == '11' do
|
372 |
| - it { is_expected.to contain_file('/etc/zypp/repos.d/pc_repo.repo').with({ 'ensure' => 'absent' }) } |
373 |
| - it { |
374 |
| - is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm') |
375 |
| - .with( |
376 |
| - source: 'puppet:///pe_packages/2000.0.0/sles-11-x86_64/puppet-agent-1.10.100-1.sles11.x86_64.rpm', |
377 |
| - ) |
378 |
| - } |
379 |
| - it { |
380 |
| - is_expected.to contain_exec('GPG check the RPM file') |
381 |
| - .with( |
382 |
| - command: 'rpm -K /opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm', |
383 |
| - path: '/bin:/usr/bin:/sbin:/usr/sbin', |
384 |
| - require: 'File[/opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm]', |
385 |
| - logoutput: 'on_failure', |
386 |
| - notify: 'Package[puppet-agent]', |
387 |
| - ) |
388 |
| - } |
| 392 | + context 'with no source overrides' do |
| 393 | + it { is_expected.to contain_file('/etc/zypp/repos.d/pc_repo.repo').with({ 'ensure' => 'absent' }) } |
| 394 | + it { |
| 395 | + is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm') |
| 396 | + .with( |
| 397 | + source: 'puppet:///pe_packages/2000.0.0/sles-11-x86_64/puppet-agent-1.10.100-1.sles11.x86_64.rpm', |
| 398 | + ) |
| 399 | + } |
| 400 | + it { |
| 401 | + is_expected.to contain_exec('GPG check the RPM file') |
| 402 | + .with( |
| 403 | + command: 'rpm -K /opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm', |
| 404 | + path: '/bin:/usr/bin:/sbin:/usr/sbin', |
| 405 | + require: 'File[/opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm]', |
| 406 | + logoutput: 'on_failure', |
| 407 | + notify: 'Package[puppet-agent]', |
| 408 | + ) |
| 409 | + } |
| 410 | + end |
| 411 | + |
| 412 | + context 'with a user defined PE version' do |
| 413 | + let(:params) { super().merge(alternate_pe_version: '2222.2.2') } |
| 414 | + |
| 415 | + it { |
| 416 | + is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm') |
| 417 | + .with( |
| 418 | + source: 'puppet:///pe_packages/2222.2.2/sles-11-x86_64/puppet-agent-1.10.100-1.sles11.x86_64.rpm', |
| 419 | + ) |
| 420 | + } |
| 421 | + end |
389 | 422 | end
|
390 | 423 | end
|
391 | 424 | end
|
|
0 commit comments