]> gitweb.fluxo.info Git - puppet-dhcp.git/commitdiff
Test working dhcp::shared_network
authorRaphaël Pinson <raphael.pinson@camptocamp.com>
Fri, 12 Apr 2013 09:18:56 +0000 (11:18 +0200)
committerRaphaël Pinson <raphael.pinson@camptocamp.com>
Fri, 12 Apr 2013 09:18:56 +0000 (11:18 +0200)
spec/defines/dhcp_shared_network_spec.rb
templates/shared-network.erb

index ff5a2c5166ab5b9976121b90c14ced641eca1542..d59f73cba5af65b8c87d608c0402f07a3faf38bd 100644 (file)
@@ -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
index 407106a0c7db00d9555f7238b5fb914e153550f9..33810b8e181226786ab1dd092249c7adcc029ef1 100644 (file)
@@ -7,4 +7,4 @@ shared-network <%= @name %> {
   include "<%= scope.lookupvar("dhcp::params::config_dir") %>/subnets/<%= subnet %>.conf";
 <% end -%>
 }
-#### END <%= name %>
+#### END <%= @name %>