salt/pkg/tests/integration/test_systemd_config.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
Python
Raw Normal View History

import subprocess
import pytest
2023-01-30 16:19:26 -07:00
pytestmark = [
pytest.mark.skip_on_windows(reason="Linux test only"),
]
2023-02-02 13:40:08 -07:00
@pytest.mark.usefixtures("salt_minion")
def test_system_config(grains):
"""
Test system config
"""
if grains["os_family"] == "RedHat":
if grains["osfinger"] in (
"CentOS Stream-8",
"CentOS Linux-8",
"CentOS Stream-9",
"Fedora Linux-36",
"VMware Photon OS-3",
"VMware Photon OS-4",
"VMware Photon OS-5",
"Amazon Linux-2023",
):
expected_retcode = 0
else:
expected_retcode = 1
ret = subprocess.call(
"systemctl show -p ${config} salt-minion.service", shell=True
)
assert ret == expected_retcode
elif grains["os_family"] == "Debian":
if grains["osfinger"] == "Debian-9":
expected_retcode = 1
else:
expected_retcode = 0
ret = subprocess.call(
"systemctl show -p ${config} salt-minion.service", shell=True
)
assert ret == expected_retcode