Updated version comparsion and to ignore ipc files

This commit is contained in:
David Murphy 2024-06-19 17:43:15 -06:00 committed by Daniel Wozniak
parent 6743cefc1c
commit a5a5ca9081
2 changed files with 17 additions and 9 deletions

View file

@ -137,6 +137,7 @@ def test_pkg_paths(
):
pytest.skip("Package path ownership was changed in salt 3006.4")
salt_user_subdirs = []
for _path in pkg_paths:
pkg_path = pathlib.Path(_path)
assert pkg_path.exists()
@ -161,6 +162,8 @@ def test_pkg_paths(
assert path.owner() == "root"
assert path.group() == "root"
for file in files:
if file.endswith("ipc"):
continue
file_path = path.joinpath(file)
# Individual files owned by salt user
if str(file_path) in pkg_paths_salt_user:

View file

@ -14,16 +14,21 @@ def test_salt_version(version, install_salt):
actual = []
test_bin = os.path.join(*install_salt.binary_paths["salt"])
ret = install_salt.proc.run(test_bin, "--version")
actual_ver = ret.stdout.strip().split(" ")[:2]
actual_ver_salt = actual_ver[1] # get salt version
if "+" in actual_ver_salt:
actual_ver_salt_stripped = actual_ver_salt.split("+")[
0
] # strip any git versioning
actual.append(actual_ver[0])
actual.append(actual_ver_salt_stripped)
if "+" in version:
# testing a non-release build artifact version
actual = ret.stdout.strip().split(" ")[:2]
else:
pytest.skip("Not testing a non-release build artifact, do not run")
# testing against release build version, for example: downgrade
actual_ver = ret.stdout.strip().split(" ")[:2]
actual_ver_salt = actual_ver[1] # get salt version
if "+" in actual_ver_salt:
actual_ver_salt_stripped = actual_ver_salt.split("+")[
0
] # strip any git versioning
actual.append(actual_ver[0])
actual.append(actual_ver_salt_stripped)
else:
pytest.skip("Not testing a non-release build artifact, do not run")
expected = ["salt", version]
assert actual == expected