Skip to content

Commit 8e5336e

Browse files
committed
Update test images to rockylinux 9 and debian bookworm
1 parent eb266ac commit 8e5336e

File tree

5 files changed

+75
-100
lines changed

5 files changed

+75
-100
lines changed

images/debian_bullseye/Dockerfile renamed to images/debian_bookworm/Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
FROM debian:bullseye
1+
FROM debian:bookworm
22

33
ENV container docker
44

5-
# ntpd is linked to /bin/false, so the service is not running but is enabled
65
RUN apt-get update && \
76
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
87
lsb-release \
9-
python3 \
8+
python3-pip \
109
openssh-server \
1110
puppet \
12-
salt-minion \
1311
locales \
14-
ntp \
1512
sudo \
1613
supervisor \
1714
systemd-sysv \
@@ -29,11 +26,8 @@ RUN mkdir -p /var/run/sshd && \
2926
rm -f /lib/systemd/system/sockets.target.wants/*udev* && \
3027
rm -f /lib/systemd/system/sockets.target.wants/*initctl* && \
3128
systemctl enable ssh.service && \
32-
systemctl disable salt-minion.service && \
33-
systemctl enable ntp.service && \
3429
systemctl enable supervisor.service && \
3530
systemctl enable netfilter-persistent.service && \
36-
ln -fsn /bin/false /usr/sbin/ntpd && \
3731
echo "python3 hold" | dpkg --set-selections && \
3832
echo "LANG=fr_FR.ISO-8859-15" > /etc/default/locale && \
3933
echo "LANGUAGE=fr_FR" >> /etc/default/locale && \
@@ -69,7 +63,10 @@ RUN chage -E 20000 -m 7 -M 90 user
6963
# Some python3 virtualenv
7064
RUN virtualenv /v
7165
RUN /v/bin/pip install -U pip
72-
RUN /v/bin/pip install 'requests>1,<2'
66+
RUN /v/bin/pip install 'requests==2.30.0'
67+
68+
# install salt
69+
RUN python3 -m pip install --break-system-packages --no-cache salt
7370

7471
ENV LANG fr_FR.ISO-8859-15
7572
ENV LANGUAGE fr_FR

images/rockylinux8/Dockerfile renamed to images/rockylinux9/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM rockylinux:8
1+
FROM rockylinux:9
22

3-
RUN dnf -y install openssh-server procps python39 && dnf clean all &&\
3+
RUN dnf -y install openssh-server procps python311 iputils && dnf clean all &&\
44
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do if ! test $i = systemd-tmpfiles-setup.service; then rm -f $i; fi; done) && \
55
rm -f /lib/systemd/system/multi-user.target.wants/* && \
66
rm -f /etc/systemd/system/*.wants/* && \

test/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def has_docker():
5454
"""
5555

5656
DOCKER_IMAGES = [
57-
"rockylinux8",
58-
"debian_bullseye",
57+
"rockylinux9",
58+
"debian_bookworm",
5959
]
6060

6161

@@ -184,7 +184,7 @@ def host(request, tmpdir_factory):
184184
# Wait ssh to be up
185185
service = testinfra.get_host(docker_id, connection="docker").service
186186

187-
if image == "rockylinux8":
187+
if image == "rockylinux9":
188188
service_name = "sshd"
189189
else:
190190
service_name = "ssh"
@@ -215,7 +215,7 @@ def pytest_generate_tests(metafunc):
215215
break
216216
else:
217217
# Default
218-
hosts = ["docker://debian_bullseye"]
218+
hosts = ["docker://debian_bookworm"]
219219
metafunc.parametrize("host", hosts, indirect=True, scope="function")
220220

221221

test/test_backends.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,36 @@
2323
from testinfra.utils.ansible_runner import AnsibleRunner
2424

2525
HOSTS = [
26-
"ssh://debian_bullseye",
27-
"safe-ssh://debian_bullseye",
28-
"docker://debian_bullseye",
29-
"paramiko://debian_bullseye",
30-
"ansible://debian_bullseye",
31-
"ansible://debian_bullseye?force_ansible=True",
26+
"ssh://debian_bookworm",
27+
"safe-ssh://debian_bookworm",
28+
"docker://debian_bookworm",
29+
"paramiko://debian_bookworm",
30+
"ansible://debian_bookworm",
31+
"ansible://debian_bookworm?force_ansible=True",
3232
]
3333
USER_HOSTS = [
34-
"ssh://user@debian_bullseye",
35-
"safe-ssh://user@debian_bullseye",
36-
"docker://user@debian_bullseye",
37-
"paramiko://user@debian_bullseye",
38-
"ansible://user@debian_bullseye",
39-
"ansible://user@debian_bullseye?force_ansible=True",
34+
"ssh://user@debian_bookworm",
35+
"safe-ssh://user@debian_bookworm",
36+
"docker://user@debian_bookworm",
37+
"paramiko://user@debian_bookworm",
38+
"ansible://user@debian_bookworm",
39+
"ansible://user@debian_bookworm?force_ansible=True",
4040
]
4141
SUDO_HOSTS = [
42-
"ssh://user@debian_bullseye?sudo=True",
43-
"safe-ssh://user@debian_bullseye?sudo=True",
44-
"docker://user@debian_bullseye?sudo=True",
45-
"paramiko://user@debian_bullseye?sudo=True",
46-
"ansible://user@debian_bullseye?sudo=True",
47-
"ansible://user@debian_bullseye?force_ansible=True&sudo=True",
42+
"ssh://user@debian_bookworm?sudo=True",
43+
"safe-ssh://user@debian_bookworm?sudo=True",
44+
"docker://user@debian_bookworm?sudo=True",
45+
"paramiko://user@debian_bookworm?sudo=True",
46+
"ansible://user@debian_bookworm?sudo=True",
47+
"ansible://user@debian_bookworm?force_ansible=True&sudo=True",
4848
]
4949
SUDO_USER_HOSTS = [
50-
"ssh://debian_bullseye?sudo=True&sudo_user=user",
51-
"safe-ssh://debian_bullseye?sudo=True&sudo_user=user",
52-
"docker://debian_bullseye?sudo=True&sudo_user=user",
53-
"paramiko://debian_bullseye?sudo=True&sudo_user=user",
54-
"ansible://debian_bullseye?sudo=True&sudo_user=user",
55-
"ansible://debian_bullseye?force_ansible=True&sudo=True&sudo_user=user",
50+
"ssh://debian_bookworm?sudo=True&sudo_user=user",
51+
"safe-ssh://debian_bookworm?sudo=True&sudo_user=user",
52+
"docker://debian_bookworm?sudo=True&sudo_user=user",
53+
"paramiko://debian_bookworm?sudo=True&sudo_user=user",
54+
"ansible://debian_bookworm?sudo=True&sudo_user=user",
55+
"ansible://debian_bookworm?force_ansible=True&sudo=True&sudo_user=user",
5656
]
5757

5858

@@ -75,7 +75,7 @@ def test_command(host):
7575

7676
@pytest.mark.testinfra_hosts(*HOSTS)
7777
def test_encoding(host):
78-
# bullseye image is fr_FR@ISO-8859-15
78+
# bookworm image is fr_FR@ISO-8859-15
7979
cmd = host.run("ls -l %s", "/é")
8080
if host.backend.get_connection_type() == "docker":
8181
# docker bug ?
@@ -99,7 +99,7 @@ def test_encoding(host):
9999
)
100100

101101

102-
@pytest.mark.testinfra_hosts("ansible://debian_bullseye?force_ansible=True")
102+
@pytest.mark.testinfra_hosts("ansible://debian_bookworm?force_ansible=True")
103103
def test_ansible_any_error_fatal(host):
104104
os.environ["ANSIBLE_ANY_ERRORS_FATAL"] = "True"
105105
try:
@@ -485,7 +485,7 @@ def test_backend_importables():
485485
assert obj.get_connection_type() == connection_type
486486

487487

488-
@pytest.mark.testinfra_hosts("docker://rockylinux8", "ssh://rockylinux8")
488+
@pytest.mark.testinfra_hosts("docker://rockylinux9", "ssh://rockylinux9")
489489
def test_docker_encoding(host):
490490
encoding = host.check_output(
491491
"python3 -c 'import locale;print(locale.getpreferredencoding())'"

0 commit comments

Comments
 (0)