diff --git a/spec/defines/dhcp_spec.rb b/spec/defines/dhcp_spec.rb index 61611fd..2d79ba1 100644 --- a/spec/defines/dhcp_spec.rb +++ b/spec/defines/dhcp_spec.rb @@ -1,60 +1,61 @@ require 'spec_helper' describe 'debnet::iface::dhcp' do let(:title) { 'eth0' } let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat', + :osfamily => 'Debian', }} 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 context 'eth0 with bad hostname' do let(:params) {{ :hostname => 'test.example.org', }} it { expect { should raise_error(Puppet::Error) } } end context 'eth0 with bad hwaddress' do let(:params) {{ :hwaddress => '11:22:33:44:55:66:xx', }} it { expect { should raise_error(Puppet::Error) } } end end diff --git a/spec/defines/loopback_spec.rb b/spec/defines/loopback_spec.rb index 96afbaa..e8257e6 100644 --- a/spec/defines/loopback_spec.rb +++ b/spec/defines/loopback_spec.rb @@ -1,15 +1,16 @@ require 'spec_helper' describe 'debnet::iface::loopback' do let(:title) { 'lo' } let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat', + :osfamily => 'Debian', }} it { should contain_debnet__iface('lo').with({ 'method' => 'loopback', 'family' => 'inet', }) } end diff --git a/spec/defines/static_spec.rb b/spec/defines/static_spec.rb index 672d528..4ad5aa5 100644 --- a/spec/defines/static_spec.rb +++ b/spec/defines/static_spec.rb @@ -1,23 +1,24 @@ require 'spec_helper' describe 'debnet::iface::static' do let(:title) { 'eth0' } let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat', + :osfamily => 'Debian', }} context 'eth0 with address and mask' do let(:params) {{ :address => '192.168.254.253', :netmask => '24', }} it { should contain_debnet__iface('eth0').with({ 'method' => 'static', 'family' => 'inet', 'address' => '192.168.254.253', 'netmask' => '24', }) } end end