diff options
author | Matt Martz <matt@sivel.net> | 2020-07-17 23:34:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-17 23:34:24 +0200 |
commit | f90aa5599fd15743d90f261c88dbaaa21b0384d7 (patch) | |
tree | c9ed83ffce5fc06ec99c4b58c954c749d12f6562 /test/integration/targets/find | |
parent | Handle Slackware OS version strings containing a plus (“+”) (#68142) (diff) | |
download | ansible-f90aa5599fd15743d90f261c88dbaaa21b0384d7.tar.xz ansible-f90aa5599fd15743d90f261c88dbaaa21b0384d7.zip |
Don't treat empty excludes as a match. Fixes #70640 (#70710)
Diffstat (limited to 'test/integration/targets/find')
-rw-r--r-- | test/integration/targets/find/tasks/main.yml | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/test/integration/targets/find/tasks/main.yml b/test/integration/targets/find/tasks/main.yml index 7fd61dd247..456f4bc680 100644 --- a/test/integration/targets/find/tasks/main.yml +++ b/test/integration/targets/find/tasks/main.yml @@ -19,10 +19,14 @@ - set_fact: output_dir_test={{output_dir}}/test_find - name: make sure our testing sub-directory does not exist - file: path="{{ output_dir_test }}" state=absent + file: + path: "{{ output_dir_test }}" + state: absent - name: create our testing sub-directory - file: path="{{ output_dir_test }}" state=directory + file: + path: "{{ output_dir_test }}" + state: directory ## ## find @@ -95,3 +99,18 @@ - 'find_test2.matched == 1' - 'find_test2.files[0].pw_name is defined' - 'find_test2.files[0].gr_name is defined' + +- name: find the xml file with empty excludes + find: + paths: "{{ output_dir_test }}" + patterns: "*.xml" + recurse: yes + excludes: [] + register: find_test3 +- debug: var=find_test3 +- name: validate gr_name and pw_name are defined + assert: + that: + - 'find_test3.matched == 1' + - 'find_test3.files[0].pw_name is defined' + - 'find_test3.files[0].gr_name is defined' |