2014-08-14 01:05:08 +10:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'openstack_extras::repo::debian::debian' do
|
|
|
|
let :class_params do
|
|
|
|
{
|
2018-04-03 13:35:05 +02:00
|
|
|
:manage_deb => true,
|
2014-08-14 01:05:08 +10:00
|
|
|
:source_hash => {},
|
|
|
|
:source_defaults => {},
|
|
|
|
:package_require => false
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :paramclass_defaults do
|
|
|
|
{
|
2018-04-09 11:39:11 +02:00
|
|
|
:release => 'rocky'
|
2014-08-14 01:05:08 +10:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :default_params do
|
|
|
|
class_params.merge!(paramclass_defaults)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on Debian platforms' do
|
|
|
|
let :facts do
|
2016-01-08 16:20:23 -07:00
|
|
|
@default_facts.merge({
|
2014-08-14 01:05:08 +10:00
|
|
|
:osfamily => 'Debian',
|
|
|
|
:operatingsystem => 'Debian',
|
2016-09-26 11:23:03 -06:00
|
|
|
:lsbdistid => 'Debian',
|
2018-04-03 13:35:05 +02:00
|
|
|
:lsbdistcodename => 'stretch',
|
|
|
|
:lsbdistrelease => '9'
|
2016-01-08 16:20:23 -07:00
|
|
|
})
|
2014-08-14 01:05:08 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with default parameters' do
|
|
|
|
let :params do
|
|
|
|
{}.merge!(default_params)
|
|
|
|
end
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_apt__source('debian-openstack-backports').with(
|
2018-04-09 11:39:11 +02:00
|
|
|
:location => 'http://stretch-rocky.debian.net/debian',
|
|
|
|
:release => 'stretch-rocky-backports',
|
2014-08-14 01:05:08 +10:00
|
|
|
:repos => 'main',
|
|
|
|
)}
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_apt__source('debian-openstack-backports-nochange').with(
|
2018-04-09 11:39:11 +02:00
|
|
|
:location => 'http://stretch-rocky.debian.net/debian',
|
|
|
|
:release => 'stretch-rocky-backports-nochange',
|
2014-08-14 01:05:08 +10:00
|
|
|
:repos => 'main'
|
|
|
|
)}
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_exec('installing openstack-backports-archive-keyring') }
|
2014-08-14 01:05:08 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with overridden release' do
|
|
|
|
let :params do
|
2018-04-03 13:35:05 +02:00
|
|
|
default_params.merge!({ :release => 'pike' })
|
2014-08-14 01:05:08 +10:00
|
|
|
end
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_apt__source('debian-openstack-backports').with(
|
|
|
|
:location => 'http://stretch-pike.debian.net/debian',
|
|
|
|
:release => 'stretch-pike-backports',
|
2014-08-14 01:05:08 +10:00
|
|
|
:repos => 'main',
|
|
|
|
)}
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_apt__source('debian-openstack-backports-nochange').with(
|
|
|
|
:location => 'http://stretch-pike.debian.net/debian',
|
|
|
|
:release => 'stretch-pike-backports-nochange',
|
2014-08-14 01:05:08 +10:00
|
|
|
:repos => 'main'
|
|
|
|
)}
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_exec('installing openstack-backports-archive-keyring') }
|
2015-06-25 10:35:41 -04:00
|
|
|
end
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
describe 'when not managing stretch repo' do
|
2015-06-25 10:35:41 -04:00
|
|
|
let :params do
|
2018-04-03 13:35:05 +02:00
|
|
|
default_params.merge!({ :manage_deb => false })
|
2015-06-25 10:35:41 -04:00
|
|
|
end
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to_not contain_exec('installing openstack-backports-archive-keyring') }
|
2014-08-14 01:05:08 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with overridden source hash' do
|
|
|
|
let :params do
|
|
|
|
default_params.merge!({ :source_hash => {
|
|
|
|
'debian_unstable' => {
|
|
|
|
'location' => 'http://mymirror/debian/',
|
|
|
|
'repos' => 'main',
|
|
|
|
'release' => 'unstable'
|
|
|
|
},
|
|
|
|
'puppetlabs' => {
|
|
|
|
'location' => 'http://apt.puppetlabs.com',
|
|
|
|
'repos' => 'main',
|
2018-04-03 13:35:05 +02:00
|
|
|
'release' => 'stretch',
|
2014-08-14 01:05:08 +10:00
|
|
|
'key' => '4BD6EC30',
|
|
|
|
'key_server' => 'pgp.mit.edu'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-09-14 09:52:06 +02:00
|
|
|
it { is_expected.to contain_apt__source('debian_unstable').with(
|
2014-08-14 01:05:08 +10:00
|
|
|
:location => 'http://mymirror/debian/',
|
|
|
|
:release => 'unstable',
|
|
|
|
:repos => 'main'
|
|
|
|
)}
|
|
|
|
|
2015-09-14 09:52:06 +02:00
|
|
|
it { is_expected.to contain_apt__source('puppetlabs').with(
|
2014-08-14 01:05:08 +10:00
|
|
|
:location => 'http://apt.puppetlabs.com',
|
|
|
|
:repos => 'main',
|
2018-04-03 13:35:05 +02:00
|
|
|
:release => 'stretch',
|
2014-08-14 01:05:08 +10:00
|
|
|
:key => '4BD6EC30',
|
|
|
|
:key_server => 'pgp.mit.edu'
|
|
|
|
)}
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_exec('installing openstack-backports-archive-keyring') }
|
2014-08-14 01:05:08 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with overridden source default' do
|
|
|
|
let :params do
|
2015-06-26 00:55:37 -07:00
|
|
|
default_params.merge!({ :source_hash => {
|
|
|
|
'debian_unstable' => {
|
|
|
|
'location' => 'http://mymirror/debian/',
|
|
|
|
'repos' => 'main',
|
|
|
|
'release' => 'unstable'
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
2014-08-14 01:05:08 +10:00
|
|
|
default_params.merge!({ :source_defaults => {
|
|
|
|
'include_src' => 'true'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-09-14 09:52:06 +02:00
|
|
|
it { is_expected.to contain_apt__source('debian_unstable').with(
|
2015-06-26 00:55:37 -07:00
|
|
|
:location => 'http://mymirror/debian/',
|
|
|
|
:release => 'unstable',
|
2014-08-14 01:05:08 +10:00
|
|
|
:repos => 'main',
|
|
|
|
:include_src => 'true'
|
|
|
|
)}
|
|
|
|
|
2018-04-03 13:35:05 +02:00
|
|
|
it { is_expected.to contain_exec('installing openstack-backports-archive-keyring') }
|
2014-08-14 01:05:08 +10:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|