Merge pull request #67159 from dwoz/skipit

Rocky 8 container does not have full systemd
This commit is contained in:
Daniel Wozniak 2025-01-15 19:18:49 -07:00 committed by GitHub
commit db5c7aefc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,16 +2,34 @@
Simple Smoke Tests for Connected SSH minions
"""
import subprocess
import pytest
from saltfactories.utils.functional import StateResult
import salt.utils.platform
pytestmark = [
pytest.mark.slow_test,
pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"),
]
def _check_systemctl():
if not hasattr(_check_systemctl, "memo"):
if not salt.utils.platform.is_linux():
_check_systemctl.memo = False
else:
proc = subprocess.run(["systemctl"], capture_output=True, check=False)
_check_systemctl.memo = (
b"Failed to get D-Bus connection: No such file or directory"
in proc.stderr
)
return _check_systemctl.memo
@pytest.mark.skip_if_not_root
@pytest.mark.skipif(_check_systemctl(), reason="systemctl degraded")
def test_service(salt_ssh_cli, grains):
service = "cron"
os_family = grains["os_family"]