-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from myii/test/add-helper-state-to-run-service-…
…in-containers test(service): add helper state to run service in containers
- Loading branch information
Showing
4 changed files
with
37 additions
and
16 deletions.
There are no files selected for viewing
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
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,29 @@ | ||
# This state is used to prepare environment for formula testing | ||
|
||
# In distros that have a systemd unit, make sure the service is | ||
# started even if running in a containerized environment | ||
|
||
{%- set sls_config_file = 'rng-tools.config.file' %} | ||
{%- set service_file = { | ||
'Fedora': '/usr/lib/systemd/system/rngd.service', | ||
'Gentoo': '/lib/systemd/system/rngd.service', | ||
'SUSE': '/usr/lib/systemd/system/rng-tools.service', | ||
}.get(grains.os, '') %} | ||
|
||
test-salt-states-custom-systemd-service-file-replace: | ||
file.replace: | ||
- name: {{ service_file }} | ||
- pattern: 'ConditionVirtualization=!container' | ||
- repl: '' | ||
- show_changes: True | ||
- require: | ||
- sls: {{ sls_config_file }} | ||
|
||
test-salt-states-custom-systemd-service-cmd-wait: | ||
cmd.wait: | ||
- name: systemctl daemon-reload | ||
- runas: root | ||
- watch: | ||
- file: test-salt-states-custom-systemd-service-file-replace | ||
- require_in: | ||
- service: rng-tools/service/running |