feat: enable proper systemd support in Docker tests (#1373)

- Replace the `sed` hack that disabled `systemctl` commands with proper
systemd support in Docker containers
- This allows testing the actual `systemctl` commands used by the
install script
- No more manual workarounds for starting OpenVPN/Unbound services
This commit is contained in:
Stanislas
2025-12-13 01:14:54 +01:00
committed by GitHub
parent 236e77af68
commit 9e1bb4b175
4 changed files with 118 additions and 83 deletions

View File

@@ -43,6 +43,27 @@ COPY test/server-entrypoint.sh /entrypoint.sh
COPY test/validate-output.sh /opt/test/validate-output.sh
RUN chmod +x /entrypoint.sh /opt/test/validate-output.sh
# Create systemd service for the test script
RUN printf '%s\n' \
'[Unit]' \
'Description=OpenVPN Installation Test' \
'After=network.target' \
'' \
'[Service]' \
'Type=oneshot' \
'Environment=HOME=/root' \
'WorkingDirectory=/root' \
'ExecStart=/entrypoint.sh' \
'RemainAfterExit=yes' \
'StandardOutput=journal+console' \
'StandardError=journal+console' \
'' \
'[Install]' \
'WantedBy=multi-user.target' \
> /etc/systemd/system/openvpn-test.service \
&& systemctl enable openvpn-test.service
WORKDIR /opt
ENTRYPOINT ["/entrypoint.sh"]
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]