- context 'with simple key' do
- let :params do
- {
- :comment => 'foo',
- :location => 'http://debian.mirror.iweb.ca/debian/',
- :release => 'sid',
- :repos => 'testing',
- :key => GPG_KEY_ID,
- :pin => '10',
- :architecture => 'x86_64',
- :allow_unsigned => true,
- }
- end
+ context 'with allow_insecure true' do
+ let :params do
+ {
+ location: 'hello.there',
+ allow_insecure: true
+ }
+ end
+
+ it {
+ expect(subject).to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[allow-insecure=yes\] hello.there stretch main\n})
+ }
+ end
+
+ context 'with allow_unsigned true' do
+ let :params do
+ {
+ location: 'hello.there',
+ allow_unsigned: true
+ }
+ end
+
+ it {
+ expect(subject).to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[trusted=yes\] hello.there stretch main\n})
+ }
+ end
+
+ context 'with check_valid_until false' do
+ let :params do
+ {
+ location: 'hello.there',
+ check_valid_until: false
+ }
+ end
+
+ it {
+ expect(subject).to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[check-valid-until=false\] hello.there stretch main\n})
+ }
+ end
+
+ context 'with check_valid_until true' do
+ let :params do
+ {
+ location: 'hello.there',
+ check_valid_until: true
+ }
+ end
+
+ it {
+ expect(subject).to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb hello.there stretch main\n})
+ }
+ end
+
+ context 'with keyring set' do
+ let :params do
+ {
+ location: 'hello.there',
+ keyring: '/usr/share/keyrings/foo-archive-keyring.gpg'
+ }
+ end