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 5f1a289 commit 0e51694
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions test/integration/passenger/controls/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
repo_file = '/etc/yum.repos.d/passenger.repo'
repo_url = 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch'
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]]

codename = system.platform[:codename]
repo_keyring = '/usr/share/keyrings/phusionpassenger-archive-keyring.gpg'
repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/LineLength
repo_url = "deb [signed-by=#{repo_keyring}] https://oss-binaries.phusionpassenger.com/apt/passenger #{codename} main"
# rubocop:enable Metrics/LineLength
# rubocop:enable Layout/LineLength
end

control 'Phusion-passenger repository keyring' do
Expand Down

0 comments on commit 0e51694

Please sign in to comment.