diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/pause/test-pause.yml | |
parent | Initial commit. (diff) | |
download | ansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz ansible-core-8a754e0858d922e955e71b253c139e071ecec432.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/pause/test-pause.yml')
-rw-r--r-- | test/integration/targets/pause/test-pause.yml | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/test/integration/targets/pause/test-pause.yml b/test/integration/targets/pause/test-pause.yml new file mode 100644 index 0000000..1c8045b --- /dev/null +++ b/test/integration/targets/pause/test-pause.yml @@ -0,0 +1,72 @@ +- name: Test pause + hosts: localhost + gather_facts: no + become: no + + tasks: + - name: non-integer for duraction (EXPECTED FAILURE) + pause: + seconds: hello + register: result + ignore_errors: yes + + - assert: + that: + - result is failed + - "'unable to convert to int' 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" + + - name: Less than 1 + pause: + seconds: 0.1 + register: results + + - assert: + that: + - results.stdout is search('Paused for \d+\.\d+ seconds') + + - name: 1 second + pause: + seconds: 1 + register: results + + - assert: + that: + - results.stdout is search('Paused for \d+\.\d+ seconds') + + - name: 1 minute + pause: + minutes: 1 + register: results + + - assert: + that: + - results.stdout is search('Paused for \d+\.\d+ minutes') + + - name: minutes and seconds + pause: + minutes: 1 + seconds: 1 + register: exclusive + ignore_errors: yes + + - name: invalid arg + pause: + foo: bar + register: invalid + ignore_errors: yes + + - assert: + that: + - '"parameters are mutually exclusive: minutes|seconds" in exclusive.msg' + - '"Unsupported parameters for (pause) module: foo." in invalid.msg' |