Skip to content

Commit

Permalink
update test and fix slave addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
b4ldr committed Jun 8, 2016
1 parent eccce1c commit 28b53e9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 22 deletions.
1 change: 0 additions & 1 deletion manifests/zone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
} else {
$zone_subdir = $::knot::zone_subdir
}
$slave_addresses = $::knot::slave_addresses
concat::fragment{ "knot_zones_${name}":
target => $::knot::conf_file,
content => template($::knot::zones_template),
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/knot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
it do
is_expected.to contain_concat__fragment('knot_server')
.with(
'order' => '01',
'order' => '10',
'target' => conf_file
).with_content(
/identity foo.example.com;/
Expand Down Expand Up @@ -142,7 +142,7 @@
is_expected.to contain_concat__fragment('key_head')
.with(
'content' => /keys {/,
'order' => '09',
'order' => '01',
'target' => conf_file

)
Expand All @@ -151,7 +151,7 @@
is_expected.to contain_concat__fragment('key_foot')
.with(
'content' => /}/,
'order' => '11',
'order' => '03',
'target' => conf_file

)
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/tsig_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
is_expected.to contain_concat__fragment('knot_key_foo.example.com')
.with(
'content' => /foo.example.com hmac-sha256 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="/,
'order' => '10',
'order' => '02',
)
end
end
Expand All @@ -56,7 +56,7 @@
is_expected.to contain_concat__fragment('knot_key_foo.example.com')
.with(
'content' => /foo.example.com hmac-md5 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="/,
'order' => '10',
'order' => '02',
)
end
end
Expand All @@ -67,7 +67,7 @@
is_expected.to contain_concat__fragment('knot_key_foo.example.com')
.with(
'content' => /foo.example.com hmac-sha256 "foobar"/,
'order' => '10',
'order' => '02',
)
end
end
Expand Down
26 changes: 13 additions & 13 deletions spec/defines/zone_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
.with_content(
/remotes {\n}/
).with_content(
/groups {\n}/
/groups {\s+xfr-in-example\s+{\s+}\s+xfr-out-example\s+{\s+}\s+notify-out-example\s+{\s+}\s+notify-in-example\s+{\s+}\s+}/
).with_content(
/zones {\n}/
)
Expand All @@ -79,31 +79,31 @@
it do
is_expected.to contain_concat__fragment('knot_zones_example')
.with_content(
/remotes\s+{[\s\S]+master1-example\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
/remotes\s+{[\s\S]+xfr-out-example1\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
).with_content(
/remotes\s+{[\s\S]+slave1-example\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
/remotes\s+{[\s\S]+xfr-in-example1\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
).with_content(
/remotes\s+{[\s\S]+notify1-example-out\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
/remotes\s+{[\s\S]+notify-out-example1\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
).with_content(
/remotes\s+{[\s\S]+notify1-example-in\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
/remotes\s+{[\s\S]+notify-in-example1\s+{\s+address\s+192.0.2.1;\s+port\s+53;\s+}[\s\S]+\n}/
).with_content(
/groups\s+{[\s\S]+master-example\s+{\s+master1-example\s+}[\s\S]+\n}/
/groups\s+{[\s\S]+xfr-in-example\s+{\s+xfr-in-example1\s+}[\s\S]+\n}/
).with_content(
/groups\s+{[\s\S]+slave-example\s+{\s+slave1-example\s+}[\s\S]+\n}/
/groups\s+{[\s\S]+xfr-out-example\s+{\s+xfr-out-example1\s+}[\s\S]+\n}/
).with_content(
/groups\s+{[\s\S]+notify-example-in\s+{\s+notify1-example-in\s+}[\s\S]+\n}/
/groups\s+{[\s\S]+notify-in-example\s+{\s+notify-in-example1\s+}[\s\S]+\n}/
).with_content(
/groups\s+{[\s\S]+notify-example-out\s+{\s+notify1-example-out\s+}[\s\S]+\n}/
/groups\s+{[\s\S]+notify-out-example\s+{\s+notify-out-example1\s+}[\s\S]+\n}/
).with_content(
/zones\s+{\s+"example.com"\s+{[\s\S]+file\s+"#{zone_subdir}\/example.com"[\s\S]+\n}/
).with_content(
/zones\s+{\s+"example.com"\s+{[\s\S]+notify-out\s+notify-example-out[\s\S]+\n}/
/zones\s+{\s+"example.com"\s+{[\s\S]+notify-out\s+notify-out-example[\s\S]+\n}/
).with_content(
/zones\s+{\s+"example.com"\s+{[\s\S]+notify-in\s+notify-example-in[\s\S]+\n}/
/zones\s+{\s+"example.com"\s+{[\s\S]+notify-in\s+notify-in-example[\s\S]+\n}/
).with_content(
/zones\s+{\s+"example.com"\s+{[\s\S]+xfr-in\s+master-example[\s\S]+\n}/
/zones\s+{\s+"example.com"\s+{[\s\S]+xfr-in\s+xfr-in-example[\s\S]+\n}/
).with_content(
/zones\s+{\s+"example.com"\s+{[\s\S]+xfr-out\s+slave-example[\s\S]+\n}/
/zones\s+{\s+"example.com"\s+{[\s\S]+xfr-out\s+xfr-out-example[\s\S]+\n}/
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions templates/etc/knot/knot.zones.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ groups {
}
xfr-out-<%= @name %> {
<%- @provide_xfr.each_with_index do |xfr, index| -%>
xfr-out-<%= @name %><%= index + 1 %><% if index + 1 < @provide_xfr.length then %>,<%- end -%>
xfr-out-<%= @name %><%= index + 1 %><% if index + 1 < @provide_xfr.length then %>,<%- end %>
<%- end %>
}
notify-out-<%= @name %> {
<%- @notify_addresses.each_with_index do |notify_address, index| -%>
notify-out-<%= @name %><%= index + 1 %><% if index + 1 < @notify_addresses.length then %>,<%- end -%>
notify-out-<%= @name %><%= index + 1 %><% if index + 1 < @notify_addresses.length then %>,<%- end %>
<%- end %>
}
notify-in-<%= @name %> {
Expand Down

0 comments on commit 28b53e9

Please sign in to comment.