File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33require 'spec_helper_acceptance'
44
55def has_upstream_repo
6- %w[
7- CentOS
8- RedHat
9- OracleLinux
10- Ubuntu
11- ] . include? fact ( 'os.name' )
6+ os = fact ( 'os' )
7+ case os [ 'family' ]
8+ when 'RedHat'
9+ return true
10+ else
11+ case os [ 'name' ]
12+ when 'Ubuntu'
13+ return true
14+ end
15+ end
16+ false
1217end
1318
1419describe 'rsyslog' do
@@ -83,14 +88,17 @@ class { 'rsyslog':
8388 # Ensure the rsyslog package was installed from the upstream rsyslog repo
8489 describe 'rsyslog package' do
8590 it 'is installed from upstream repo' do
86- case os [ 'name ' ]
87- when 'CentOS' , ' RedHat' , 'OracleLinux '
91+ case os [ 'family ' ]
92+ when 'RedHat'
8893 expect ( command ( 'dnf repoquery --installed --qf "%{from_repo}" rsyslog' ) . stdout . strip ) . to eq ( 'upstream_rsyslog' )
89- when 'Ubuntu'
90- # Least ugly way to check where a package was installed from
91- expect (
92- command ( 'python3 -c "import apt; print(apt.Cache()[\"rsyslog\"].installed.uri)"' ) . stdout ,
93- ) . to start_with ( 'https://ppa.launchpadcontent.net/adiscon/v8-stable/ubuntu' )
94+ else
95+ case os [ 'name' ]
96+ when 'Ubuntu'
97+ # Least ugly way to check where a package was installed from
98+ expect (
99+ command ( 'python3 -c "import apt; print(apt.Cache()[\"rsyslog\"].installed.uri)"' ) . stdout ,
100+ ) . to start_with ( 'https://ppa.launchpadcontent.net/adiscon/v8-stable/ubuntu' )
101+ end
94102 end
95103 end
96104 end
You can’t perform that action at this time.
0 commit comments