Browse Source

test(repository): favor `platform` over `os`

tags/v2.8.0
Javier Bértoli 2 years ago
parent
commit
c16ecf82f5
1 changed files with 10 additions and 15 deletions
  1. +10
    -15
      test/integration/passenger/controls/repository.rb

+ 10
- 15
test/integration/passenger/controls/repository.rb View File

@@ -1,25 +1,20 @@
# frozen_string_literal: true

case os.family
case platform.family
when 'redhat'
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
case platform[:release].to_f.truncate
# ubuntu
when 18
codename = 'bionic'
when 20
codename = 'focal'
# debian
when 9
codename = 'stretch'
when 10
codename = 'buster'
when 11
codename = 'bullseye'
end
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/keyrings/phusionpassenger-archive-keyring.gpg'
repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
# rubocop:disable Metrics/LineLength

Loading…
Cancel
Save