Skip to content

Commit c16ecf8

Browse files
committed
test(repository): favor platform over os
1 parent 8fee9f0 commit c16ecf8

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

test/integration/passenger/controls/repository.rb

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
# frozen_string_literal: true
22

3-
case os.family
3+
case platform.family
44
when 'redhat'
55
repo_file = '/etc/yum.repos.d/passenger.repo'
66
repo_url = 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch'
77
when 'debian'
88
# Inspec does not provide a `codename` matcher, so we add ours
9-
case platform[:release].to_f.truncate
10-
# ubuntu
11-
when 18
12-
codename = 'bionic'
13-
when 20
14-
codename = 'focal'
15-
# debian
16-
when 9
17-
codename = 'stretch'
18-
when 10
19-
codename = 'buster'
20-
when 11
21-
codename = 'bullseye'
22-
end
9+
finger_codename = {
10+
'ubuntu-18.04' => 'bionic',
11+
'ubuntu-20.04' => 'focal',
12+
'debian-9' => 'stretch',
13+
'debian-10' => 'buster',
14+
'debian-11' => 'bullseye'
15+
}
16+
codename = finger_codename[system.platform[:finger]]
17+
2318
repo_keyring = '/usr/share/keyrings/phusionpassenger-archive-keyring.gpg'
2419
repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
2520
# rubocop:disable Metrics/LineLength

0 commit comments

Comments
 (0)