|
3 | 3 | require 'spec_helper'
|
4 | 4 |
|
5 | 5 | describe 'apt::backports', type: :class do
|
6 |
| - let(:pre_condition) { "class{ '::apt': }" } |
| 6 | + let(:pre_condition) { 'include apt' } |
7 | 7 |
|
8 | 8 | describe 'debian/ubuntu tests' do
|
9 |
| - context 'with defaults on deb' do |
| 9 | + context 'with defaults on debian' do |
10 | 10 | let(:facts) do
|
11 | 11 | {
|
12 | 12 | os: {
|
13 | 13 | family: 'Debian',
|
14 | 14 | name: 'Debian',
|
15 | 15 | release: {
|
16 |
| - major: '9', |
17 |
| - full: '9.0' |
| 16 | + full: '11.8', |
| 17 | + major: '11', |
| 18 | + minor: '8' |
18 | 19 | },
|
19 | 20 | distro: {
|
20 |
| - codename: 'stretch', |
| 21 | + codename: 'bullseye', |
21 | 22 | id: 'Debian'
|
22 | 23 | }
|
23 | 24 | }
|
24 | 25 | }
|
25 | 26 | end
|
26 | 27 |
|
27 | 28 | it {
|
28 |
| - expect(subject).to contain_apt__source('backports').with(location: 'http://deb.debian.org/debian', |
29 |
| - repos: 'main contrib non-free', |
30 |
| - release: 'stretch-backports', |
31 |
| - pin: { 'priority' => 200, 'release' => 'stretch-backports' }) |
| 29 | + expect(subject).to contain_apt__source('backports').with( |
| 30 | + location: 'http://deb.debian.org/debian', |
| 31 | + repos: 'main contrib non-free', |
| 32 | + release: 'bullseye-backports', |
| 33 | + pin: { |
| 34 | + 'priority' => 200, |
| 35 | + 'release' => 'bullseye-backports' |
| 36 | + }, |
| 37 | + keyring: '/usr/share/keyrings/debian-archive-keyring.gpg', |
| 38 | + ) |
32 | 39 | }
|
33 | 40 | end
|
34 | 41 |
|
|
39 | 46 | family: 'Debian',
|
40 | 47 | name: 'Ubuntu',
|
41 | 48 | release: {
|
42 |
| - major: '18', |
43 |
| - full: '18.04' |
| 49 | + major: '22.04', |
| 50 | + full: '22.04' |
44 | 51 | },
|
45 | 52 | distro: {
|
46 |
| - codename: 'bionic', |
| 53 | + codename: 'jammy', |
47 | 54 | id: 'Ubuntu'
|
48 | 55 | }
|
49 | 56 | }
|
50 | 57 | }
|
51 | 58 | end
|
52 | 59 |
|
53 | 60 | it {
|
54 |
| - expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', |
55 |
| - repos: 'main universe multiverse restricted', |
56 |
| - release: 'bionic-backports', |
57 |
| - pin: { 'priority' => 200, 'release' => 'bionic-backports' }) |
| 61 | + expect(subject).to contain_apt__source('backports').with( |
| 62 | + location: 'http://archive.ubuntu.com/ubuntu', |
| 63 | + repos: 'main universe multiverse restricted', |
| 64 | + release: 'jammy-backports', |
| 65 | + pin: { |
| 66 | + 'priority' => 200, |
| 67 | + 'release' => 'jammy-backports' |
| 68 | + }, |
| 69 | + keyring: '/usr/share/keyrings/ubuntu-archive-keyring.gpg', |
| 70 | + ) |
58 | 71 | }
|
59 | 72 | end
|
60 | 73 |
|
|
65 | 78 | family: 'Debian',
|
66 | 79 | name: 'Ubuntu',
|
67 | 80 | release: {
|
68 |
| - major: '18', |
69 |
| - full: '18.04' |
| 81 | + major: '22.04', |
| 82 | + full: '22.04' |
70 | 83 | },
|
71 | 84 | distro: {
|
72 |
| - codename: 'bionic', |
| 85 | + codename: 'jammy', |
73 | 86 | id: 'Ubuntu'
|
74 | 87 | }
|
75 | 88 | }
|
|
86 | 99 | end
|
87 | 100 |
|
88 | 101 | it {
|
89 |
| - expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu-test', |
90 |
| - key: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', |
91 |
| - repos: 'main', |
92 |
| - release: 'vivid', |
93 |
| - pin: { 'priority' => 90, 'release' => 'vivid' }) |
| 102 | + expect(subject).to contain_apt__source('backports').with( |
| 103 | + location: 'http://archive.ubuntu.com/ubuntu-test', |
| 104 | + key: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', |
| 105 | + repos: 'main', |
| 106 | + release: 'vivid', |
| 107 | + pin: { 'priority' => 90, 'release' => 'vivid' }, |
| 108 | + ) |
94 | 109 | }
|
95 | 110 | end
|
96 | 111 |
|
|
101 | 116 | family: 'Debian',
|
102 | 117 | name: 'Ubuntu',
|
103 | 118 | release: {
|
104 |
| - major: '18', |
105 |
| - full: '18.04' |
| 119 | + major: '22.04', |
| 120 | + full: '22.04' |
106 | 121 | },
|
107 | 122 | distro: {
|
108 |
| - codename: 'bionic', |
| 123 | + codename: 'jammy', |
109 | 124 | id: 'Ubuntu'
|
110 | 125 | }
|
111 | 126 | }
|
|
123 | 138 | end
|
124 | 139 |
|
125 | 140 | it {
|
126 |
| - expect(subject).to contain_apt__source('backports').with(key: { 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' }, |
127 |
| - pin: { 'priority' => '90' }) |
| 141 | + expect(subject).to contain_apt__source('backports').with( |
| 142 | + key: { 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' }, |
| 143 | + pin: { 'priority' => '90' }, |
| 144 | + ) |
128 | 145 | }
|
129 | 146 | end
|
130 | 147 | end
|
131 | 148 |
|
132 |
| - describe 'mint tests' do |
| 149 | + describe 'linuxmint tests' do |
133 | 150 | let(:facts) do
|
134 | 151 | {
|
135 | 152 | os: {
|
|
158 | 175 | end
|
159 | 176 |
|
160 | 177 | it {
|
161 |
| - expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', |
162 |
| - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', |
163 |
| - repos: 'main universe multiverse restricted', |
164 |
| - release: 'trusty-backports', |
165 |
| - pin: { 'priority' => 200, 'release' => 'trusty-backports' }) |
| 178 | + expect(subject).to contain_apt__source('backports').with( |
| 179 | + location: 'http://archive.ubuntu.com/ubuntu', |
| 180 | + key: '630239CC130E1A7FD81A27B140976EAF437D05B5', |
| 181 | + repos: 'main universe multiverse restricted', |
| 182 | + release: 'trusty-backports', |
| 183 | + pin: { 'priority' => 200, 'release' => 'trusty-backports' }, |
| 184 | + ) |
166 | 185 | }
|
167 | 186 | end
|
168 | 187 |
|
|
176 | 195 | end
|
177 | 196 |
|
178 | 197 | it do
|
179 |
| - expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) |
| 198 | + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, and repos}) |
180 | 199 | end
|
181 | 200 | end
|
182 | 201 |
|
|
190 | 209 | end
|
191 | 210 |
|
192 | 211 | it do
|
193 |
| - expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) |
| 212 | + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, and repos}) |
194 | 213 | end
|
195 | 214 | end
|
196 | 215 |
|
|
204 | 223 | end
|
205 | 224 |
|
206 | 225 | it do
|
207 |
| - expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) |
208 |
| - end |
209 |
| - end |
210 |
| - |
211 |
| - context 'with missing key' do |
212 |
| - let(:params) do |
213 |
| - { |
214 |
| - location: 'http://archive.ubuntu.com/ubuntu', |
215 |
| - release: 'trusty-backports', |
216 |
| - repos: 'main universe multiverse restricted' |
217 |
| - } |
218 |
| - end |
219 |
| - |
220 |
| - it do |
221 |
| - expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) |
| 226 | + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, and repos}) |
222 | 227 | end
|
223 | 228 | end
|
224 | 229 | end
|
|
230 | 235 | family: 'Debian',
|
231 | 236 | name: 'Ubuntu',
|
232 | 237 | release: {
|
233 |
| - major: '18', |
234 |
| - full: '18.04' |
| 238 | + major: '22.04', |
| 239 | + full: '22.04' |
235 | 240 | },
|
236 | 241 | distro: {
|
237 |
| - codename: 'bionic', |
| 242 | + codename: 'jammy', |
238 | 243 | id: 'Ubuntu'
|
239 | 244 | }
|
240 | 245 | }
|
|
0 commit comments