issue #477: add Connection.homedir test.

issue510
David Wilson 6 years ago
parent 2b234936b8
commit 5e4066bb64

@ -3,6 +3,7 @@
- include: disconnect_during_module.yml
- include: disconnect_resets_connection.yml
- include: exec_command.yml
- include: home_dir.yml
- include: put_large_file.yml
- include: put_small_file.yml
- include: reset.yml

@ -0,0 +1,39 @@
# Verify the value of the Connection.homedir attribute is as expected.
- name: integration/connection/home_dir.yml
hosts: test-targets
any_errors_fatal: true
tasks:
- name: "Find out root's homedir."
# Runs first because it blats regular Ansible facts with junk, so
# non-become run fixes that up.
setup:
become: true
register: root_facts
when: is_mitogen
- name: "Find regular homedir"
setup:
register: user_facts
when: is_mitogen
- name: "Verify Connection.homedir correct when become:false"
mitogen_action_script:
script: |
self._connection._connect()
assert self._connection.homedir == "{{user_facts.ansible_facts.ansible_user_dir}}", {
"connection homedir": self._connection.homedir,
"homedir from facts": "{{user_facts.ansible_facts.ansible_user_dir}}"
}
when: is_mitogen
- name: "Verify Connection.homedir correct when become:true"
become: true
mitogen_action_script:
script: |
self._connection._connect()
assert self._connection.homedir == "{{root_facts.ansible_facts.ansible_user_dir}}", {
"connection homedir": self._connection.homedir,
"homedir from facts": "{{root_facts.ansible_facts.ansible_user_dir}}"
}
when: is_mitogen
Loading…
Cancel
Save