diff --git a/spec/defines/dhcp_spec.rb b/spec/defines/dhcp_spec.rb new file mode 100644 index 0000000..2480157 --- /dev/null +++ b/spec/defines/dhcp_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +describe 'debnet::iface::dhcp' do + let(:title) { 'eth0' } + let(:facts) {{ + :concat_basedir => '/var/lib/puppet/concat', + }} + + context 'eth0 standard' do + it { + should contain_package('isc-dhcp-client') + should contain_debnet__iface('eth0').with({ + 'method' => 'dhcp', + 'family' => 'inet', + }) + } + end + + context 'eth0 with params' do + let(:params) {{ + :hostname => 'test', + :metric => '20', + :leasetime => '1234', + :vendor => 'vendor', + :client => 'client', + :hwaddress => '11:22:33:44:55:66', + }} + it { + should contain_package('isc-dhcp-client') + should contain_debnet__iface('eth0').with({ + 'method' => 'dhcp', + 'family' => 'inet', + 'hostname' => 'test', + 'metric' => '20', + 'leasetime' => '1234', + 'vendor' => 'vendor', + 'client' => 'client', + 'hwaddress' => '11:22:33:44:55:66', + }) + } + end +end