ansible/test/integration/targets/win_get_url/tasks/main.yml

76 lines
2.1 KiB
YAML
Raw Normal View History

# Due to the special environment setup required for proxies, you can manually test out the proxy options with
# https://github.com/jborean93/ansible-powershell-url-proxy.
---
- name: set fact out special testing dir
set_fact:
testing_dir: '{{ remote_tmp_dir }}\win_get_url .ÅÑŚÌβŁÈ [$!@^&test(;)]'
- name: create test directory with space and special chars
win_file:
path: '{{ testing_dir }}'
state: directory
- name: copy across testing files
win_copy:
src: files/
dest: '{{ testing_dir }}'
# False positive in Windows Defender is flagging the file as a virus and removing it. We need to add an exclusion so
# the tests continue to work
- name: add exclusion for the SlimFTPd binary
win_defender_exclusion:
path: '{{ remote_tmp_dir | win_dirname }}'
state: present
- name: download SlimFTPd binary
win_get_url:
url: https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_win_get_url/SlimFTPd.exe
dest: '{{ testing_dir }}\SlimFTPd.exe'
# SlimFTPd does not work with special chars because it is so old, use a symlink as a workaround
- name: set fact of temp symlink for SlimFTPd
set_fact:
slimftpd_link: C:\SlimFTPd
- name: template SlimFTPd configuration file
win_template:
src: slimftpd.conf.tmpl
dest: '{{ testing_dir }}\slimftpd.conf'
- block:
- name: create SLimFTPd symlink
win_command: cmd.exe /c mklink /d "{{ slimftpd_link }}" "{{ testing_dir }}"
- name: create SlimFTPd service
win_service:
name: SlimFTPd
path: '"{{ slimftpd_link }}\SlimFTPd.exe" -service'
state: started
dependencies:
- tcpip
- name: run URL tests
import_tasks: tests_url.yml
- name: run FTP tests
import_tasks: tests_ftp.yml
[win_get_url] feature: Add support `checksum` to module win_get_url (#51986) * set valid_until equal to current time + spot_wait_timeout * Add checksum check for downloaded file. * refactoring * fix typo * add fixes * mart try,catch handling * revert lib/ansible/modules/cloud/amazon/ec2.py from upstream * refactoring * remove empty lines * add checksum verification for existing file * fix current file check * refactoring destination file check * add handling exceptions * refactoring * Added download file hash data from url * fix string aligning * fix bug with uri * Added get hash from multy-string file * Added URI support for checksum file location * refactoing * Remove any non-alphanumeric characters for hash from url * fix discussions; add support for PS3 * refactoring * add size return value * checkout from upstream for lib/ansible/modules/cloud/amazon/ec2.py * add Ansible.ModuleUtils.Legacy support; refactoring * Copyright added * Checking files size before and after downloading added. * remove unused code * Corrected regexp for dotted slashed file name prefix in hash-file * hotfix typo error; add int tests * remove legacy module support; split checksum to checksum, checksum_algorithm, checksum_url * changed default hash algorithm * Fixed case for ContentLength = -1 * Old comment removed * fix typo * Remove file size check before downloading * add alias to ; fix tests * adjust tests; fix lint warnings from PSScritpAnalyzer * workaround for bug in win_chocolatey module on win2008 * remove win_get_url.ps1 from /test/sanity/pslint/ignore.txt * add checksum_algorithm as retuen value * first normalise before return Result * resolve discussions Signed-off-by: Viktor Utkin <viktor.utkin7@yandex.ru> * fix discussions fix http tests as discussed * fix last discussions * Reduce code duplication and add idempotency check * fix sanity issue and remove testing code * move back to using tmp file for checksum comparison
2019-03-05 11:37:00 +01:00
- name: run checksum tests
import_tasks: tests_checksum.yml
[win_get_url] feature: Add support `checksum` to module win_get_url (#51986) * set valid_until equal to current time + spot_wait_timeout * Add checksum check for downloaded file. * refactoring * fix typo * add fixes * mart try,catch handling * revert lib/ansible/modules/cloud/amazon/ec2.py from upstream * refactoring * remove empty lines * add checksum verification for existing file * fix current file check * refactoring destination file check * add handling exceptions * refactoring * Added download file hash data from url * fix string aligning * fix bug with uri * Added get hash from multy-string file * Added URI support for checksum file location * refactoing * Remove any non-alphanumeric characters for hash from url * fix discussions; add support for PS3 * refactoring * add size return value * checkout from upstream for lib/ansible/modules/cloud/amazon/ec2.py * add Ansible.ModuleUtils.Legacy support; refactoring * Copyright added * Checking files size before and after downloading added. * remove unused code * Corrected regexp for dotted slashed file name prefix in hash-file * hotfix typo error; add int tests * remove legacy module support; split checksum to checksum, checksum_algorithm, checksum_url * changed default hash algorithm * Fixed case for ContentLength = -1 * Old comment removed * fix typo * Remove file size check before downloading * add alias to ; fix tests * adjust tests; fix lint warnings from PSScritpAnalyzer * workaround for bug in win_chocolatey module on win2008 * remove win_get_url.ps1 from /test/sanity/pslint/ignore.txt * add checksum_algorithm as retuen value * first normalise before return Result * resolve discussions Signed-off-by: Viktor Utkin <viktor.utkin7@yandex.ru> * fix discussions fix http tests as discussed * fix last discussions * Reduce code duplication and add idempotency check * fix sanity issue and remove testing code * move back to using tmp file for checksum comparison
2019-03-05 11:37:00 +01:00
always:
- name: remove SlimFTPd service
win_service:
name: SlimFTPd
state: absent
- name: remove temp symlink
win_file:
path: '{{ slimftpd_link }}'
state: absent
- name: remove exclusion for the SlimFTPd binary
win_defender_exclusion:
path: '{{ remote_tmp_dir | win_dirname }}'
state: absent