File: environment_isolation.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 (45 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download | duplicates (2)
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
# issue #309: ensure process environment is restored after a module runs.

- name: integration/runner/environment_isolation.yml
  hosts: test-targets
  gather_facts: true
  tasks:
    - name: Verify custom env setting is cleared, control
      custom_python_detect_environment:
      register: out
    - assert:
        that: not out.env.evil_key is defined
        fail_msg: |
          out={{ out }}
    - name: Verify custom env setting is cleared, with evil_key
      shell: echo 'hi'
      environment:
        evil_key: evil
    - name: Verify custom env setting is cleared, without evil_key
      custom_python_detect_environment:
      register: out
    - assert:
        that: not out.env.evil_key is defined
        fail_msg: |
          out={{ out }}

    - name: Verify non-explicit module env mutations are cleared, control
      custom_python_detect_environment:
      register: out
    - assert:
        that: not out.env.evil_key is defined
        fail_msg: |
          out={{ out }}
    - name: Verify non-explicit module env mutations are cleared, mutate evil_key
      custom_python_modify_environ:
        key: evil_key
        val: evil
    - name: Verify non-explicit module env mutations are cleared, without evil_key
      custom_python_detect_environment:
      register: out
    - assert:
        that: not out.env.evil_key is defined
        fail_msg: |
          out={{ out }}
  tags:
    - environment_isolation