mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Update tests on Windows
This commit is contained in:
parent
aef73e4b56
commit
de5f8d4292
6 changed files with 10 additions and 72 deletions
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
|
@ -144,22 +144,6 @@ jobs:
|
|||
instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]'
|
||||
|
||||
|
||||
|
||||
windows-2019:
|
||||
name: Windows 2019
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
uses: ./.github/workflows/test-windows.yml
|
||||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
with:
|
||||
distro-slug: windows-2019
|
||||
display-name: Windows 2019
|
||||
timeout: 20
|
||||
runs-on: windows-2019
|
||||
instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]'
|
||||
|
||||
|
||||
windows-2022:
|
||||
name: Windows 2022
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
|
@ -480,7 +464,6 @@ jobs:
|
|||
- generate-actions-workflow
|
||||
- macos-12
|
||||
- macos-13
|
||||
- windows-2019
|
||||
- windows-2022
|
||||
- almalinux-8
|
||||
- almalinux-9
|
||||
|
|
2
.github/workflows/templates/generate.py
vendored
2
.github/workflows/templates/generate.py
vendored
|
@ -32,7 +32,6 @@ LINUX_DISTROS = [
|
|||
"ubuntu-2404",
|
||||
]
|
||||
WINDOWS = [
|
||||
"windows-2019",
|
||||
"windows-2022",
|
||||
]
|
||||
|
||||
|
@ -265,7 +264,6 @@ DISTRO_DISPLAY_NAMES = {
|
|||
"ubuntu-2404": "Ubuntu 24.04",
|
||||
"macos-12": "macOS 12",
|
||||
"macos-13": "macOS 13",
|
||||
"windows-2019": "Windows 2019",
|
||||
"windows-2022": "Windows 2022",
|
||||
}
|
||||
|
||||
|
|
1
.github/workflows/test-windows.yml
vendored
1
.github/workflows/test-windows.yml
vendored
|
@ -41,7 +41,6 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
driver:
|
||||
name: proxy
|
||||
host: localhost
|
||||
reset_command: "exit 0"
|
||||
port: 5985
|
||||
username: kitchen
|
||||
password: Password1
|
||||
|
||||
provisioner:
|
||||
salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1
|
||||
salt_bootstrap_options: -Version %s -Verbose
|
||||
init_environment: ''
|
||||
|
||||
platforms:
|
||||
- name: windows-2022
|
||||
- name: windows-2019
|
||||
|
||||
suites:
|
||||
- name: stable-3006
|
||||
provisioner:
|
||||
salt_version: 3006
|
||||
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
|
||||
- name: stable-3006-8
|
||||
provisioner:
|
||||
salt_version: 3006.8
|
||||
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
|
||||
- name: stable-3007
|
||||
provisioner:
|
||||
salt_version: 3007
|
||||
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
|
||||
- name: stable-3007-1
|
||||
provisioner:
|
||||
salt_version: 3007.1
|
||||
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
|
||||
- name: latest
|
||||
provisioner:
|
||||
salt_version: latest
|
||||
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
|
||||
|
||||
verifier:
|
||||
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/
|
|
@ -1,12 +1,11 @@
|
|||
import json
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
## from Demos.win32cred_demo import target
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -26,19 +25,17 @@ def run_salt_call(cmd):
|
|||
"""
|
||||
cmd.append("--out=json")
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
if result.stdout:
|
||||
json_data = json.loads(result.stdout)
|
||||
return json_data["local"]
|
||||
return None
|
||||
json_data = json.loads(result.stdout)
|
||||
return json_data["local"]
|
||||
|
||||
|
||||
def test_ping():
|
||||
def test_ping(path):
|
||||
cmd = ["salt-call", "--local", "test.ping"]
|
||||
result = run_salt_call(cmd)
|
||||
assert result == True
|
||||
|
||||
|
||||
def test_target_python_version(target_python_version):
|
||||
def test_target_python_version(path, target_python_version):
|
||||
cmd = ["salt-call", "--local", "grains.item", "pythonversion", "--timeout=120"]
|
||||
result = run_salt_call(cmd)
|
||||
# Returns: {'pythonversion': [3, 10, 11, 'final', 0]}
|
||||
|
@ -46,8 +43,10 @@ def test_target_python_version(target_python_version):
|
|||
assert py_maj_ver == target_python_version
|
||||
|
||||
|
||||
def test_target_salt_version(target_salt_version):
|
||||
def test_target_salt_version(path, target_salt_version):
|
||||
if not target_salt_version:
|
||||
pytest.skip(f"No target version specified")
|
||||
cmd = ["salt-call", "--local", "grains.item", "saltversion", "--timeout=120"]
|
||||
result = run_salt_call(cmd)
|
||||
# Returns: {'saltversion': '3006.9+217.g53cfa53040'}
|
||||
assert result["saltversion"] == target_salt_version
|
||||
assert result["saltversion"] == target_salt_version
|
|
@ -1 +1,2 @@
|
|||
pytest
|
||||
requests
|
Loading…
Add table
Reference in a new issue