mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fix test_issue_30161_unless_and_onlyif_together for MacOSX
This commit is contained in:
parent
01708258ba
commit
4002a7c317
@ -1,44 +1,35 @@
|
|||||||
|
{% if grains['os'] == 'Windows' %}
|
||||||
|
{% set test_false = 'cmd.exe /c exit 1' %}
|
||||||
|
{% set test_true = 'cmd.exe /c exit 0' %}
|
||||||
|
{% elif grains['os'] == 'MacOS' %}
|
||||||
|
{% set test_false = '/usr/bin/false' %}
|
||||||
|
{% set test_true = '/usr/bin/true' %}
|
||||||
|
{% else %}
|
||||||
|
{% set test_false = '/bin/false' %}
|
||||||
|
{% set test_true = '/bin/true' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
unless_false_onlyif_true:
|
unless_false_onlyif_true:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
||||||
{% if grains['os'] == 'Windows' %}
|
- unless: {{ test_false }}
|
||||||
- unless: cmd.exe /c exit 1
|
- onlyif: {{ test_true }}
|
||||||
- onlyif: cmd.exe /c exit 0
|
|
||||||
{% else %}
|
|
||||||
- unless: /bin/false
|
|
||||||
- onlyif: /bin/true
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
unless_true_onlyif_false:
|
unless_true_onlyif_false:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
||||||
{% if grains['os'] == 'Windows' %}
|
- unless: {{ test_true }}
|
||||||
- unless: cmd.exe /c exit 0
|
- onlyif: {{ test_false }}
|
||||||
- onlyif: cmd.exe /c exit 1
|
|
||||||
{% else %}
|
|
||||||
- unless: /bin/true
|
|
||||||
- onlyif: /bin/false
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
unless_true_onlyif_true:
|
unless_true_onlyif_true:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
||||||
{% if grains['os'] == 'Windows' %}
|
- unless: {{ test_true }}
|
||||||
- unless: cmd.exe /c exit 0
|
- onlyif: {{ test_true }}
|
||||||
- onlyif: cmd.exe /c exit 0
|
|
||||||
{% else %}
|
|
||||||
- unless: /bin/true
|
|
||||||
- onlyif: /bin/true
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
unless_false_onlyif_false:
|
unless_false_onlyif_false:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
- name: {{ salt['runtests_helpers.get_salt_temp_dir_for_path']('test.txt') }}
|
||||||
- contents: test
|
- contents: test
|
||||||
{% if grains['os'] == 'Windows' %}
|
- unless: {{ test_false }}
|
||||||
- unless: cmd.exe /c exit 1
|
- onlyif: {{ test_false }}
|
||||||
- onlyif: cmd.exe /c exit 1
|
|
||||||
{% else %}
|
|
||||||
- unless: /bin/false
|
|
||||||
- onlyif: /bin/false
|
|
||||||
{% endif %}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user