Skip to content

Commit eb266ac

Browse files
committed
Only use debian and rockylinux for testing
1 parent dc8f15a commit eb266ac

File tree

5 files changed

+11
-89
lines changed

5 files changed

+11
-89
lines changed

images/alpine/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

images/archlinux/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

images/ubuntu_xenial/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ def has_docker():
5454
"""
5555

5656
DOCKER_IMAGES = [
57-
"alpine",
58-
"archlinux",
5957
"rockylinux8",
6058
"debian_bullseye",
61-
"ubuntu_xenial",
6259
]
6360

6461

@@ -187,9 +184,7 @@ def host(request, tmpdir_factory):
187184
# Wait ssh to be up
188185
service = testinfra.get_host(docker_id, connection="docker").service
189186

190-
images_with_sshd = ("rockylinux8", "alpine", "archlinux")
191-
192-
if image in images_with_sshd:
187+
if image == "rockylinux8":
193188
service_name = "sshd"
194189
else:
195190
service_name = "ssh"

test/test_modules.py

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
*[
2626
"docker://{}".format(image)
2727
for image in (
28-
"alpine",
29-
"archlinux",
3028
"rockylinux8",
3129
"debian_bullseye",
32-
"ubuntu_xenial",
3330
)
3431
]
3532
)
@@ -38,27 +35,16 @@
3835
@all_images
3936
def 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
117100
def 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

143118
def test_service_systemd_mask(host):
@@ -242,17 +217,12 @@ def test_socket(host):
242217
def 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

Comments
 (0)