Skip to content

Commit

Permalink
test(repository): use system.platform[:codename] [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Feb 14, 2022
1 parent 1270d0c commit 1c70c9c
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions test/integration/repo/controls/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,11 @@
repo_file = os_name_repo_file[platform.name]

when 'debian'
# Inspec does not provide a `codename` matcher, so we add ours
finger_codename = {
'ubuntu-18.04' => 'bionic',
'ubuntu-20.04' => 'focal',
'debian-9' => 'stretch',
'debian-10' => 'buster',
'debian-11' => 'bullseye'
}
codename = finger_codename[system.platform[:finger]]

repo_keyring = '/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg'
repo_file = '/etc/apt/sources.list.d/pgdg.list'
# rubocop:disable Metrics/LineLength
repo_url = "deb [signed-by=#{repo_keyring}] http:https://apt.postgresql.org/pub/repos/apt #{codename}-pgdg main"
# rubocop:enable Metrics/LineLength
# rubocop:disable Layout/LineLength
repo_url = "deb [signed-by=#{repo_keyring}] http:https://apt.postgresql.org/pub/repos/apt #{system.platform[:codename]}-pgdg main"
# rubocop:enable Layout/LineLength
end

control 'Postgresql repository keyring' do
Expand Down

0 comments on commit 1c70c9c

Please sign in to comment.