mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 00:19:48 +01:00
Fix remote_tmp tests so that they actually use the remote_tmp (#80969)
* Fix remote_tmp tests so that they actually use the remote_tmp * Isolate remote_tmp dir during remote_tmp tests. Fixes #80965 * Do everything without become
This commit is contained in:
parent
742d47fa15
commit
ef3b806dd3
|
|
@ -30,10 +30,22 @@
|
|||
- name: Test tempdir is removed
|
||||
hosts: testhost
|
||||
gather_facts: false
|
||||
vars:
|
||||
# These tests cannot be run with pipelining as it defeats the purpose of
|
||||
# ensuring remote_tmp is cleaned up. Pipelining is enabled in the test
|
||||
# inventory
|
||||
ansible_pipelining: false
|
||||
# Ensure that the remote_tmp_dir we create allows the unpriv connection user
|
||||
# to create the remote_tmp
|
||||
ansible_become: false
|
||||
tasks:
|
||||
- import_role:
|
||||
name: ../setup_remote_tmp_dir
|
||||
|
||||
- vars:
|
||||
# Isolate the remote_tmp used by these tests
|
||||
ansible_remote_tmp: "{{ remote_tmp_dir }}/remote_tmp"
|
||||
block:
|
||||
- file:
|
||||
state: touch
|
||||
path: "{{ remote_tmp_dir }}/65393"
|
||||
|
|
@ -44,7 +56,7 @@
|
|||
remote_src: true
|
||||
|
||||
- find:
|
||||
path: "~/.ansible/tmp"
|
||||
path: "{{ ansible_remote_tmp }}"
|
||||
use_regex: yes
|
||||
patterns: 'AnsiballZ_.+\.py'
|
||||
recurse: true
|
||||
|
|
@ -55,5 +67,6 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
# Should find nothing since pipelining is used
|
||||
- result.files|length == 0
|
||||
# Should only be AnsiballZ_find.py because find is actively running
|
||||
- result.files|length == 1
|
||||
- result.files[0].path.endswith('/AnsiballZ_find.py')
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user