Add missing bind tools package and improve rspec tests

Change-Id: I0b4680ce11fe604917fce654d68c2bec17c05438
This commit is contained in:
Aimon Bustardo 2015-07-07 12:02:33 -07:00
parent aeffbe2650
commit 0479c58b7c
2 changed files with 64 additions and 15 deletions

View File

@ -24,6 +24,12 @@ class bind (
notify => Service['bind'],
}
package{'bind-tools':
ensure => latest,
name => $::bind::params::nsupdate_package,
before => Package['bind'],
}
package { 'bind':
ensure => latest,
name => $::bind::params::bind_package,

View File

@ -2,23 +2,66 @@
require 'spec_helper'
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 {
should contain_package('bind').with({
'ensure' => 'latest',
'name' => 'bind9'
})
}
it {
should contain_package('bind').with({
'ensure' => 'latest',
'name' => 'bind9'
})
}
it { should contain_file('_NAMEDCONF_').that_requires('Package[bind]') }
it { should contain_file('_NAMEDCONF_').that_notifies('Service[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' => '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_service('bind').with({
'ensure' => 'running',
'name' => 'bind9'
})
}
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