MCPcopy
hub / github.com/saltstack/salt / test_compare_versions

Function test_compare_versions

tests/pytests/pkg/integration/test_version.py:102–127  ·  view source on GitHub ↗

Test compare versions

(binary, install_salt)

Source from the content-addressed store, hash-verified

100 "binary", ["master", "cloud", "syndic", "minion", "call", "api"]
101)
102def test_compare_versions(binary, install_salt):
103 """
104 Test compare versions
105 """
106 if install_salt.use_prev_version:
107 version = install_salt.prev_version
108 else:
109 version = install_salt.artifact_version
110 if binary in install_salt.binary_paths:
111 if install_salt.upgrade:
112 install_salt.install()
113
114 ret = install_salt.proc.run(
115 *install_salt.binary_paths[binary],
116 "--version",
117 stdout=subprocess.PIPE,
118 stderr=subprocess.PIPE,
119 )
120 ver_pat = version.split("+", 1)[0] if "+" in version else version
121 ret.stdout.matcher.fnmatch_lines([f"*{ver_pat}*"])
122 else:
123 if platform.is_windows():
124 pytest.skip(f"Binary not available on windows: {binary}")
125 pytest.fail(
126 f"Platform is not Windows and yet the binary {binary!r} is not available"
127 )
128
129
130_DARWIN_PKG_SYMLINK_TO_BINKEY = {

Callers

nothing calls this directly

Calls 2

installMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected