mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add tests for windows setup module.
This commit is contained in:
parent
bceaf96fd6
commit
5b85252043
3 changed files with 38 additions and 3 deletions
|
@ -28,7 +28,6 @@ $powershellpath = "C:\powershell"
|
||||||
|
|
||||||
function download-file
|
function download-file
|
||||||
{
|
{
|
||||||
Get-Process | Out-File c:\powershell\whatisrunningrightnow.txt
|
|
||||||
param ([string]$path, [string]$local)
|
param ([string]$path, [string]$local)
|
||||||
$client = new-object system.net.WebClient
|
$client = new-object system.net.WebClient
|
||||||
$client.Headers.Add("user-agent", "PowerShell")
|
$client.Headers.Add("user-agent", "PowerShell")
|
||||||
|
@ -78,6 +77,6 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$FileName = $DownLoadUrl.Split('/')[-1]
|
$FileName = $DownLoadUrl.Split('/')[-1]
|
||||||
# download-file $downloadurl "$powershellpath\$filename"
|
download-file $downloadurl "$powershellpath\$filename"
|
||||||
|
write-host "$powershellpath\$filename"
|
||||||
."$powershellpath\$filename" /quiet /log "C:\powershell\install.log"
|
."$powershellpath\$filename" /quiet /log "C:\powershell\install.log"
|
||||||
|
|
35
test/integration/roles/test_win_setup/tasks/main.yml
Normal file
35
test/integration/roles/test_win_setup/tasks/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# test code for the setup module when using winrm connection
|
||||||
|
# (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: test setup module
|
||||||
|
action: setup
|
||||||
|
register: setup_result
|
||||||
|
|
||||||
|
- name: check setup result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "not setup_result|failed"
|
||||||
|
- "not setup_result|changed"
|
||||||
|
- "setup_result.ansible_facts"
|
||||||
|
- "setup_result.ansible_facts.ansible_os_family == 'Windows'"
|
||||||
|
- "setup_result.ansible_facts.ansible_distribution"
|
||||||
|
- "setup_result.ansible_facts.ansible_distribution_version"
|
||||||
|
- "setup_result.ansible_facts.ansible_fqdn"
|
||||||
|
- "setup_result.ansible_facts.ansible_hostname"
|
||||||
|
- "setup_result.ansible_facts.ansible_ip_addresses"
|
||||||
|
- "setup_result.ansible_facts.ansible_system"
|
|
@ -6,6 +6,7 @@
|
||||||
- { role: test_win_raw, tags: test_win_raw }
|
- { role: test_win_raw, tags: test_win_raw }
|
||||||
- { role: test_win_script, tags: test_win_script }
|
- { role: test_win_script, tags: test_win_script }
|
||||||
- { role: test_win_ping, tags: test_win_ping }
|
- { role: test_win_ping, tags: test_win_ping }
|
||||||
|
- { role: test_win_setup, tags: test_win_setup }
|
||||||
- { role: test_win_slurp, tags: test_win_slurp }
|
- { role: test_win_slurp, tags: test_win_slurp }
|
||||||
- { role: test_win_fetch, tags: test_win_fetch }
|
- { role: test_win_fetch, tags: test_win_fetch }
|
||||||
- { role: test_win_stat, tags: test_win_stat }
|
- { role: test_win_stat, tags: test_win_stat }
|
||||||
|
|
Loading…
Reference in a new issue