-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PUP-3927) Ensure Fedora uses the systemd service provider
Recent changes to the redhat (chkconfig) service provider requires features that the chkconfig shim doesn't support (specifically, --add). Besides, the systemd provider should be the default for Fedora anyway.
- Loading branch information
1 parent
4dc939c
commit 1b8737d
Showing
3 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
acceptance/tests/resource/service/ticket_3927_redhat_systemd_vs_service_provider.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
test_name 'RedHat Service vs. Systemd Provider Validation' | ||
|
||
# A simple acceptance test to ensure basic usage of the service | ||
# provider works for a mix of sysV and systemd RedHat Linux platforms | ||
confine :to, :platform => /el|centos|fedora/ | ||
|
||
manifest_install_httpd = %Q{ | ||
package { 'httpd': | ||
ensure => present, | ||
} | ||
} | ||
|
||
manifest_httpd_enabled = %Q{ | ||
service { 'httpd': | ||
enable => true, | ||
} | ||
} | ||
|
||
manifest_httpd_disabled = %Q{ | ||
service { 'httpd': | ||
enable => false, | ||
} | ||
} | ||
|
||
agents.each do |agent| | ||
distro = on(agent, facter('operatingsystem')).stdout.chomp | ||
if distro == 'fedora' | ||
majrelease = on(agent, facter('operatingsystemmajrelease')).stdout.chomp.to_i | ||
if majrelease < 17 | ||
skip_test "Test not applicable to Fedora #{majrelease}" | ||
elsif majrelease > 21 | ||
# This is a reminder so we update the provider's defaultfor when new | ||
# versions of Fedora are released (then update this test) | ||
fail_test "Provider needs manual update to support Fedora #{majrelease}" | ||
end | ||
end | ||
|
||
step "installing httpd" | ||
apply_manifest_on(agent, manifest_install_httpd, :catch_failures => true) | ||
|
||
step "enabling httpd" | ||
apply_manifest_on(agent, manifest_httpd_enabled, :catch_failures => true) | ||
|
||
step "disabling httpd" | ||
apply_manifest_on(agent, manifest_httpd_disabled, :catch_failures => true) | ||
end |
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