summaryrefslogtreecommitdiff
path: root/test/integration/targets/pause/test-pause.yml
blob: 6fefbaa1f0a88b659294a6b566a4b9e6dccc99a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
- 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
          - "'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')

    - 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')