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
997ea78b
Commit
997ea78b
authored
Sep 30, 2014
by
Chris Church
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add integration tests for the win_feature module.
parent
c6bfd05c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
0 deletions
+136
-0
test/integration/roles/test_win_feature/defaults/main.yml
+4
-0
test/integration/roles/test_win_feature/tasks/main.yml
+131
-0
test/integration/test_winrm.yml
+1
-0
No files found.
test/integration/roles/test_win_feature/defaults/main.yml
0 → 100644
View file @
997ea78b
---
# Feature not normally installed by default.
test_win_feature_name
:
Telnet-Client
test/integration/roles/test_win_feature/tasks/main.yml
0 → 100644
View file @
997ea78b
# test code for the win_feature 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
:
start with feature absent
win_feature
:
name
:
"
{{
test_win_feature_name
}}"
state
:
absent
-
name
:
install feature
win_feature
:
name
:
"
{{
test_win_feature_name
}}"
state
:
present
restart
:
no
include_sub_features
:
yes
include_management_tools
:
yes
register
:
win_feature_install_result
-
name
:
check result of installing feature
assert
:
that
:
-
"
win_feature_install_result|changed"
-
"
win_feature_install_result.success"
-
"
win_feature_install_result.exitcode
==
'Success'"
-
"
not
win_feature_install_result.restart_needed"
-
"
win_feature_install_result.feature_result|length
==
1"
-
"
win_feature_install_result.feature_result[0].id"
-
"
win_feature_install_result.feature_result[0].display_name"
-
"
win_feature_install_result.feature_result[0].message
is
defined"
-
"
win_feature_install_result.feature_result[0].restart_needed
is
defined"
-
"
win_feature_install_result.feature_result[0].skip_reason"
-
"
win_feature_install_result.feature_result[0].success
is
defined"
-
name
:
install feature again
win_feature
:
name
:
"
{{
test_win_feature_name
}}"
state
:
present
restart
:
no
include_sub_features
:
yes
include_management_tools
:
yes
register
:
win_feature_install_again_result
-
name
:
check result of installing feature again
assert
:
that
:
-
"
not
win_feature_install_again_result|changed"
-
"
win_feature_install_again_result.success"
-
"
win_feature_install_again_result.exitcode
==
'NoChangeNeeded'"
-
"
not
win_feature_install_again_result.restart_needed"
-
"
win_feature_install_again_result.feature_result
==
[]"
-
name
:
remove feature
win_feature
:
name
:
"
{{
test_win_feature_name
}}"
state
:
absent
register
:
win_feature_remove_result
-
name
:
check result of removing feature
assert
:
that
:
-
"
win_feature_remove_result|changed"
-
"
win_feature_remove_result.success"
-
"
win_feature_remove_result.exitcode
==
'Success'"
-
"
not
win_feature_remove_result.restart_needed"
-
"
win_feature_remove_result.feature_result|length
==
1"
-
"
win_feature_remove_result.feature_result[0].id"
-
"
win_feature_remove_result.feature_result[0].display_name"
-
"
win_feature_remove_result.feature_result[0].message
is
defined"
-
"
win_feature_remove_result.feature_result[0].restart_needed
is
defined"
-
"
win_feature_remove_result.feature_result[0].skip_reason"
-
"
win_feature_remove_result.feature_result[0].success
is
defined"
-
name
:
remove feature again
win_feature
:
name
:
"
{{
test_win_feature_name
}}"
state
:
absent
register
:
win_feature_remove_again_result
-
name
:
check result of removing feature again
assert
:
that
:
-
"
not
win_feature_remove_again_result|changed"
-
"
win_feature_remove_again_result.success"
-
"
win_feature_remove_again_result.exitcode
==
'NoChangeNeeded'"
-
"
not
win_feature_remove_again_result.restart_needed"
-
"
win_feature_remove_again_result.feature_result
==
[]"
-
name
:
try to install an invalid feature name
win_feature
:
name
:
"
Microsoft-Bob"
state
:
present
register
:
win_feature_install_invalid_result
ignore_errors
:
true
-
name
:
check result of installing invalid feature name
assert
:
that
:
-
"
win_feature_install_invalid_result|failed"
-
"
not
win_feature_install_invalid_result|changed"
-
"
win_feature_install_invalid_result.msg"
-
"
win_feature_install_invalid_result.exitcode
==
'InvalidArgs'"
-
name
:
try to remove an invalid feature name
win_feature
:
name
:
"
Microsoft-Bob"
state
:
absent
register
:
win_feature_remove_invalid_result
ignore_errors
:
true
-
name
:
check result of removing invalid feature name
assert
:
that
:
-
"
win_feature_remove_invalid_result|failed"
-
"
not
win_feature_remove_invalid_result|changed"
-
"
win_feature_remove_invalid_result.msg"
-
"
win_feature_remove_invalid_result.exitcode
==
'InvalidArgs'"
test/integration/test_winrm.yml
View file @
997ea78b
...
...
@@ -29,3 +29,4 @@
-
{
role
:
test_win_get_url
,
tags
:
test_win_get_url
}
-
{
role
:
test_win_msi
,
tags
:
test_win_msi
}
-
{
role
:
test_win_service
,
tags
:
test_win_service
}
-
{
role
:
test_win_feature
,
tags
:
test_win_feature
}
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