X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Facceptance%2Fapt_key_provider_spec.rb;h=b43dc15f6d59d9d0ed6386f09e801ecee000fed3;hb=86804ab5d75e4b66b1b2564852d2929353d01877;hp=c17a11440e83dfd3a6694fadd768a308a5737203;hpb=238898455f0d9c4d5fc0d4a2ad950982835a72ab;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 c17a114..b43dc15 100644 --- a/spec/acceptance/apt_key_provider_spec.rb +++ b/spec/acceptance/apt_key_provider_spec.rb @@ -478,13 +478,21 @@ hkp_pool_pp = <<-MANIFEST } MANIFEST -hkps_ubuntu_pp = <<-MANIFEST - apt_key { 'puppetlabs': - id => '#{PUPPETLABS_GPG_KEY_LONG_ID}', - ensure => 'present', - server => 'hkps://keyserver.ubuntu.com', - } - MANIFEST +if fact('operatingsystem') =~ %r{Ubuntu} and fact('operatingsystemrelease') =~ %r{^18\.04} + hkps_protocol_supported = true +else + hkps_protocol_supported = false +end + +if hkps_protocol_supported + hkps_ubuntu_pp = <<-MANIFEST + apt_key { 'puppetlabs': + id => '#{PUPPETLABS_GPG_KEY_LONG_ID}', + ensure => 'present', + server => 'hkps://keyserver.ubuntu.com', + } + MANIFEST +end nonexistant_key_server_pp = <<-MANIFEST apt_key { 'puppetlabs': @@ -794,14 +802,16 @@ describe 'apt_key' do end end - context 'with hkps://keyserver.ubuntu.com' do - it 'works' do - retry_on_error_matching do - apply_manifest(hkps_ubuntu_pp, catch_failures: true) - end + if hkps_protocol_supported + context 'with hkps://keyserver.ubuntu.com' do + it 'works' do + retry_on_error_matching do + apply_manifest(hkps_ubuntu_pp, catch_failures: true) + end - apply_manifest(hkps_ubuntu_pp, catch_changes: true) - shell(PUPPETLABS_KEY_CHECK_COMMAND) + apply_manifest(hkps_ubuntu_pp, catch_changes: true) + shell(PUPPETLABS_KEY_CHECK_COMMAND) + end end end