Skip to content

Commit 77234ec

Browse files
Move ssh service name to ssh_pkg_info variable
1 parent 52ad060 commit 77234ec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/test_modules.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
]
3434
)
3535

36-
# content: ssh version, release shortcut,
36+
# content: ssh version, release shortcut, service name
3737
ssh_pkg_info = {
38-
"rockylinux9": ("8.", ".el9"),
39-
"debian_bookworm": ("1:9.2", None),
38+
"rockylinux9": ("8.", ".el9", "sshd"),
39+
"debian_bookworm": ("1:9.2", None, "ssh"),
4040
}
4141

4242
# content: distribution, codename, architecture, release_regex
@@ -50,7 +50,7 @@
5050
def test_package(host, docker_image):
5151
assert not host.package("zsh").is_installed
5252
ssh = host.package("openssh-server")
53-
ssh_version, sshd_release = ssh_pkg_info[docker_image]
53+
ssh_version, sshd_release = ssh_pkg_info[docker_image][:2]
5454
assert ssh.is_installed
5555
assert ssh.version.startswith(ssh_version)
5656
if sshd_release is None:
@@ -115,8 +115,8 @@ def test_systeminfo(host, docker_image):
115115

116116
@all_images
117117
def test_ssh_service(host, docker_image):
118-
name = "sshd" if docker_image == "rockylinux9" else "ssh"
119-
ssh = host.service(name)
118+
service_name = ssh_pkg_info[docker_image][2]
119+
ssh = host.service(service_name)
120120
# wait at max 10 seconds for ssh is running
121121
for _ in range(10):
122122
if ssh.is_running:

0 commit comments

Comments
 (0)