summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlexei Znamensky <103110+russoz@users.noreply.github.com>2024-07-22 16:10:49 +0200
committerGitHub <noreply@github.com>2024-07-22 16:10:49 +0200
commitd36dc70afca66fc6724a6582e58d61e926855007 (patch)
tree043a1a88b06910297180e5e4c95fa4924f0560d0 /test
parentdocs adjustments (batch 1) (#83341) (diff)
downloadansible-d36dc70afca66fc6724a6582e58d61e926855007.tar.xz
ansible-d36dc70afca66fc6724a6582e58d61e926855007.zip
remove ignore clauses for module find (#83575)
add testcase for expanding home dir names
Diffstat (limited to 'test')
-rw-r--r--test/integration/targets/find/tasks/main.yml30
-rw-r--r--test/sanity/ignore.txt1
2 files changed, 29 insertions, 2 deletions
diff --git a/test/integration/targets/find/tasks/main.yml b/test/integration/targets/find/tasks/main.yml
index 4abb71175d..afc55fbaf0 100644
--- a/test/integration/targets/find/tasks/main.yml
+++ b/test/integration/targets/find/tasks/main.yml
@@ -210,7 +210,7 @@
that:
- fail_to_read_wrong_encoding_file.msg == 'Not all paths examined, check warnings for details'
- >-
- fail_to_read_wrong_encoding_file.skipped_paths[remote_tmp_dir_test] ==
+ fail_to_read_wrong_encoding_file.skipped_paths[remote_tmp_dir_test] ==
("Failed to read the file %s/hello_world.gbk due to an encoding error. current encoding: utf-8" % (remote_tmp_dir_test))
- name: read a gbk file by gbk
@@ -479,3 +479,31 @@
- name: Run mode tests
import_tasks: mode.yml
+
+- name: User block
+ become: true
+ become_user: "{{ test_user_name }}"
+ block:
+ - name: Create file in home dir
+ copy:
+ content: ""
+ dest: ~/wharevs.txt
+ mode: '0644'
+
+ - name: Find file in home dir with ~/
+ find:
+ paths: ~/
+ patterns: 'whar*'
+ register: homedir_search
+
+ - set_fact:
+ astest_list: "{{ homedir_search.files | map(attribute='path') }}"
+
+ - name: Check if found
+ assert:
+ that:
+ - homedir_search is success
+ - homedir_search.matched == 1
+ - '"{{ homedir }}/wharevs.txt" in astest_list'
+ vars:
+ homedir: "{{ test_user.home }}"
diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt
index d5455c97ab..40563c3e21 100644
--- a/test/sanity/ignore.txt
+++ b/test/sanity/ignore.txt
@@ -19,7 +19,6 @@ lib/ansible/modules/copy.py validate-modules:undocumented-parameter
lib/ansible/modules/dnf.py validate-modules:parameter-invalid
lib/ansible/modules/dnf5.py validate-modules:parameter-invalid
lib/ansible/modules/file.py validate-modules:undocumented-parameter
-lib/ansible/modules/find.py use-argspec-type-path # fix needed
lib/ansible/modules/git.py use-argspec-type-path
lib/ansible/modules/git.py validate-modules:doc-required-mismatch
lib/ansible/modules/package_facts.py validate-modules:doc-choices-do-not-match-spec