2 describe 'apt::backports', :type => :class do
4 describe 'when asigning a custom priority to backports' do
7 'lsbdistcodename' => 'Karmic',
8 'lsbdistid' => 'Ubuntu',
13 context 'integer priority' do
14 let :params do { :pin_priority => 500 } end
16 it { should contain_apt__source('backports').with({
17 'location' => 'http://old-releases.ubuntu.com/ubuntu',
18 'release' => 'karmic-backports',
19 'repos' => 'main universe multiverse restricted',
21 'key_server' => 'pgp.mit.edu',
25 it { should contain_apt__pin('backports').with({
26 'release' => 'karmic-backports',
32 context 'invalid priority' do
33 let :params do { :pin_priority => 'banana' } end
35 expect { subject }.to raise_error(/must be an integer/)
40 describe 'when turning on backports for ubuntu karmic' do
44 'lsbdistcodename' => 'Karmic',
45 'lsbdistid' => 'Ubuntu',
46 'osfamily' => 'Debian'
50 it { should contain_apt__source('backports').with({
51 'location' => 'http://old-releases.ubuntu.com/ubuntu',
52 'release' => 'karmic-backports',
53 'repos' => 'main universe multiverse restricted',
55 'key_server' => 'pgp.mit.edu',
59 it { should contain_apt__pin('backports').with({
60 'release' => 'karmic-backports',
66 describe "when turning on backports for debian squeeze" do
70 'lsbdistcodename' => 'Squeeze',
71 'lsbdistid' => 'Debian',
72 'osfamily' => 'Debian'
76 it { should contain_apt__source('backports').with({
77 'location' => 'http://backports.debian.org/debian-backports',
78 'release' => 'squeeze-backports',
79 'repos' => 'main contrib non-free',
81 'key_server' => 'pgp.mit.edu',
85 it { should contain_apt__pin('backports').with({
86 'release' => 'squeeze-backports',
92 describe "when turning on backports for linux mint debian edition" do
96 'lsbdistcodename' => 'debian',
97 'lsbdistid' => 'LinuxMint',
98 'osfamily' => 'Debian'
102 it { should contain_apt__source('backports').with({
103 'location' => 'http://ftp.debian.org/debian/',
104 'release' => 'wheezy-backports',
105 'repos' => 'main contrib non-free',
107 'key_server' => 'pgp.mit.edu',
111 it { should contain_apt__pin('backports').with({
112 'release' => 'wheezy-backports',
118 describe "when turning on backports for linux mint 17 (ubuntu-based)" do
122 'lsbdistcodename' => 'qiana',
123 'lsbdistid' => 'LinuxMint',
124 'osfamily' => 'Debian'
128 it { should contain_apt__source('backports').with({
129 'location' => 'http://us.archive.ubuntu.com/ubuntu',
130 'release' => 'trusty-backports',
131 'repos' => 'main universe multiverse restricted',
133 'key_server' => 'pgp.mit.edu',
137 it { should contain_apt__pin('backports').with({
138 'release' => 'trusty-backports',
144 describe "when turning on backports for debian squeeze but using your own mirror" do
148 'lsbdistcodename' => 'Squeeze',
149 'lsbdistid' => 'Debian',
150 'osfamily' => 'Debian'
155 'http://mirrors.example.com/debian-backports'
159 { 'location' => location }
162 it { should contain_apt__source('backports').with({
163 'location' => location,
164 'release' => 'squeeze-backports',
165 'repos' => 'main contrib non-free',
167 'key_server' => 'pgp.mit.edu',
171 it { should contain_apt__pin('backports').with({
172 'release' => 'squeeze-backports',