|
416 | 416 | it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(false) }
|
417 | 417 | end
|
418 | 418 | end
|
| 419 | + |
| 420 | + describe 'deb822 sources' do |
| 421 | + let :params do |
| 422 | + { |
| 423 | + source_format: 'sources', |
| 424 | + } |
| 425 | + end |
| 426 | + |
| 427 | + context 'basic deb822 source' do |
| 428 | + let :params do |
| 429 | + super().merge( |
| 430 | + { |
| 431 | + location: ['http://debian.mirror.iweb.ca/debian/'], |
| 432 | + repos: ['main', 'contrib', 'non-free'] |
| 433 | + }, |
| 434 | + ) |
| 435 | + end |
| 436 | + |
| 437 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_notify_update(true) } |
| 438 | + end |
| 439 | + |
| 440 | + context 'complex deb822 source' do |
| 441 | + let :params do |
| 442 | + super().merge( |
| 443 | + { |
| 444 | + types: ['deb', 'deb-src'], |
| 445 | + location: ['http://fr.debian.org/debian', 'http://de.debian.org/debian'], |
| 446 | + release: ['stable', 'stable-updates', 'stable-backports'], |
| 447 | + repos: ['main', 'contrib', 'non-free'], |
| 448 | + architecture: ['amd64', 'i386'], |
| 449 | + allow_unsigned: true, |
| 450 | + notify_update: false |
| 451 | + }, |
| 452 | + ) |
| 453 | + end |
| 454 | + |
| 455 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_notify_update(false) } |
| 456 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Enabled: yes}) } |
| 457 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Types: deb deb-src}) } |
| 458 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{URIs: http://fr.debian.org/debian http://de.debian.org/debian}) } |
| 459 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Suites: stable stable-updates stable-backports}) } |
| 460 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Components: main contrib non-free}) } |
| 461 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Architectures: amd64 i386}) } |
| 462 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_content(%r{Trusted: yes}) } |
| 463 | + end |
| 464 | + |
| 465 | + context '.list backwards compatibility' do |
| 466 | + let :params do |
| 467 | + super().merge( |
| 468 | + { |
| 469 | + location: 'http://debian.mirror.iweb.ca/debian/', |
| 470 | + release: 'unstable', |
| 471 | + repos: 'main contrib non-free', |
| 472 | + key: { |
| 473 | + id: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', |
| 474 | + server: 'keyserver.ubuntu.com', |
| 475 | + }, |
| 476 | + pin: '-10' |
| 477 | + }, |
| 478 | + ) |
| 479 | + end |
| 480 | + |
| 481 | + it { is_expected.to contain_apt__setting("sources-#{title}").with_notify_update(true) } |
| 482 | + end |
| 483 | + end |
419 | 484 | end
|
0 commit comments