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
43236ca0
Commit
43236ca0
authored
Jun 19, 2014
by
Chris Church
Committed by
Matt Martz
Jun 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic tests for win_get_url and win_msi modules.
parent
618b47cd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
1 deletions
+79
-1
examples/scripts/upgrade_to_ps3.ps1
+1
-1
test/integration/roles/test_win_get_url/tasks/main.yml
+35
-0
test/integration/roles/test_win_msi/tasks/main.yml
+41
-0
test/integration/test_winrm.yml
+2
-0
No files found.
examples/scripts/upgrade_to_ps3.ps1
View file @
43236ca0
...
...
@@ -79,4 +79,4 @@ else
$FileName
=
$DownLoadUrl
.Split
(
'/'
)[
-1]
download-file
$downloadurl
"
$powershellpath
\
$filename
"
Start-Process
-FilePath
$powershellpath
\
$filename
-WindowStyle Hidden
-Wait
Start-Process
-FilePath
$powershellpath
\
$filename
-WindowStyle Hidden
test/integration/roles/test_win_get_url/tasks/main.yml
0 → 100644
View file @
43236ca0
# test code for the win_get_url module
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# 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}
-
name
:
test win_get_url module
win_get_url
:
url=http://placehold.it/10x10.jpg dest='C:\Users\Administrator\win_get_url.jpg'
register
:
win_get_url_result
-
name
:
check win_get_url result
assert
:
that
:
-
"
not
win_get_url_result|failed"
-
"
win_get_url_result|changed"
# FIXME:
# - Test invalid url
# - Test invalid dest, when dest is directory
# - Test idempotence when downloading same url/dest (not yet implemented)
test/integration/roles/test_win_msi/tasks/main.yml
0 → 100644
View file @
43236ca0
# test code for the win_msi module
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
-
name
:
use win_get_url module to download msi
win_get_url
:
url=http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.22/7z922-x64.msi dest='C:\7z922-x64.msi'
register
:
win_get_url_result
-
name
:
install 7zip msi
win_msi
:
path="{{ win_get_url_result.win_get_url.dest }}"
register
:
win_msi_install_result
-
name
:
check win_msi install result
assert
:
that
:
-
"
not
win_msi_install_result|failed"
-
"
win_msi_install_result|changed"
-
name
:
uninstall 7zip msi
win_msi
:
path="{{ win_get_url_result.win_get_url.dest }}" state=absent
register
:
win_msi_uninstall_result
-
name
:
check win_msi uninstall result
assert
:
that
:
-
"
not
win_msi_uninstall_result|failed"
-
"
win_msi_uninstall_result|changed"
test/integration/test_winrm.yml
View file @
43236ca0
...
...
@@ -10,3 +10,5 @@
-
{
role
:
test_win_slurp
,
tags
:
test_win_slurp
}
-
{
role
:
test_win_fetch
,
tags
:
test_win_fetch
}
-
{
role
:
test_win_stat
,
tags
:
test_win_stat
}
-
{
role
:
test_win_get_url
,
tags
:
test_win_get_url
}
-
{
role
:
test_win_msi
,
tags
:
test_win_msi
}
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