aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Pinson <raphael.pinson@camptocamp.com>2013-04-12 11:18:56 +0200
committerRaphaël Pinson <raphael.pinson@camptocamp.com>2013-04-12 11:18:56 +0200
commite7cdc4e685a73d05be05ea9d6d0f854c4a3a6ab2 (patch)
tree244745d2a6b776b56e0d564bf7933c7dfd8e0bad
parentb35e1322d0a791ab22cb2c385ec913492c75026d (diff)
downloadpuppet-dhcp-e7cdc4e685a73d05be05ea9d6d0f854c4a3a6ab2.tar.gz
puppet-dhcp-e7cdc4e685a73d05be05ea9d6d0f854c4a3a6ab2.tar.bz2
Test working dhcp::shared_network
-rw-r--r--spec/defines/dhcp_shared_network_spec.rb12
-rw-r--r--templates/shared-network.erb2
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/defines/dhcp_shared_network_spec.rb b/spec/defines/dhcp_shared_network_spec.rb
index ff5a2c5..d59f73c 100644
--- a/spec/defines/dhcp_shared_network_spec.rb
+++ b/spec/defines/dhcp_shared_network_spec.rb
@@ -37,7 +37,7 @@ describe 'dhcp::shared_network' do
:ensure => 'present',
:target => '/etc/dhcp/dhcpd.conf'
).with_content(
- /shared-network My network/
+ /shared-network My network \{\n\}/
)
}
end
@@ -67,5 +67,15 @@ describe 'dhcp::shared_network' do
end
context 'when passing subnets' do
+ let (:params) { {
+ :subnets => ['1.2.3.4', '5.6.7.8'],
+ } }
+
+ it { should contain_concat__fragment('dhcp-shared-My network').with(
+ :ensure => 'present',
+ :target => '/etc/dhcp/dhcpd.conf'
+ ).with_content(
+ /shared-network My network \{\n include "\/etc\/dhcp\/subnets\/1\.2\.3\.4\.conf";\n include "\/etc\/dhcp\/subnets\/5\.6\.7\.8\.conf";\n\}/)
+ }
end
end
diff --git a/templates/shared-network.erb b/templates/shared-network.erb
index 407106a..33810b8 100644
--- a/templates/shared-network.erb
+++ b/templates/shared-network.erb
@@ -7,4 +7,4 @@ shared-network <%= @name %> {
include "<%= scope.lookupvar("dhcp::params::config_dir") %>/subnets/<%= subnet %>.conf";
<% end -%>
}
-#### END <%= name %>
+#### END <%= @name %>