From a8e8737436ee8ceb4e8389df8cf5077d4799dac4 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Sat, 12 Mar 2022 20:57:08 +0900 Subject: [PATCH] Check output_dir path Signed-off-by: Hideki Saito --- .../targets/synchronize/tasks/main.yml | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/tests/integration/targets/synchronize/tasks/main.yml b/tests/integration/targets/synchronize/tasks/main.yml index 3a5e046..3abc93e 100644 --- a/tests/integration/targets/synchronize/tasks/main.yml +++ b/tests/integration/targets/synchronize/tasks/main.yml @@ -23,31 +23,42 @@ debug: msg: "{{ ansible_distribution }}" -- name: synchronize file to new filename - synchronize: - src: '{{output_dir}}/foo.txt' - dest: '{{output_dir}}/foo.result' - register: sync_result - #delegate_to: '{{ inventory_hostname }}' -- assert: - that: - - '''changed'' in sync_result' - - sync_result.changed == true - - '''cmd'' in sync_result' - - '''rsync'' in sync_result.cmd' - - '''msg'' in sync_result' - - sync_result.msg.startswith('>f+') - - 'sync_result.msg.endswith(''+ foo.txt +- name: Check '{{ output_dir }}' value + debug: + msg: "{{ output_dir }}" - '')' - name: test that the file was really copied over stat: - path: '{{ output_dir }}/foo.result' - register: stat_result -- assert: - that: - - stat_result.stat.exists == True - - stat_result.stat.checksum == '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed' + path: '{{output_dir}}/{{item}}' + with_items: + - foo.txt + - bar.txt + +#- name: synchronize file to new filename +# synchronize: +# src: '{{output_dir}}/foo.txt' +# dest: '{{output_dir}}/foo.result' +# register: sync_result +# delegate_to: '{{ inventory_hostname }}' +#- assert: +# that: +# - '''changed'' in sync_result' +# - sync_result.changed == true +# - '''cmd'' in sync_result' +# - '''rsync'' in sync_result.cmd' +# - '''msg'' in sync_result' +# - sync_result.msg.startswith('>f+') +# - 'sync_result.msg.endswith(''+ foo.txt +# +# '')' +#- name: test that the file was really copied over +# stat: +# path: '{{ output_dir }}/foo.result' +# register: stat_result +#- assert: +# that: +# - stat_result.stat.exists == True +# - stat_result.stat.checksum == '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed' #- name: test that the file is not copied a second time # synchronize: