mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix test_enabled_disabled for mac
This commit is contained in:
parent
8922b339ac
commit
035b640347
2 changed files with 39 additions and 34 deletions
|
@ -1,4 +1,5 @@
|
|||
import pytest
|
||||
from pytestskipmarkers.utils import platform
|
||||
from saltfactories.utils.functional import MultiStateResult
|
||||
|
||||
|
||||
|
@ -16,11 +17,14 @@ def test_services(install_salt, salt_cli, salt_minion):
|
|||
elif install_salt.distro_id in ("centos", "redhat", "amzn", "fedora"):
|
||||
services_enabled = []
|
||||
services_disabled = ["salt-master", "salt-minion", "salt-syndic", "salt-api"]
|
||||
elif platform.is_darwin():
|
||||
services_enabled = ["salt-minion"]
|
||||
services_disabled = []
|
||||
else:
|
||||
pytest.fail(f"Don't know how to handle os_family={install_salt.distro_id}")
|
||||
|
||||
for service in services_enabled:
|
||||
assert salt_cli.run("service.enabled")
|
||||
assert "True" in salt_cli.run("service.enabled", service).stdout
|
||||
|
||||
for service in services_disabled:
|
||||
assert salt_cli.run("service.disabled")
|
||||
assert "True" in salt_cli.run("service.disabled", service).stdout
|
||||
|
|
|
@ -314,6 +314,7 @@ class SaltPkgInstall:
|
|||
self.root = pathlib.Path(os.sep, "usr", "local", "bin")
|
||||
|
||||
if file_ext == "pkg":
|
||||
self.compressed = False
|
||||
self.onedir = True
|
||||
self.installer_pkg = True
|
||||
self.bin_dir = self.root / "salt" / "bin"
|
||||
|
@ -361,21 +362,25 @@ class SaltPkgInstall:
|
|||
"python": [python_bin],
|
||||
}
|
||||
else:
|
||||
if os.path.exists(self.install_dir / "bin" / "salt"):
|
||||
install_dir = self.install_dir / "bin"
|
||||
else:
|
||||
install_dir = self.install_dir
|
||||
self.binary_paths = {
|
||||
"salt": ["salt"],
|
||||
"api": ["salt-api"],
|
||||
"call": ["salt-call"],
|
||||
"cloud": ["salt-cloud"],
|
||||
"cp": ["salt-cp"],
|
||||
"key": ["salt-key"],
|
||||
"master": ["salt-master"],
|
||||
"minion": ["salt-minion"],
|
||||
"proxy": ["salt-proxy"],
|
||||
"run": ["salt-run"],
|
||||
"ssh": ["salt-ssh"],
|
||||
"syndic": ["salt-syndic"],
|
||||
"spm": ["spm"],
|
||||
"pip": ["salt-pip"],
|
||||
"salt": [install_dir / "salt"],
|
||||
"api": [install_dir / "salt-api"],
|
||||
"call": [install_dir / "salt-call"],
|
||||
"cloud": [install_dir / "salt-cloud"],
|
||||
"cp": [install_dir / "salt-cp"],
|
||||
"key": [install_dir / "salt-key"],
|
||||
"master": [install_dir / "salt-master"],
|
||||
"minion": [install_dir / "salt-minion"],
|
||||
"proxy": [install_dir / "salt-proxy"],
|
||||
"run": [install_dir / "salt-run"],
|
||||
"ssh": [install_dir / "salt-ssh"],
|
||||
"syndic": [install_dir / "salt-syndic"],
|
||||
"spm": [install_dir / "spm"],
|
||||
"pip": [install_dir / "salt-pip"],
|
||||
"python": [python_bin],
|
||||
}
|
||||
else:
|
||||
|
@ -416,25 +421,21 @@ class SaltPkgInstall:
|
|||
"python": [python_bin],
|
||||
}
|
||||
else:
|
||||
if os.path.exists(self.install_dir / "bin" / "salt"):
|
||||
install_dir = self.install_dir / "bin"
|
||||
else:
|
||||
install_dir = self.install_dir
|
||||
self.binary_paths = {
|
||||
"salt": [install_dir / "salt"],
|
||||
"api": [install_dir / "salt-api"],
|
||||
"call": [install_dir / "salt-call"],
|
||||
"cloud": [install_dir / "salt-cloud"],
|
||||
"cp": [install_dir / "salt-cp"],
|
||||
"key": [install_dir / "salt-key"],
|
||||
"master": [install_dir / "salt-master"],
|
||||
"minion": [install_dir / "salt-minion"],
|
||||
"proxy": [install_dir / "salt-proxy"],
|
||||
"run": [install_dir / "salt-run"],
|
||||
"ssh": [install_dir / "salt-ssh"],
|
||||
"syndic": [install_dir / "salt-syndic"],
|
||||
"spm": [install_dir / "spm"],
|
||||
"pip": [install_dir / "salt-pip"],
|
||||
"salt": [self.install_dir / "salt"],
|
||||
"api": [self.install_dir / "salt-api"],
|
||||
"call": [self.install_dir / "salt-call"],
|
||||
"cloud": [self.install_dir / "salt-cloud"],
|
||||
"cp": [self.install_dir / "salt-cp"],
|
||||
"key": [self.install_dir / "salt-key"],
|
||||
"master": [self.install_dir / "salt-master"],
|
||||
"minion": [self.install_dir / "salt-minion"],
|
||||
"proxy": [self.install_dir / "salt-proxy"],
|
||||
"run": [self.install_dir / "salt-run"],
|
||||
"ssh": [self.install_dir / "salt-ssh"],
|
||||
"syndic": [self.install_dir / "salt-syndic"],
|
||||
"spm": [self.install_dir / "spm"],
|
||||
"pip": [self.install_dir / "salt-pip"],
|
||||
"python": [python_bin],
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue