summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/win_async_wrapper
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2018-09-20 11:37:54 +0200
committerGitHub <noreply@github.com>2018-09-20 11:37:54 +0200
commit5c73d4f4bd4c067cd4d1d9f1adfe16090ece4b04 (patch)
tree339eb6d6b39e6bb33b76d83c60438efb9f6a7a99 /test/integration/targets/win_async_wrapper
parentFixing azure_rm_containerregistry_facts (#45897) (diff)
downloadansible-5c73d4f4bd4c067cd4d1d9f1adfe16090ece4b04.tar.xz
ansible-5c73d4f4bd4c067cd4d1d9f1adfe16090ece4b04.zip
async: use async_dir for the async results file directory (#45461)
* win async: use async_dir for the async results file directory * tried to unify POSIX and PowerShell async implementations of async_dir * fix sanity issue
Diffstat (limited to 'test/integration/targets/win_async_wrapper')
-rw-r--r--test/integration/targets/win_async_wrapper/tasks/main.yml37
1 files changed, 33 insertions, 4 deletions
diff --git a/test/integration/targets/win_async_wrapper/tasks/main.yml b/test/integration/targets/win_async_wrapper/tasks/main.yml
index 20cca10b43..756e3ee780 100644
--- a/test/integration/targets/win_async_wrapper/tasks/main.yml
+++ b/test/integration/targets/win_async_wrapper/tasks/main.yml
@@ -166,17 +166,46 @@
- nonascii_output.stdout_lines[0] == 'über den Fußgängerübergang gehen'
- nonascii_output.stderr == ''
-- name: test async with custom remote_tmp
+- name: test async with custom async dir
win_shell: echo hi
- register: async_custom_tmp
+ register: async_custom_dir
async: 5
vars:
- ansible_remote_tmp: '{{win_output_dir}}'
+ ansible_async_dir: '{{win_output_dir}}'
- name: assert results file is in the remote tmp specified
assert:
that:
- - async_custom_tmp.results_file == win_output_dir + '\\.ansible_async\\' + async_custom_tmp.ansible_job_id
+ - async_custom_dir.results_file == win_output_dir + '\\' + async_custom_dir.ansible_job_id
+
+- name: test async fire and forget with custom async dir
+ win_shell: echo hi
+ register: async_custom_dir_poll
+ async: 5
+ poll: 0
+ vars:
+ ansible_async_dir: '{{win_output_dir}}'
+
+- name: poll with different dir - fail
+ async_status:
+ jid: '{{ async_custom_dir_poll.ansible_job_id }}'
+ register: fail_async_custom_dir_poll
+ ignore_errors: yes
+
+- name: poll with different dir - success
+ async_status:
+ jid: '{{ async_custom_dir_poll.ansible_job_id }}'
+ register: success_async_custom_dir_poll
+ vars:
+ ansible_async_dir: '{{win_output_dir}}'
+
+- name: assert test async fire and forget with custom async dir
+ assert:
+ that:
+ - fail_async_custom_dir_poll.failed
+ - '"could not find job at ''" + nonascii_output.results_file|win_dirname + "''" in fail_async_custom_dir_poll.msg'
+ - not success_async_custom_dir_poll.failed
+ - success_async_custom_dir_poll.results_file == win_output_dir + '\\' + async_custom_dir_poll.ansible_job_id
# FUTURE: figure out why the last iteration of this test often fails on shippable
#- name: loop async success