Skip to content

Commit f275b73

Browse files
Move ssh service name to ssh_pkg_info variable
1 parent 9f87fe1 commit f275b73

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

test/test_modules.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
]
3232
)
3333

34-
# content: ssh version, release shortcut,
34+
# content: ssh version, release shortcut, service name
3535
ssh_pkg_info = {
36-
"rockylinux9": ("8.", ".el9"),
37-
"debian_bookworm": ("1:9.2", None),
36+
"rockylinux9": ("8.", ".el9", "sshd"),
37+
"debian_bookworm": ("1:9.2", None, "ssh"),
3838
}
3939

4040
# content: distribution, codename, architecture, release_regex
@@ -48,7 +48,7 @@
4848
def test_package(host, docker_image):
4949
assert not host.package("zsh").is_installed
5050
ssh = host.package("openssh-server")
51-
ssh_version, sshd_release = ssh_pkg_info[docker_image]
51+
ssh_version, sshd_release = ssh_pkg_info[docker_image][:2]
5252
assert ssh.is_installed
5353
assert ssh.version.startswith(ssh_version)
5454
if sshd_release is None:
@@ -102,12 +102,8 @@ def test_systeminfo(host, docker_image):
102102

103103
@all_images
104104
def test_ssh_service(host, docker_image):
105-
if docker_image == "rockylinux9":
106-
name = "sshd"
107-
else:
108-
name = "ssh"
109-
110-
ssh = host.service(name)
105+
service_name = ssh_pkg_info[docker_image][2]
106+
ssh = host.service(service_name)
111107
# wait at max 10 seconds for ssh is running
112108
for _ in range(10):
113109
if ssh.is_running:

0 commit comments

Comments
 (0)