From 90862e6fc6921cb4d5de174ff9c278e8b94ce1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Tue, 29 Nov 2022 23:24:31 +0100 Subject: [PATCH] Run systemd in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- test/_centos_8.Dockerfile | 12 ++++++++++-- test/_centos_9.Dockerfile | 12 ++++++++++-- test/_debian_10.Dockerfile | 12 +++++++++++- test/_debian_11.Dockerfile | 12 +++++++++++- test/_fedora_35.Dockerfile | 12 ++++++++++-- test/_fedora_36.Dockerfile | 12 ++++++++++-- test/_ubuntu_20.Dockerfile | 12 +++++++++++- test/_ubuntu_22.Dockerfile | 12 +++++++++++- 8 files changed, 84 insertions(+), 12 deletions(-) diff --git a/test/_centos_8.Dockerfile b/test/_centos_8.Dockerfile index a07a67e9..6461dcf7 100644 --- a/test/_centos_8.Dockerfile +++ b/test/_centos_8.Dockerfile @@ -1,5 +1,13 @@ FROM quay.io/centos/centos:stream8 -RUN yum install -y git initscripts +RUN yum install -y git systemd + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -15,4 +23,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/usr/sbin/init"] diff --git a/test/_centos_9.Dockerfile b/test/_centos_9.Dockerfile index 6ccd18b6..b97c3a4d 100644 --- a/test/_centos_9.Dockerfile +++ b/test/_centos_9.Dockerfile @@ -1,5 +1,13 @@ FROM quay.io/centos/centos:stream9 -RUN yum install -y --allowerasing curl git initscripts +RUN yum install -y --allowerasing curl git systemd + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -15,4 +23,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/usr/sbin/init"] diff --git a/test/_debian_10.Dockerfile b/test/_debian_10.Dockerfile index 3b177cc8..3a5cf99e 100644 --- a/test/_debian_10.Dockerfile +++ b/test/_debian_10.Dockerfile @@ -1,5 +1,15 @@ FROM buildpack-deps:buster-scm +RUN apt-get update && apt-get -y install systemd systemd-sysv + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* + ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -14,4 +24,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/bin/systemd"] diff --git a/test/_debian_11.Dockerfile b/test/_debian_11.Dockerfile index 58c67e0f..bca4d4ab 100644 --- a/test/_debian_11.Dockerfile +++ b/test/_debian_11.Dockerfile @@ -1,5 +1,15 @@ FROM buildpack-deps:bullseye-scm +RUN apt-get update && apt-get -y install systemd systemd-sysv + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* + ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -14,4 +24,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/bin/systemd"] diff --git a/test/_fedora_35.Dockerfile b/test/_fedora_35.Dockerfile index 83c17650..48882b18 100644 --- a/test/_fedora_35.Dockerfile +++ b/test/_fedora_35.Dockerfile @@ -1,5 +1,13 @@ FROM fedora:35 -RUN dnf install -y git initscripts +RUN dnf install -y git systemd + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -15,4 +23,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/usr/sbin/init"] diff --git a/test/_fedora_36.Dockerfile b/test/_fedora_36.Dockerfile index 847767e7..01c4083f 100644 --- a/test/_fedora_36.Dockerfile +++ b/test/_fedora_36.Dockerfile @@ -1,5 +1,13 @@ FROM fedora:36 -RUN dnf install -y git initscripts +RUN dnf install -y git systemd + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -15,4 +23,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/usr/sbin/init"] diff --git a/test/_ubuntu_20.Dockerfile b/test/_ubuntu_20.Dockerfile index c63f883a..77841d12 100644 --- a/test/_ubuntu_20.Dockerfile +++ b/test/_ubuntu_20.Dockerfile @@ -1,5 +1,15 @@ FROM buildpack-deps:focal-scm +RUN apt-get update && apt-get -y install systemd systemd-sysv + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* + ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -15,4 +25,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/bin/systemd"] diff --git a/test/_ubuntu_22.Dockerfile b/test/_ubuntu_22.Dockerfile index d44518b4..72660986 100644 --- a/test/_ubuntu_22.Dockerfile +++ b/test/_ubuntu_22.Dockerfile @@ -1,5 +1,15 @@ FROM buildpack-deps:jammy-scm +RUN apt-get update && apt-get -y install systemd systemd-sysv + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ + /lib/systemd/system/systemd-update-utmp* + ENV GITDIR /etc/.pihole ENV SCRIPTDIR /opt/pihole @@ -15,4 +25,4 @@ RUN true && \ ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ +CMD ["/bin/systemd"]