summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/fetch/roles/fetch_tests/tasks/normal.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/fetch/roles/fetch_tests/tasks/normal.yml')
-rw-r--r--test/integration/targets/fetch/roles/fetch_tests/tasks/normal.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/integration/targets/fetch/roles/fetch_tests/tasks/normal.yml b/test/integration/targets/fetch/roles/fetch_tests/tasks/normal.yml
new file mode 100644
index 0000000..6f3ab62
--- /dev/null
+++ b/test/integration/targets/fetch/roles/fetch_tests/tasks/normal.yml
@@ -0,0 +1,38 @@
+- name: Fetch the test file
+ fetch: src={{ remote_tmp_dir }}/orig dest={{ output_dir }}/fetched
+ register: fetched
+
+- name: Fetch a second time to show no changes
+ fetch: src={{ remote_tmp_dir }}/orig dest={{ output_dir }}/fetched
+ register: fetched_again
+
+- name: Fetch the test file in check mode
+ fetch:
+ src: "{{ remote_tmp_dir }}/orig"
+ dest: "{{ output_dir }}/fetched"
+ check_mode: yes
+ register: fetch_check_mode
+
+- name: Fetch with dest ending in path sep
+ fetch:
+ src: "{{ remote_tmp_dir }}/orig"
+ dest: "{{ output_dir }}/"
+ flat: yes
+
+- name: Fetch with dest with relative path
+ fetch:
+ src: "{{ remote_tmp_dir }}/orig"
+ dest: "{{ output_dir[1:] }}"
+ flat: yes
+
+- name: Assert that we fetched correctly
+ assert:
+ that:
+ - fetched is changed
+ - fetched.checksum == "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ - fetched_again is not changed
+ - fetched_again.checksum == "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ - fetched.remote_checksum == "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
+ - lookup("file", output_dir + "/fetched/" + inventory_hostname + remote_tmp_dir + "/orig") == "test"
+ - fetch_check_mode is skipped
+ - fetch_check_mode.msg is search('not \(yet\) supported')