|
744 | 744 | it { is_expected.not_to contain_package('yum-utils') }
|
745 | 745 | it { is_expected.to contain_package('dnf-utils') }
|
746 | 746 | end
|
| 747 | + |
| 748 | + context 'when custom repos is set' do |
| 749 | + let(:params) do |
| 750 | + { |
| 751 | + managed_repos: ['example'], |
| 752 | + repos: { |
| 753 | + example: { |
| 754 | + baseurl: 'https://example.com', |
| 755 | + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example' |
| 756 | + } |
| 757 | + }, |
| 758 | + gpgkeys: { |
| 759 | + '/etc/pki/rpm-gpg/RPM-GPG-KEY-example' => { |
| 760 | + 'source' => 'http://example.com/gpg' |
| 761 | + } |
| 762 | + } |
| 763 | + } |
| 764 | + end |
| 765 | + |
| 766 | + it { is_expected.to compile.with_all_deps } |
| 767 | + it { is_expected.to have_yumrepo_resource_count(1) } |
| 768 | + it { is_expected.to contain_yumrepo('example') } |
| 769 | + it { is_expected.to contain_yum__gpgkey('/etc/pki/rpm-gpg/RPM-GPG-KEY-example') } |
| 770 | + end |
| 771 | + |
| 772 | + context 'when custom repos with multiple gpgkeys is set' do |
| 773 | + let(:params) do |
| 774 | + { |
| 775 | + managed_repos: ['example'], |
| 776 | + repos: { |
| 777 | + example: { |
| 778 | + baseurl: 'https://example.com', |
| 779 | + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example2', |
| 780 | + } |
| 781 | + }, |
| 782 | + gpgkeys: { |
| 783 | + '/etc/pki/rpm-gpg/RPM-GPG-KEY-example' => { |
| 784 | + 'source' => 'http://example.com/gpg' |
| 785 | + }, |
| 786 | + '/etc/pki/rpm-gpg/RPM-GPG-KEY-example2' => { |
| 787 | + 'source' => 'http://example.com/gpg2' |
| 788 | + } |
| 789 | + } |
| 790 | + } |
| 791 | + end |
| 792 | + |
| 793 | + it { is_expected.to compile.with_all_deps } |
| 794 | + it { is_expected.to have_yumrepo_resource_count(1) } |
| 795 | + it { is_expected.to contain_yumrepo('example') } |
| 796 | + it { is_expected.to contain_yum__gpgkey('/etc/pki/rpm-gpg/RPM-GPG-KEY-example') } |
| 797 | + it { is_expected.to contain_yum__gpgkey('/etc/pki/rpm-gpg/RPM-GPG-KEY-example2') } |
| 798 | + end |
747 | 799 | end
|
748 | 800 | end
|
749 | 801 |
|
|
0 commit comments