2012-04-12 02:49:30 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'apt::backports', :type => :class do
|
|
|
|
|
2014-03-26 17:13:08 +01:00
|
|
|
describe 'when asigning a custom priority to backports' do
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
'lsbdistcodename' => 'Karmic',
|
|
|
|
'lsbdistid' => 'Ubuntu'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'integer priority' do
|
|
|
|
let :params do { :pin_priority => 500 } end
|
|
|
|
|
|
|
|
it { should contain_apt__source('backports').with({
|
|
|
|
'location' => 'http://old-releases.ubuntu.com/ubuntu',
|
|
|
|
'release' => 'karmic-backports',
|
|
|
|
'repos' => 'main universe multiverse restricted',
|
|
|
|
'key' => '437D05B5',
|
|
|
|
'key_server' => 'pgp.mit.edu',
|
|
|
|
'pin' => 500,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'invalid priority' do
|
|
|
|
let :params do { :pin_priority => 'banana' } end
|
|
|
|
it 'should fail' do
|
|
|
|
expect { subject }.to raise_error(/must be an integer/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-04-12 02:49:30 +02:00
|
|
|
describe 'when turning on backports for ubuntu karmic' do
|
|
|
|
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
'lsbdistcodename' => 'Karmic',
|
|
|
|
'lsbdistid' => 'Ubuntu'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2012-05-25 20:20:46 +02:00
|
|
|
it { should contain_apt__source('backports').with({
|
2012-04-12 02:49:30 +02:00
|
|
|
'location' => 'http://old-releases.ubuntu.com/ubuntu',
|
|
|
|
'release' => 'karmic-backports',
|
2012-06-29 13:15:13 +02:00
|
|
|
'repos' => 'main universe multiverse restricted',
|
2012-04-12 02:49:30 +02:00
|
|
|
'key' => '437D05B5',
|
|
|
|
'key_server' => 'pgp.mit.edu',
|
2014-03-26 17:13:08 +01:00
|
|
|
'pin' => 200,
|
2012-04-12 02:49:30 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "when turning on backports for debian squeeze" do
|
|
|
|
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
'lsbdistcodename' => 'Squeeze',
|
|
|
|
'lsbdistid' => 'Debian',
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2012-05-25 20:20:46 +02:00
|
|
|
it { should contain_apt__source('backports').with({
|
2012-04-12 02:49:30 +02:00
|
|
|
'location' => 'http://backports.debian.org/debian-backports',
|
|
|
|
'release' => 'squeeze-backports',
|
|
|
|
'repos' => 'main contrib non-free',
|
2014-02-18 22:57:01 +01:00
|
|
|
'key' => '46925553',
|
2012-04-12 02:49:30 +02:00
|
|
|
'key_server' => 'pgp.mit.edu',
|
2014-03-26 17:13:08 +01:00
|
|
|
'pin' => 200,
|
2012-04-12 02:49:30 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "when turning on backports for debian squeeze but using your own mirror" do
|
|
|
|
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
'lsbdistcodename' => 'Squeeze',
|
|
|
|
'lsbdistid' => 'Debian'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :location do
|
|
|
|
'http://mirrors.example.com/debian-backports'
|
|
|
|
end
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{ 'location' => location }
|
|
|
|
end
|
|
|
|
|
2012-05-25 20:20:46 +02:00
|
|
|
it { should contain_apt__source('backports').with({
|
2012-04-12 02:49:30 +02:00
|
|
|
'location' => location,
|
|
|
|
'release' => 'squeeze-backports',
|
|
|
|
'repos' => 'main contrib non-free',
|
2014-02-18 22:57:01 +01:00
|
|
|
'key' => '46925553',
|
2012-04-12 02:49:30 +02:00
|
|
|
'key_server' => 'pgp.mit.edu',
|
2014-03-26 17:13:08 +01:00
|
|
|
'pin' => 200,
|
2012-04-12 02:49:30 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|