Symink integration tests for fetch and stat

This commit is contained in:
Toshio Kuratomi
2016-09-05 19:40:50 -07:00
parent d56b0aa813
commit d6ebf9bdc6
2 changed files with 158 additions and 31 deletions

View File

@@ -69,3 +69,29 @@
that:
- "not fetch_dir|changed"
- "fetch_dir.msg"
- name: create symlink to a file that we can fetch
file:
path: "{{ output_dir }}/link"
src: "{{ output_dir }}/orig"
state: "link"
- name: fetch the file via a symlink
fetch: src={{ output_dir }}/link dest={{ output_dir }}/fetched-link
register: fetched
- debug: var=fetched
# TODO: check the sudo and non-sudo forms of fetch because in one form we'll do
# the get method of the connection plugin and in the sudo case we'll use the
# fetch module.
- name: diff what we fetched with the original file
shell: diff {{ output_dir }}/orig {{ output_dir }}/fetched-link/{{inventory_hostname}}{{ output_dir | expanduser }}/link
register: diff
- name: check the diff to make sure they are the same
assert:
that:
'diff.stdout == ""'