Skip to content

Commit ce3fbf7

Browse files
dmurphy18twangboy
authored andcommitted
Updated test
1 parent d55cd96 commit ce3fbf7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/pytests/pkg/upgrade/test_salt_upgrade.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,12 @@ def test_salt_sysv_service_files(salt_call_cli, install_salt):
158158
print(f"DGM test_salt_sysv_service_files test_pkgs, '{test_pkgs}'", flush=True)
159159
for test_pkg_name in test_pkgs:
160160
test_pkg_basename = os.path.basename(test_pkg_name)
161-
test_pkg_basename_adj = test_pkg_basename.split("_")
161+
# Debian/Ubuntu name typically salt-minion_300xxxxxx
162+
# Redhat name typically salt-minion-300xxxxxx
163+
test_pkg_basename_dashunderscore = test_pkg_basename.split("300")[0]
164+
test_pkg_basename_adj = test_pkg_basename_dashunderscore[:-1]
162165
print(
163-
f"DGM test_salt_sysv_service_files test_pkg_basename_adj '{test_pkg_basename_adj}' from name test_pkg_basename '{test_pkg_basename}'",
166+
f"DGM test_salt_sysv_service_files test_pkg_basename_dashunderscore '{test_pkg_basename_dashunderscore}', test_pkg_basename_adj '{test_pkg_basename_adj}' from name test_pkg_basename '{test_pkg_basename}'",
164167
flush=True,
165168
)
166169
if test_pkg_basename_adj in (
@@ -170,6 +173,10 @@ def test_salt_sysv_service_files(salt_call_cli, install_salt):
170173
"salt-api",
171174
):
172175
test_initd_name = f"/etc/init.d/{test_pkg_basename_adj}"
176+
print(
177+
f"DGM test_salt_sysv_service_files test_initd_name, '{test_initd_name}' to check against",
178+
flush=True,
179+
)
173180
if salt.utils.path.which("dpkg"):
174181
proc = subprocess.run(
175182
["dpkg", "-q", "-c", f"{test_pkg_name}"],
@@ -185,6 +192,10 @@ def test_salt_sysv_service_files(salt_call_cli, install_salt):
185192
found_line = False
186193
for line in proc.stdout.decode().splitlines():
187194
# If test_initd_name not present we should fail.
195+
print(
196+
f"DGM test_salt_sysv_service_files check line, '{line}'",
197+
flush=True,
198+
)
188199
if line == test_initd_name:
189200
found_line = True
190201
print(

0 commit comments

Comments
 (0)