File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 33require 'spec_helper_acceptance'
44
55describe '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+
68 context 'configure systemd resolved' do
79 it 'works idempotently with no errors' do
810 pp = <<-PUPPET
1315 PUPPET
1416 apply_manifest ( pp , catch_failures : true )
1517 # 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
2019 apply_manifest ( pp , catch_changes : true )
2120 end
2221
2322 describe service ( 'systemd-resolved' ) do
2423 it { is_expected . to be_running }
2524 it { is_expected . to be_enabled }
2625 end
26+
27+ it { expect ( package ( 'systemd-resolved' ) ) . to be_installed } if has_package
2728 end
2829
2930 context 'configure systemd stopped' do
You can’t perform that action at this time.
0 commit comments