-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Acceptance Test for systemd-resolved
- Loading branch information
1 parent
23d5f8f
commit 4160b6e
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
spec/acceptance/systemd_spec.rb → spec/acceptance/default_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'systemd' do | ||
context 'configure systemd resolved' do | ||
it 'works idempotently with no errors' do | ||
pp = <<-PUPPET | ||
class{'systemd': | ||
manage_resolved => true, | ||
manage_resolv_conf => #{default[:hypervisor] != 'docker'}, | ||
} | ||
PUPPET | ||
apply_manifest(pp, catch_failures: true) | ||
# RedHat 9 and newer installs package first run before fact $facts['internal_services'] is set | ||
apply_manifest(pp, catch_failures: true) if Gem::Version.new(fact('os.release.major')) >= Gem::Version.new('9') && (fact('os.family') == 'RedHat') | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
# RedHat 7 does not have systemd-resolved available at all. | ||
describe service('systemd-resolved'), unless: (fact('os.release.major') == '7' and fact('os.family') == 'RedHat') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
end | ||
end |