Skip to content

Commit

Permalink
test: custom repo and repo with multiple gpg entries
Browse files Browse the repository at this point in the history
test: fix linter

test: fix linter
  • Loading branch information
teluq-pbrideau committed Oct 7, 2022
1 parent 91a0976 commit 0a01771
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,25 @@
it { is_expected.not_to contain_package('yum-utils') }
it { is_expected.to contain_package('dnf-utils') }
end

context 'when custom repos is set' do
let(:params) { { managed_repos: ['example'], repos: { example: { baseurl: 'https://example.com', gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example' } }, gpgkeys: { '/etc/pki/rpm-gpg/RPM-GPG-KEY-example' => { 'source' => 'http://example.com/gpg' } } } }

it { is_expected.to compile.with_all_deps }
it { is_expected.to have_yumrepo_resource_count(1) }
it { is_expected.to contain_yumrepo('example') }
it { is_expected.to contain_yum__gpgkey('/etc/pki/rpm-gpg/RPM-GPG-KEY-example') }
end

context 'when custom repos with multiple gpgkeys is set' do
let(:params) { { managed_repos: ['example'], repos: { example: { baseurl: 'https://example.com', gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example2', } }, gpgkeys: { '/etc/pki/rpm-gpg/RPM-GPG-KEY-example' => { 'source' => 'http://example.com/gpg' }, '/etc/pki/rpm-gpg/RPM-GPG-KEY-example2' => { 'source' => 'http://example.com/gpg2' } } } }

it { is_expected.to compile.with_all_deps }
it { is_expected.to have_yumrepo_resource_count(1) }
it { is_expected.to contain_yumrepo('example') }
it { is_expected.to contain_yum__gpgkey('/etc/pki/rpm-gpg/RPM-GPG-KEY-example') }
it { is_expected.to contain_yum__gpgkey('/etc/pki/rpm-gpg/RPM-GPG-KEY-example2') }
end
end
end

Expand Down

0 comments on commit 0a01771

Please sign in to comment.