add a bunch of RedHat specific tests

This commit is contained in:
Gareth Rushgrove 2014-01-19 13:44:46 +00:00
Родитель a2a75b14b5
Коммит 216801314f
3 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -2,5 +2,6 @@ fixtures:
repositories:
apt: git://github.com/puppetlabs/puppetlabs-apt.git
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
epel: git://github.com/stahnma/puppet-module-epel.git
symlinks:
docker: "#{source_dir}"

Просмотреть файл

@ -45,7 +45,7 @@ class docker::install {
}
'RedHat': {
if versioncmp($::operatingsystemrelease, '6.5') < 0 {
fail('Docker needs RedHat/CentOS > 6.5.')
fail('Docker needs RedHat/CentOS version to be at least 6.5.')
}
$dockerbasepkg = 'docker-io'

Просмотреть файл

@ -40,6 +40,29 @@ describe 'docker', :type => :class do
end
end
context 'if running on a RedHat based distro' do
let(:facts) { {
:osfamily => 'RedHat',
:operatingsystemrelease => '6.5'
} }
it { should contain_class('epel') }
it { should_not contain_apt__source('docker') }
it { should contain_package('docker').with_name('docker-io').with_ensure('present') }
it { should_not contain_package('linux-image-extra-3.8.0-29-generic') }
end
context 'if running an older RedHat based distro' do
let(:facts) { {
:osfamily => 'RedHat',
:operatingsystemrelease => '6.4'
} }
it do
expect {
should contain_package('docker')
}.to raise_error(Puppet::Error, /version to be at least 6.5/)
end
end
context 'with no upstream package source' do
let(:params) { {'use_upstream_package_source' => false } }
it { should_not contain_apt__source('docker') }