446a0c1b08
* win_package - Refactor with msp, appx support * Added msi test for ALLUSERS * Added some msix tests, refactored tests * Added remaining msix tests * Enable msix sideloading for tests * Added remaining exe path tests * Added basic msp tests * Remove url options now the util no longer has them * Fix file version check for older Windows hosts * Remove no_proxy ansible-test setting * Use same mechanism of become to copy the file with explicit creds
71 lines
2 KiB
YAML
71 lines
2 KiB
YAML
---
|
|
- name: ensure testing folder exists
|
|
win_file:
|
|
path: '{{ test_path }}'
|
|
state: directory
|
|
|
|
# Some of the registry_tests.yml create a badly formed unisntall string so remove the reg entry in case the test
|
|
# didn't get to cleaning itself up
|
|
- name: remove registry package path
|
|
win_regedit:
|
|
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{ registry_id }}
|
|
state: absent
|
|
|
|
- name: download packages from S3 bucket
|
|
win_get_url:
|
|
url: '{{ item.url }}'
|
|
dest: '{{ test_path }}\{{ item.name }}'
|
|
with_items:
|
|
- url: '{{ good_url }}'
|
|
name: good.msi
|
|
- url: '{{ reboot_url }}'
|
|
name: reboot.msi
|
|
- url: '{{ bad_url }}'
|
|
name: bad.msi
|
|
- url: '{{ patch_msi_url }}'
|
|
name: patch.msi
|
|
- url: '{{ patch_msp_url }}'
|
|
name: patch.msp
|
|
|
|
- name: make sure all test packages are uninstalled before test
|
|
win_package:
|
|
product_id: '{{ item }}'
|
|
state: absent
|
|
with_items: '{{ all_ids }}'
|
|
|
|
- block:
|
|
- name: run tests for expected failures
|
|
include_tasks: failure_tests.yml
|
|
|
|
- name: run tests for msi files and URL paths
|
|
include_tasks: msi_tests.yml
|
|
|
|
# The msix test setup will only work on Server 2019 or newer so conditionally run this
|
|
- name: check if we can run the msix tests
|
|
win_shell: |
|
|
$osVersion = [Version](Get-Item -LiteralPath "$env:SystemRoot\System32\kernel32.dll").VersionInfo.ProductVersion
|
|
$osVersion -ge [Version]"10.0.17763"
|
|
register: can_run_msix
|
|
changed_when: False
|
|
|
|
- name: run tests for msix packages
|
|
include_tasks: msix_tests.yml
|
|
when: can_run_msix.stdout | trim | bool
|
|
|
|
- name: run tests for msp packages
|
|
include_tasks: msp_tests.yml
|
|
|
|
- name: run tests for registry packages
|
|
include_tasks: registry_tests.yml
|
|
|
|
always:
|
|
- name: remove registry package path
|
|
win_regedit:
|
|
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{ registry_id }}
|
|
state: absent
|
|
|
|
- name: make sure all test packages are uninstalled after test
|
|
win_package:
|
|
product_id: '{{ item }}'
|
|
state: absent
|
|
with_items: '{{ all_ids }}'
|