Skip to content

Commit

Permalink
Update tests to reflect new update_policy parameter default
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Lukowski committed Apr 30, 2020
1 parent 194bb11 commit 11b74d9
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions spec/defines/dns_zone_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
require 'spec_helper'

describe 'dns::zone' do

rndc_policy_params = {
:update_policy => {
'rndc-key' => {
'matchtype' => 'zonesub',
'rr' => 'ANY'
},
},
}

on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts.merge(fqdn: 'puppetmaster.example.com') }
Expand Down Expand Up @@ -35,9 +45,6 @@
'zone "example.com" {',
' type master;',
" file \"#{zonefilepath}/db.example.com\";",
' update-policy {',
' grant rndc-key zonesub ANY;',
' };',
'};',
])
end
Expand Down Expand Up @@ -105,7 +112,7 @@
end

context 'when allow_transfer defined' do
let(:params) {{ :allow_transfer => ['192.168.1.2'] }}
let(:params) {rndc_policy_params.merge({ :allow_transfer => ['192.168.1.2'] })}

it "should have valid zone configuration with allow-transfer" do
verify_concat_fragment_exact_contents(catalogue, 'dns_zones+10__GLOBAL__example.com.dns', [
Expand All @@ -121,7 +128,7 @@
end

context 'when allow_transfer with multiple values' do
let(:params) {{ :allow_transfer => ['192.168.1.2', '192.168.1.3'] }}
let(:params) {rndc_policy_params.merge({ :allow_transfer => ['192.168.1.2', '192.168.1.3'] })}

it "should have valid zone configuration with allow-transfer" do
verify_concat_fragment_exact_contents(catalogue, 'dns_zones+10__GLOBAL__example.com.dns', [
Expand All @@ -139,7 +146,7 @@
end

context 'when also_notify defined' do
let(:params) {{ :also_notify => ['192.168.1.2'] }}
let(:params) {rndc_policy_params.merge({ :also_notify => ['192.168.1.2'] })}

it "should have valid zone configuration with also-notify" do
verify_concat_fragment_exact_contents(catalogue, 'dns_zones+10__GLOBAL__example.com.dns', [
Expand All @@ -155,7 +162,7 @@
end

context 'when also_notify with multiple values' do
let(:params) {{ :also_notify => ['192.168.1.2', '192.168.1.3'] }}
let(:params) {rndc_policy_params.merge({ :also_notify => ['192.168.1.2', '192.168.1.3'] })}

it "should have valid zone configuration with also-notify" do
verify_concat_fragment_exact_contents(catalogue, 'dns_zones+10__GLOBAL__example.com.dns', [
Expand Down Expand Up @@ -202,7 +209,7 @@
end

context 'when dns_notify => no' do
let(:params) {{ :dns_notify => 'no' }}
let(:params) {rndc_policy_params.merge({ :dns_notify => 'no' })}

it "should have valid slave zone configuration" do
verify_concat_fragment_exact_contents(catalogue, 'dns_zones+10__GLOBAL__example.com.dns', [
Expand Down Expand Up @@ -266,9 +273,6 @@
'zone "example.com" {',
' type master;',
" file \"#{zonefilepath}/db.example.com\";",
' update-policy {',
' grant rndc-key zonesub ANY;',
' };',
'};',
])
end
Expand All @@ -278,9 +282,6 @@
'zone "example.com" {',
' type master;',
" file \"#{zonefilepath}/db.example.com\";",
' update-policy {',
' grant rndc-key zonesub ANY;',
' };',
'};',
])
end
Expand Down

0 comments on commit 11b74d9

Please sign in to comment.