Skip to content

Commit

Permalink
Merge pull request #265 from nod0n/unsupported_os
Browse files Browse the repository at this point in the history
Drop obsolete operating system version check in acceptance tests
  • Loading branch information
ekohl authored Dec 15, 2021
2 parents 42f4ba8 + 6c81f3d commit 61ffd8d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 49 deletions.
38 changes: 11 additions & 27 deletions spec/acceptance/letsencrypt_plugin_dns_rfc2136_spec.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
require 'spec_helper_acceptance'

describe 'letsencrypt::plugin::dns_rfc2136' do
supported = case fact('os.family')
when 'Debian'
# Debian 9 has it in backports, Ubuntu started shipping in Bionic
fact('os.release.major') != '9' && fact('os.release.major') != '16.04'
when 'RedHat'
true
else
false
end

context 'with defaults values' do
pp = <<-PUPPET
class { 'letsencrypt' :
Expand All @@ -26,24 +16,18 @@ class { 'letsencrypt::plugin::dns_rfc2136':
}
PUPPET

if supported
it 'installs letsencrypt and dns rfc2136 plugin without error' do
apply_manifest(pp, catch_failures: true)
end
it 'installs letsencrypt and dns rfc2136 idempotently' do
apply_manifest(pp, catch_changes: true)
end
it 'installs letsencrypt and dns rfc2136 plugin without error' do
apply_manifest(pp, catch_failures: true)
end
it 'installs letsencrypt and dns rfc2136 idempotently' do
apply_manifest(pp, catch_changes: true)
end

describe file('/etc/letsencrypt/dns-rfc2136.ini') do
it { is_expected.to be_file }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
it { is_expected.to be_mode 400 }
end
else
it 'fails to install' do
apply_manifest(pp, expect_failures: true)
end
describe file('/etc/letsencrypt/dns-rfc2136.ini') do
it { is_expected.to be_file }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
it { is_expected.to be_mode 400 }
end
end
end
27 changes: 5 additions & 22 deletions spec/acceptance/letsencrypt_plugin_dns_route53_spec.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
require 'spec_helper_acceptance'

describe 'letsencrypt::plugin::dns_route53' do
supported = case fact('os.family')
when 'Debian'
# Debian 9 has it in backports, Ubuntu started shipping in Bionic
fact('os.release.major') != '9' && fact('os.release.major') != '16.04'
when 'RedHat'
true
else
false
end

context 'with defaults values' do
pp = <<-PUPPET
class { 'letsencrypt' :
Expand All @@ -23,18 +13,11 @@ class { 'letsencrypt::plugin::dns_route53':
}
PUPPET

if supported
it 'installs letsencrypt and dns route53 plugin without error' do
apply_manifest(pp, catch_failures: true)
end
it 'installs letsencrypt and dns route53 idempotently' do
apply_manifest(pp, catch_changes: true)
end

else
it 'fails to install' do
apply_manifest(pp, expect_failures: true)
end
it 'installs letsencrypt and dns route53 plugin without error' do
apply_manifest(pp, catch_failures: true)
end
it 'installs letsencrypt and dns route53 idempotently' do
apply_manifest(pp, catch_changes: true)
end
end
end

0 comments on commit 61ffd8d

Please sign in to comment.