diff options
author | Edwin Hermans <edwin@madtech.cx> | 2020-08-17 12:21:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-17 12:21:15 -0400 |
commit | eb8b3a8479ec82ad622f86ac46f3e9cc083952b8 (patch) | |
tree | b5d7529af857c500d9855429a8a94b90264eda5a /test/integration/targets/get_url | |
parent | a1a50bb3cd0c2d6f2f4cb260a43553c23e806d8a (diff) | |
download | ansible-eb8b3a8479ec82ad622f86ac46f3e9cc083952b8.tar.gz |
get_url - Allow checksum file to be local file:// url (#71205)
This would be a partial solution for #69364 in that the SHASUMS file can be downloaded and gpg verified but then used from the downloaded location to verify the get_url's file.
* Make checksum url parsing more explicit
Use urlsplit to test if the checksum string has a (currently tested and) supported url scheme.
* Fix whitespace
* Changelog fragment
* Added tests
* Fix typo in test setup
Diffstat (limited to 'test/integration/targets/get_url')
-rw-r--r-- | test/integration/targets/get_url/tasks/main.yml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/integration/targets/get_url/tasks/main.yml b/test/integration/targets/get_url/tasks/main.yml index 052bde222a..6adb3db74c 100644 --- a/test/integration/targets/get_url/tasks/main.yml +++ b/test/integration/targets/get_url/tasks/main.yml @@ -407,15 +407,28 @@ path: "{{ remote_tmp_dir }}/27617sha256_with_dot.txt" register: stat_result_sha256_with_dot +- name: download src with sha256 checksum url with file scheme + get_url: + url: 'http://localhost:{{ http_port }}/27617.txt' + dest: '{{ remote_tmp_dir }}/27617sha256_with_file_scheme.txt' + checksum: 'sha256:file://{{ files_dir }}/sha256sum.txt' + register: result_sha256_with_file_scheme + +- stat: + path: "{{ remote_tmp_dir }}/27617sha256_with_dot.txt" + register: stat_result_sha256_with_file_scheme + - name: Assert that the file was downloaded assert: that: - result_sha1 is changed - result_sha256 is changed - result_sha256_with_dot is changed + - result_sha256_with_file_scheme is changed - "stat_result_sha1.stat.exists == true" - "stat_result_sha256.stat.exists == true" - "stat_result_sha256_with_dot.stat.exists == true" + - "stat_result_sha256_with_file_scheme.stat.exists == true" #https://github.com/ansible/ansible/issues/16191 - name: Test url split with no filename |