mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge 3006.x into 3007.x
This commit is contained in:
commit
3d44711e01
3 changed files with 14 additions and 6 deletions
|
@ -3,7 +3,7 @@ import pytest
|
|||
pytestmark = [
|
||||
pytest.mark.windows_whitelisted,
|
||||
pytest.mark.core_test,
|
||||
pytest.mark.timeout_unless_on_windows(120),
|
||||
pytest.mark.timeout_unless_on_windows(240),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ def assistive(modules):
|
|||
def osa_script(assistive):
|
||||
osa_script_path = "/usr/bin/osascript"
|
||||
try:
|
||||
ret = assistive.install(osa_script_path, True)
|
||||
assistive.install(osa_script_path, True)
|
||||
yield osa_script_path
|
||||
except CommandExecutionError as exc:
|
||||
pytest.skip(f"Unable to install {osa_script}: {exc}")
|
||||
|
@ -33,7 +33,7 @@ def osa_script(assistive):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def install_remove_pkg_name(assistive):
|
||||
def install_remove_pkg_name(assistive, grains):
|
||||
smile_bundle = "com.smileonmymac.textexpander"
|
||||
try:
|
||||
yield smile_bundle
|
||||
|
@ -44,12 +44,19 @@ def install_remove_pkg_name(assistive):
|
|||
|
||||
|
||||
@pytest.mark.slow_test
|
||||
def test_install_and_remove(assistive, install_remove_pkg_name):
|
||||
def test_install_and_remove(assistive, install_remove_pkg_name, grains):
|
||||
"""
|
||||
Tests installing and removing a bundled ID or command to use assistive access.
|
||||
"""
|
||||
ret = assistive.install(install_remove_pkg_name)
|
||||
assert ret
|
||||
try:
|
||||
ret = assistive.install(install_remove_pkg_name)
|
||||
assert ret
|
||||
except CommandExecutionError as exc:
|
||||
if grains["osmajorrelease"] != 12:
|
||||
raise exc from None
|
||||
if "attempt to write a readonly database" not in str(exc):
|
||||
raise exc from None
|
||||
pytest.skip("Test fails on MacOS 12(attempt to write a readonly database)")
|
||||
ret = assistive.remove(install_remove_pkg_name)
|
||||
assert ret
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ def test_present_absent(salt_master, salt_minion, salt_call_cli):
|
|||
ret = salt_call_cli.run(
|
||||
"state.apply",
|
||||
"manage_beacons",
|
||||
_timeout=120,
|
||||
)
|
||||
assert ret.returncode == 0
|
||||
state_id = "beacon_|-beacon-diskusage_|-diskusage_|-present"
|
||||
|
|
Loading…
Add table
Reference in a new issue