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