mirror of
https://github.com/saltstack-formulas/cron-formula.git
synced 2026-09-21 04:11:37 +02:00
test(saltcheck): add test for cron envs (absent & present)
This commit is contained in:
@@ -25,7 +25,7 @@ cron.{{ task }}:
|
||||
{%- endfor %}
|
||||
|
||||
{%- for env, env_options in cron.get('env', {}). items() %}
|
||||
{%- set env_type = env_options.type|d('present') %}
|
||||
{%- set env_type = env_options.type|d('present') %}
|
||||
|
||||
cron.{{ env }}:
|
||||
cron.env_{{ env_type }}:
|
||||
|
||||
@@ -45,3 +45,15 @@ validate_cron.{{ task }}_{{ section }}:
|
||||
{%- endif %}
|
||||
|
||||
{%- endfor %}
|
||||
|
||||
{%- for env, env_options in cron.get('env', {}). items() %}
|
||||
{%- set env_type = env_options.type|d('present') %}
|
||||
|
||||
validate_cron.{{ env }}_{{ env_type }}:
|
||||
module_and_function: cron.raw_cron
|
||||
args:
|
||||
- {{ env_options.user|d('root') }}
|
||||
assertion: {{ 'assertNotIn' if env_type == 'absent' else 'assertIn' }}
|
||||
expected-return: '{{ env_options.name }}={{ env_options.value }}'
|
||||
|
||||
{%- endfor %}
|
||||
|
||||
Reference in New Issue
Block a user