mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-16 00:47:02 +01:00
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:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user