2018-05-21 16:04:43 +02:00
|
|
|
- name: Test pause
|
2019-01-26 04:37:56 +01:00
|
|
|
hosts: localhost
|
2018-05-21 16:04:43 +02:00
|
|
|
gather_facts: no
|
|
|
|
become: no
|
|
|
|
|
|
|
|
tasks:
|
2020-11-12 18:22:57 +01:00
|
|
|
- name: non-integer for duraction (EXPECTED FAILURE)
|
|
|
|
pause:
|
|
|
|
seconds: hello
|
|
|
|
register: result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result is failed
|
|
|
|
- "'non-integer' in result.msg"
|
|
|
|
|
|
|
|
- name: non-boolean for echo (EXPECTED FAILURE)
|
|
|
|
pause:
|
|
|
|
echo: hello
|
|
|
|
register: result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result is failed
|
|
|
|
- "'not a valid boolean' in result.msg"
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
seconds: 0.1
|
|
|
|
register: results
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- results.stdout is search('Paused for \d+\.\d+ seconds')
|
|
|
|
|
2018-05-21 16:04:43 +02:00
|
|
|
- pause:
|
|
|
|
seconds: 1
|
|
|
|
register: results
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- results.stdout is search('Paused for \d+\.\d+ seconds')
|
|
|
|
|
|
|
|
- pause:
|
|
|
|
minutes: 1
|
|
|
|
register: results
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- results.stdout is search('Paused for \d+\.\d+ minutes')
|