You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/integration/runner/environment_isolation.yml

42 lines
1.4 KiB
YAML

# 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