Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
1aa2191f
Commit
1aa2191f
authored
Jul 10, 2015
by
Chris Church
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests for win_get_url module to test force parameter and invalid URLs/paths.
parent
7c73e9c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
7 deletions
+76
-7
test/integration/roles/test_win_get_url/defaults/main.yml
+7
-0
test/integration/roles/test_win_get_url/tasks/main.yml
+69
-7
No files found.
test/integration/roles/test_win_get_url/defaults/main.yml
0 → 100644
View file @
1aa2191f
---
test_win_get_url_link
:
http://docs.ansible.com
test_win_get_url_path
:
"
C:
\\
Users
\\
{{ansible_ssh_user}}
\\
docs_index.html"
test_win_get_url_invalid_link
:
http://docs.ansible.com/skynet_module.html
test_win_get_url_invalid_path
:
"
Q:
\\
Filez
\\
Cyberdyne.html"
test_win_get_url_dir_path
:
"
C:
\\
Users
\\
{{ansible_ssh_user}}"
test/integration/roles/test_win_get_url/tasks/main.yml
View file @
1aa2191f
...
...
@@ -17,19 +17,81 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
-
name
:
remove test file if it exists
raw
:
PowerShell -Command {Remove-Item "C:\Users\Administrator\win_get_url.jpg" -Force}
raw
:
>
PowerShell -Command Remove-Item "{{test_win_get_url_path}}" -Force
ignore_errors
:
true
-
name
:
test win_get_url module
win_get_url
:
url=http://placehold.it/10x10.jpg dest='C:\Users\Administrator\win_get_url.jpg'
win_get_url
:
url
:
"
{{test_win_get_url_link}}"
dest
:
"
{{test_win_get_url_path}}"
register
:
win_get_url_result
-
name
:
check
win_get_url result
-
name
:
check
that url was downloaded
assert
:
that
:
-
"
not
win_get_url_result|failed"
-
"
win_get_url_result|changed"
-
"
win_get_url_result.win_get_url.url"
-
"
win_get_url_result.win_get_url.dest"
# FIXME:
# - Test invalid url
# - Test invalid dest, when dest is directory
# - Test idempotence when downloading same url/dest (not yet implemented)
-
name
:
test win_get_url module again (force should be yes by default)
win_get_url
:
url
:
"
{{test_win_get_url_link}}"
dest
:
"
{{test_win_get_url_path}}"
register
:
win_get_url_result_again
-
name
:
check that url was downloaded again
assert
:
that
:
-
"
not
win_get_url_result_again|failed"
-
"
win_get_url_result_again|changed"
-
name
:
test win_get_url module again with force=no
win_get_url
:
url
:
"
{{test_win_get_url_link}}"
dest
:
"
{{test_win_get_url_path}}"
force
:
no
register
:
win_get_url_result_noforce
-
name
:
check that url was not downloaded again
assert
:
that
:
-
"
not
win_get_url_result_noforce|failed"
-
"
not
win_get_url_result_noforce|changed"
-
name
:
test win_get_url module with url that returns a 404
win_get_url
:
url
:
"
{{test_win_get_url_invalid_link}}"
dest
:
"
{{test_win_get_url_path}}"
register
:
win_get_url_result_invalid_link
ignore_errors
:
true
-
name
:
check that the download failed for an invalid url
assert
:
that
:
-
"
win_get_url_result_invalid_link|failed"
-
name
:
test win_get_url module with an invalid path
win_get_url
:
url
:
"
{{test_win_get_url_link}}"
dest
:
"
{{test_win_get_url_invalid_path}}"
register
:
win_get_url_result_invalid_path
ignore_errors
:
true
-
name
:
check that the download failed for an invalid path
assert
:
that
:
-
"
win_get_url_result_invalid_path|failed"
-
name
:
test win_get_url module with a valid path that is a directory
win_get_url
:
url
:
"
{{test_win_get_url_link}}"
dest
:
"
{{test_win_get_url_dir_path}}"
register
:
win_get_url_result_dir_path
ignore_errors
:
true
-
name
:
check that the download failed if dest is a directory
assert
:
that
:
-
"
win_get_url_result_dir_path|failed"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment