File: reset.yml

package info (click to toggle)
python-mitogen 0.3.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,708 kB
  • sloc: python: 24,457; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (54 lines) | stat: -rw-r--r-- 1,310 bytes parent folder | download
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
52
53
54
# issue #369: Connection.reset() should cause destruction of the remote
# interpreter and any children.

---

- name: integration/connection/reset.yml
  hosts: test-targets
  tasks:
    - include_tasks: ../_mitogen_only.yml

    - debug: msg="reset.yml skipped on Ansible<2.5.6"
      when:
        - ansible_version_major_minor_patch is version('2.5.6', '<', strict=True)

    - meta: end_play
      when:
        - ansible_version_major_minor_patch is version('2.5.6', '<', strict=True)

    - custom_python_detect_environment:
      register: out

    - custom_python_detect_environment:
      become: true
      register: out_become

    - meta: reset_connection

    - custom_python_detect_environment:
      register: out2

    - custom_python_detect_environment:
      register: out_become2

    - assert:
        that:
        # Interpreter PID has changed.
        - out.pid != out2.pid

        # SSH PID has changed.
        - out.ppid != out2.ppid

        # Interpreter PID has changed.
        - out_become.pid != out_become2.pid

        # sudo PID has changed.
        - out_become.ppid != out_become2.ppid
        fail_msg: |
          out={{ out }}
          out2={{ out2 }}
          out_become={{ out_become }}
          out_become2={{ out_become2 }}
  tags:
    - mitogen_only
    - reset