summaryrefslogtreecommitdiff
path: root/test/integration/targets/file
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2017-03-06 18:29:20 +0200
committerBrian Coca <bcoca@users.noreply.github.com>2017-03-06 11:29:20 -0500
commit15c7288ab9d943e90dda40ea20920674799d052b (patch)
tree26327dd6dec351e13caf014853d7b2141a660da0 /test/integration/targets/file
parent228131d1cdc449ddd91e5d6d174d1b463deddc5c (diff)
downloadansible-15c7288ab9d943e90dda40ea20920674799d052b.tar.gz
Show diff when file: state=link changes the symlink target (#22243)
* Show diff when file: state=link changes the symlink target * Integration test for symlink target change * Also check soft link idempotency
Diffstat (limited to 'test/integration/targets/file')
-rw-r--r--test/integration/targets/file/tasks/main.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/targets/file/tasks/main.yml b/test/integration/targets/file/tasks/main.yml
index 91d6f8ed0d..14f99fdd11 100644
--- a/test/integration/targets/file/tasks/main.yml
+++ b/test/integration/targets/file/tasks/main.yml
@@ -97,6 +97,26 @@
that:
- "file5_result.changed == true"
+- name: change soft link to relative
+ file: src={{output_file|basename}} dest={{output_dir}}/soft.txt state=link
+ register: file5a_result
+
+- name: verify that the file was marked as changed
+ assert:
+ that:
+ - "file5a_result.changed == true"
+ - "file5a_result.diff.before.src == output_file|expanduser"
+ - "file5a_result.diff.after.src == output_file|basename"
+
+- name: soft link idempotency check
+ file: src={{output_file|basename}} dest={{output_dir}}/soft.txt state=link
+ register: file5b_result
+
+- name: verify that the file was not marked as changed
+ assert:
+ that:
+ - "file5b_result.changed == false"
+
- name: create hard link to file
file: src={{output_file}} dest={{output_dir}}/hard.txt state=hard
register: file6_result