X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Facceptance%2Fapt_key_provider_spec.rb;h=2c9934307077797734b783037fbbc045d65a1065;hb=refs%2Fheads%2Frelease-prep;hp=aa763405a37eb71eac736f94ce5ef7bf8eb525ae;hpb=a4609826c3dc663c2ebb5402ffe7b8a1ea1ecd4f;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/acceptance/apt_key_provider_spec.rb b/spec/acceptance/apt_key_provider_spec.rb index aa76340..2c99343 100644 --- a/spec/acceptance/apt_key_provider_spec.rb +++ b/spec/acceptance/apt_key_provider_spec.rb @@ -669,6 +669,7 @@ describe 'apt_key' do it 'add an apt_key resource' do apply_manifest_twice(ensure_present_pp) end + it 'remove the apt_key resource' do apply_manifest_twice(ensure_absent_pp) end @@ -676,7 +677,7 @@ describe 'apt_key' do describe 'content =>' do context 'with puppetlabs gpg key' do - it 'works' do + it 'applies without error' do # Apply the manifest (Retry if timeout error is received from key pool) retry_on_error_matching do apply_manifest(gpg_key_pp, catch_failures: true) @@ -705,7 +706,7 @@ describe 'apt_key' do describe 'server =>' do context 'with hkp://pgp.mit.edu:80' do - it 'works' do + it 'applies without error' do retry_on_error_matching do apply_manifest(hkp_pool_pp, catch_failures: true) end @@ -717,7 +718,7 @@ describe 'apt_key' do if hkps_protocol_supported context 'with hkps://keyserver.ubuntu.com' do - it 'works' do + it 'applies without error' do retry_on_error_matching do apply_manifest(hkps_ubuntu_pp, catch_failures: true) end @@ -747,7 +748,7 @@ describe 'apt_key' do describe 'source =>' do context 'with http://' do - it 'works' do + it 'applies without error' do apply_manifest_twice(http_works_pp) run_shell(PUPPETLABS_KEY_CHECK_COMMAND) end @@ -776,7 +777,7 @@ describe 'apt_key' do run_shell("apt-key del #{CENTOS_GPG_KEY_LONG_ID}", expect_failures: true) end - it 'works' do + it 'applies without error' do apply_manifest_twice(ftp_works_pp) run_shell(CENTOS_KEY_CHECK_COMMAND) end @@ -795,7 +796,7 @@ describe 'apt_key' do end context 'with https://' do - it 'works' do + it 'applies without error' do apply_manifest_twice(https_works_pp) run_shell(PUPPETLABS_KEY_CHECK_COMMAND) end @@ -833,7 +834,7 @@ describe 'apt_key' do run_shell('rm /tmp/puppetlabs-pubkey.gpg') end - it 'works' do + it 'applies without error' do apply_manifest_twice(path_exists_pp) run_shell(PUPPETLABS_KEY_CHECK_COMMAND) end @@ -855,6 +856,7 @@ describe 'apt_key' do after(:each) do run_shell('rm /tmp/fake-key.gpg') end + it 'fails' do apply_manifest(path_bogus_content_pp, expect_failures: true) do |r| expect(r.stderr).to match(%r{no valid OpenPGP data found}) @@ -865,7 +867,7 @@ describe 'apt_key' do describe 'options =>' do context 'with debug' do - it 'works' do + it 'applies without error' do apply_manifest_twice(debug_works_pp) run_shell(PUPPETLABS_KEY_CHECK_COMMAND) end @@ -874,13 +876,13 @@ describe 'apt_key' do describe 'fingerprint validation against source/content' do context 'with fingerprint in id matches fingerprint from remote key' do - it 'works' do + it 'applies without error' do apply_manifest_twice(fingerprint_match_pp) end end context 'with fingerprint in id does NOT match fingerprint from remote key' do - it 'works' do + it 'applies without error' do apply_manifest(fingerprint_does_not_match_pp, expect_failures: true) do |r| expect(r.stderr).to match(%r{don't match}) end @@ -897,6 +899,7 @@ describe 'apt_key' do apply_manifest(refresh_del_key_pp) apply_manifest(refresh_pp, catch_failures: true) end + context 'when refresh => true' do it 'updates an expired key' do apply_manifest(refresh_true_pp) @@ -904,6 +907,7 @@ describe 'apt_key' do run_shell(PUPPETLABS_EXP_CHECK_COMMAND.to_s) end end + context 'when refresh => false' do it 'does not replace an expired key' do apply_manifest(refresh_false_pp)