From 85adaa76f128b18db07c1385e23e93220dadcc5e Mon Sep 17 00:00:00 2001 From: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:53:24 -0400 Subject: [PATCH] Add integration test for copy with force=false when dest exists (#81756) ci_complete ci_coverage --- test/integration/targets/copy/tasks/tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/integration/targets/copy/tasks/tests.yml b/test/integration/targets/copy/tasks/tests.yml index b808ce4f8e8..c2b8482353c 100644 --- a/test/integration/targets/copy/tasks/tests.yml +++ b/test/integration/targets/copy/tasks/tests.yml @@ -92,6 +92,18 @@ - "stat_results.stat.issock == false" - "stat_results.stat.checksum == ('foo.txt\n'|hash('sha1'))" +- name: Test copying content with force=false when the dest already exists + copy: + content: other_data + dest: "{{ remote_file }}" + mode: 0444 + force: False + register: repeat_copy_result + +- name: Assert no changes are made + assert: + that: repeat_copy_result is not changed + - name: Overwrite the file via same means copy: src: foo.txt