1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Correct integration tests for the win_disk_facts module (#51044)

* Correct integration tests for the win_disk_facts module

* Exclude W2K8, W2K8-R2 from tests run under CI
This commit is contained in:
Wojciech Sciesinski 2019-02-05 22:42:11 +01:00 committed by Jordan Borean
parent 9301c18428
commit b8a7e35b22
3 changed files with 14 additions and 12 deletions

View file

@ -1 +1,3 @@
shippable/windows/group2
skip/windows/2008 # The Storage PowerShell module was introduced in W2K12
skip/windows/2008-R2 # The Storage PowerShell module was introduced in W2K12

View file

@ -1,12 +1,12 @@
# NOTE: The win_disk_facts module only works on Win2012R2+
- name: check whether storage module is available (windows 2008 r2 or later)
raw: PowerShell -Command Import-Module Storage
win_shell: '(Get-Module -Name Storage -ListAvailable | Measure-Object).Count -eq 1'
register: win_feature_has_storage_module
ignore_errors: true
changed_when: false
- name: Only run tests when Windows is capable
when: ( win_feature_has_storage_module is successful) and (ansible_powershell_version is defined) and (ansible_powershell_version >= 3)
when: win_feature_has_storage_module.stdout | trim | bool == True
block:
- name: Test in normal mode

View file

@ -6,12 +6,12 @@
assert:
that:
- disks_found.changed == false
- disks_found.ansible_facts.disks[0].size is defined
- disks_found.ansible_facts.disks[0].number is defined
- disks_found.ansible_facts.disks[0].operational_status is defined
- disks_found.ansible_facts.disks[0].read_only is defined
- disks_found.ansible_facts.disks[0].clustered is defined
- disks_found.ansible_facts.disks[0].location is defined
- disks_found.ansible_facts.disks[0].guid is defined
- disks_found.ansible_facts.disks[0].path is defined
- disks_found.ansible_facts.disks[0].bootable is defined
- disks_found.ansible_facts.ansible_disks[0].number is defined
- disks_found.ansible_facts.ansible_disks[0].guid is defined
- disks_found.ansible_facts.ansible_disks[0].location is defined
- disks_found.ansible_facts.ansible_disks[0].path is defined
- disks_found.ansible_facts.ansible_disks[0].read_only is defined
- disks_found.ansible_facts.ansible_disks[0].clustered is defined
- disks_found.ansible_facts.ansible_disks[0].bootable is defined
- disks_found.ansible_facts.ansible_disks[0].physical_disk.size is defined
- disks_found.ansible_facts.ansible_disks[0].physical_disk.operational_status is defined