File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3
3
require 'spec_helper_acceptance'
4
4
5
5
describe 'systemd with manage_resolved true' do
6
+ has_package = ( fact ( 'os.family' ) == 'RedHat' && fact ( 'os.release.major' ) != '8' ) || ( fact ( 'os.name' ) == 'Debian' && fact ( 'os.release.major' ) . to_i >= 12 )
7
+
6
8
context 'configure systemd resolved' do
7
9
it 'works idempotently with no errors' do
8
10
pp = <<-PUPPET
13
15
PUPPET
14
16
apply_manifest ( pp , catch_failures : true )
15
17
# RedHat 7, 9, Debian 12 and newer installs package first run before fact $facts['internal_services'] is set
16
- if ( fact ( 'os.release.major' ) != '8' && ( fact ( 'os.family' ) == 'RedHat' ) ) ||
17
- ( ( fact ( 'os.name' ) == 'Debian' && fact ( 'os.release.major' ) . to_i >= 12 ) )
18
- apply_manifest ( pp , catch_failures : true )
19
- end
18
+ apply_manifest ( pp , catch_failures : true ) if has_package
20
19
apply_manifest ( pp , catch_changes : true )
21
20
end
22
21
23
22
describe service ( 'systemd-resolved' ) do
24
23
it { is_expected . to be_running }
25
24
it { is_expected . to be_enabled }
26
25
end
26
+
27
+ it { expect ( package ( 'systemd-resolved' ) ) . to be_installed } if has_package
27
28
end
28
29
29
30
context 'configure systemd stopped' do
You can’t perform that action at this time.
0 commit comments