Merge pull request #51 from NexusIS/master
Add missing bind tools package and improve rspec tests
This commit is contained in:
commit
c178d734af
@ -24,6 +24,12 @@ class bind (
|
|||||||
notify => Service['bind'],
|
notify => Service['bind'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
package{'bind-tools':
|
||||||
|
ensure => latest,
|
||||||
|
name => $::bind::params::nsupdate_package,
|
||||||
|
before => Package['bind'],
|
||||||
|
}
|
||||||
|
|
||||||
package { 'bind':
|
package { 'bind':
|
||||||
ensure => latest,
|
ensure => latest,
|
||||||
name => $::bind::params::bind_package,
|
name => $::bind::params::bind_package,
|
||||||
|
|||||||
@ -2,8 +2,20 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'bind' do
|
describe 'bind' do
|
||||||
let(:facts) { { :concat_basedir => '/wtf' } }
|
context "on a Debian OS" do
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:concat_basedir => '/wtf',
|
||||||
|
:osfamily => 'Debian',
|
||||||
|
:operatingsystem => 'Debian'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it {
|
||||||
|
should contain_package('bind-tools').with({
|
||||||
|
'ensure' => 'latest',
|
||||||
|
'name' => 'dnsutils'
|
||||||
|
}).that_comes_before('Package[bind]')
|
||||||
|
}
|
||||||
it {
|
it {
|
||||||
should contain_package('bind').with({
|
should contain_package('bind').with({
|
||||||
'ensure' => 'latest',
|
'ensure' => 'latest',
|
||||||
@ -20,5 +32,36 @@ describe 'bind' do
|
|||||||
'name' => 'bind9'
|
'name' => 'bind9'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
context "on a RedHat OS" do
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:concat_basedir => '/wtf',
|
||||||
|
:osfamily => 'RedHat',
|
||||||
|
:operatingsystem => 'CentOS'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it {
|
||||||
|
should contain_package('bind-tools').with({
|
||||||
|
'ensure' => 'latest',
|
||||||
|
'name' => 'bind-utils'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
it {
|
||||||
|
should contain_package('bind').with({
|
||||||
|
'ensure' => 'latest',
|
||||||
|
'name' => 'bind'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
|
||||||
|
it { should contain_file('_NAMEDCONF_').that_notifies('Service[bind]') }
|
||||||
|
|
||||||
|
it {
|
||||||
|
should contain_service('bind').with({
|
||||||
|
'ensure' => 'running',
|
||||||
|
'name' => 'named'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user