Skip to content

Commit 9047c85

Browse files
twangboydwoz
authored andcommitted
Fix upgrade tests for debian based systems
1 parent 8e85f52 commit 9047c85

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/pytests/pkg/upgrade/test_salt_upgrade.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,18 @@ def test_salt_sysv_service_files(install_salt):
164164
):
165165
test_initd_name = f"/etc/init.d/{test_pkg_basename_adj}"
166166
if salt.utils.path.which("dpkg"):
167-
proc = subprocess.run(
168-
["dpkg", "-q", "-c", f"{test_pkg_name}"],
169-
capture_output=True,
170-
check=True,
171-
)
167+
if os.path.exists("/etc/debian_version"):
168+
proc = subprocess.run(
169+
["dpkg", "-c", f"{test_pkg_name}"],
170+
capture_output=True,
171+
check=True,
172+
)
173+
else:
174+
proc = subprocess.run(
175+
["dpkg", "-q", "-c", f"{test_pkg_name}"],
176+
capture_output=True,
177+
check=True,
178+
)
172179
elif salt.utils.path.which("rpm"):
173180
proc = subprocess.run(
174181
["rpm", "-q", "-l", "-p", f"{test_pkg_name}"],

0 commit comments

Comments
 (0)