25
25
* [
26
26
"docker://{}" .format (image )
27
27
for image in (
28
- "alpine" ,
29
- "archlinux" ,
30
28
"rockylinux8" ,
31
29
"debian_bullseye" ,
32
- "ubuntu_xenial" ,
33
30
)
34
31
]
35
32
)
38
35
@all_images
39
36
def test_package (host , docker_image ):
40
37
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" )
47
39
version = {
48
- "alpine" : "8." ,
49
- "archlinux" : "9." ,
50
40
"rockylinux8" : "8." ,
51
41
"debian_bullseye" : "1:8.4" ,
52
- "ubuntu_xenial" : "1:7.2" ,
53
42
}[docker_image ]
54
43
assert ssh .is_installed
55
44
assert ssh .version .startswith (version )
56
45
release = {
57
- "alpine" : "r3" ,
58
- "archlinux" : None ,
59
46
"rockylinux8" : ".el8" ,
60
47
"debian_bullseye" : None ,
61
- "ubuntu_xenial" : None ,
62
48
}[docker_image ]
63
49
if release is None :
64
50
with pytest .raises (NotImplementedError ):
@@ -101,11 +87,8 @@ def test_systeminfo(host, docker_image):
101
87
assert host .system_info .type == "linux"
102
88
103
89
release , distribution , codename , arch = {
104
- "alpine" : (r"^3\.14\." , "alpine" , None , "x86_64" ),
105
- "archlinux" : ("rolling" , "arch" , None , "x86_64" ),
106
90
"rockylinux8" : (r"^8.\d+$" , "rocky" , None , "x86_64" ),
107
91
"debian_bullseye" : (r"^11" , "debian" , "bullseye" , "x86_64" ),
108
- "ubuntu_xenial" : (r"^16\.04$" , "ubuntu" , "xenial" , "x86_64" ),
109
92
}[docker_image ]
110
93
111
94
assert host .system_info .distribution == distribution
@@ -115,29 +98,21 @@ def test_systeminfo(host, docker_image):
115
98
116
99
@all_images
117
100
def test_ssh_service (host , docker_image ):
118
- if docker_image in ( "rockylinux8" , "alpine" , "archlinux" ) :
101
+ if docker_image == "rockylinux8" :
119
102
name = "sshd"
120
103
else :
121
104
name = "ssh"
122
105
123
106
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 )
126
112
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" )
136
114
137
- if docker_image == "ubuntu_xenial" :
138
- assert not ssh .is_enabled
139
- else :
140
- assert ssh .is_enabled
115
+ assert ssh .is_enabled
141
116
142
117
143
118
def test_service_systemd_mask (host ):
@@ -242,17 +217,12 @@ def test_socket(host):
242
217
def test_process (host , docker_image ):
243
218
init = host .process .get (pid = 1 )
244
219
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
248
221
assert init .user == "root"
249
222
250
223
args , comm = {
251
- "alpine" : ("/sbin/init" , "init" ),
252
- "archlinux" : ("/usr/sbin/init" , "systemd" ),
253
224
"rockylinux8" : ("/usr/sbin/init" , "systemd" ),
254
225
"debian_bullseye" : ("/sbin/init" , "systemd" ),
255
- "ubuntu_xenial" : ("/sbin/init" , "systemd" ),
256
226
}[docker_image ]
257
227
assert init .args == args
258
228
assert init .comm == comm
0 commit comments