2525 * [
2626 "docker://{}" .format (image )
2727 for image in (
28- "alpine" ,
29- "archlinux" ,
3028 "rockylinux8" ,
3129 "debian_bullseye" ,
32- "ubuntu_xenial" ,
3330 )
3431 ]
3532)
3835@all_images
3936def test_package (host , docker_image ):
4037 assert not host .package ("zsh" ).is_installed
41- if docker_image in ("alpine" , "archlinux" ):
42- name = "openssh"
43- else :
44- name = "openssh-server"
45-
46- ssh = host .package (name )
38+ ssh = host .package ("openssh-server" )
4739 version = {
48- "alpine" : "8." ,
49- "archlinux" : "9." ,
5040 "rockylinux8" : "8." ,
5141 "debian_bullseye" : "1:8.4" ,
52- "ubuntu_xenial" : "1:7.2" ,
5342 }[docker_image ]
5443 assert ssh .is_installed
5544 assert ssh .version .startswith (version )
5645 release = {
57- "alpine" : "r3" ,
58- "archlinux" : None ,
5946 "rockylinux8" : ".el8" ,
6047 "debian_bullseye" : None ,
61- "ubuntu_xenial" : None ,
6248 }[docker_image ]
6349 if release is None :
6450 with pytest .raises (NotImplementedError ):
@@ -101,11 +87,8 @@ def test_systeminfo(host, docker_image):
10187 assert host .system_info .type == "linux"
10288
10389 release , distribution , codename , arch = {
104- "alpine" : (r"^3\.14\." , "alpine" , None , "x86_64" ),
105- "archlinux" : ("rolling" , "arch" , None , "x86_64" ),
10690 "rockylinux8" : (r"^8.\d+$" , "rocky" , None , "x86_64" ),
10791 "debian_bullseye" : (r"^11" , "debian" , "bullseye" , "x86_64" ),
108- "ubuntu_xenial" : (r"^16\.04$" , "ubuntu" , "xenial" , "x86_64" ),
10992 }[docker_image ]
11093
11194 assert host .system_info .distribution == distribution
@@ -115,29 +98,21 @@ def test_systeminfo(host, docker_image):
11598
11699@all_images
117100def test_ssh_service (host , docker_image ):
118- if docker_image in ( "rockylinux8" , "alpine" , "archlinux" ) :
101+ if docker_image == "rockylinux8" :
119102 name = "sshd"
120103 else :
121104 name = "ssh"
122105
123106 ssh = host .service (name )
124- if docker_image == "ubuntu_xenial" :
125- assert not ssh .is_running
107+ # wait at max 10 seconds for ssh is running
108+ for _ in range (10 ):
109+ if ssh .is_running :
110+ break
111+ time .sleep (1 )
126112 else :
127- # wait at max 10 seconds for ssh is running
128- for _ in range (10 ):
129- if ssh .is_running :
130- break
131- time .sleep (1 )
132- else :
133- if docker_image == "archlinux" :
134- raise pytest .skip ("FIXME: flapping test" )
135- raise AssertionError ("ssh is not running" )
113+ raise AssertionError ("ssh is not running" )
136114
137- if docker_image == "ubuntu_xenial" :
138- assert not ssh .is_enabled
139- else :
140- assert ssh .is_enabled
115+ assert ssh .is_enabled
141116
142117
143118def test_service_systemd_mask (host ):
@@ -242,17 +217,12 @@ def test_socket(host):
242217def test_process (host , docker_image ):
243218 init = host .process .get (pid = 1 )
244219 assert init .ppid == 0
245- if docker_image != "alpine" :
246- # busybox ps doesn't have a euid equivalent
247- assert init .euid == 0
220+ assert init .euid == 0
248221 assert init .user == "root"
249222
250223 args , comm = {
251- "alpine" : ("/sbin/init" , "init" ),
252- "archlinux" : ("/usr/sbin/init" , "systemd" ),
253224 "rockylinux8" : ("/usr/sbin/init" , "systemd" ),
254225 "debian_bullseye" : ("/sbin/init" , "systemd" ),
255- "ubuntu_xenial" : ("/sbin/init" , "systemd" ),
256226 }[docker_image ]
257227 assert init .args == args
258228 assert init .comm == comm
0 commit comments