Skip to content

Commit

Permalink
backports unit tests: minor fixes and updates
Browse files Browse the repository at this point in the history
* Use `include apt` instead of a resource-like class declaration

* Use modern Debian and Ubuntu releases

* Correct the Ubuntu major version
  • Loading branch information
kenyon authored and bastelfreak committed Feb 15, 2024
1 parent 3e364df commit 4b6742b
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions spec/classes/apt_backports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
require 'spec_helper'

describe 'apt::backports', type: :class do
let(:pre_condition) { "class{ '::apt': }" }
let(:pre_condition) { 'include apt' }

describe 'debian/ubuntu tests' do
context 'with defaults on deb' do
context 'with defaults on debian' do
let(:facts) do
{
os: {
family: 'Debian',
name: 'Debian',
release: {
major: '9',
full: '9.0'
full: '11.8',
major: '11',
minor: '8'
},
distro: {
codename: 'stretch',
codename: 'bullseye',
id: 'Debian'
}
}
Expand All @@ -27,8 +28,8 @@
it {
expect(subject).to contain_apt__source('backports').with(location: 'http://deb.debian.org/debian',
repos: 'main contrib non-free',
release: 'stretch-backports',
pin: { 'priority' => 200, 'release' => 'stretch-backports' })
release: 'bullseye-backports',
pin: { 'priority' => 200, 'release' => 'bullseye-backports' })
}
end

Expand All @@ -39,11 +40,11 @@
family: 'Debian',
name: 'Ubuntu',
release: {
major: '18',
full: '18.04'
major: '22.04',
full: '22.04'
},
distro: {
codename: 'bionic',
codename: 'jammy',
id: 'Ubuntu'
}
}
Expand All @@ -53,8 +54,8 @@
it {
expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu',
repos: 'main universe multiverse restricted',
release: 'bionic-backports',
pin: { 'priority' => 200, 'release' => 'bionic-backports' })
release: 'jammy-backports',
pin: { 'priority' => 200, 'release' => 'jammy-backports' })
}
end

Expand All @@ -65,11 +66,11 @@
family: 'Debian',
name: 'Ubuntu',
release: {
major: '18',
full: '18.04'
major: '22.04',
full: '22.04'
},
distro: {
codename: 'bionic',
codename: 'jammy',
id: 'Ubuntu'
}
}
Expand Down Expand Up @@ -101,11 +102,11 @@
family: 'Debian',
name: 'Ubuntu',
release: {
major: '18',
full: '18.04'
major: '22.04',
full: '22.04'
},
distro: {
codename: 'bionic',
codename: 'jammy',
id: 'Ubuntu'
}
}
Expand Down Expand Up @@ -230,11 +231,11 @@
family: 'Debian',
name: 'Ubuntu',
release: {
major: '18',
full: '18.04'
major: '22.04',
full: '22.04'
},
distro: {
codename: 'bionic',
codename: 'jammy',
id: 'Ubuntu'
}
}
Expand Down

0 comments on commit 4b6742b

Please sign in to comment.