mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #67159 from dwoz/skipit
Rocky 8 container does not have full systemd
This commit is contained in:
commit
db5c7aefc5
1 changed files with 18 additions and 0 deletions
|
@ -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"]
|
||||
|
|
Loading…
Add table
Reference in a new issue