mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-29 22:27:03 +01:00
fix(test): pass Docker env vars to systemd test service
The fingerprint mode CI test was not actually testing fingerprint mode because Docker environment variables (-e AUTH_MODE=fingerprint) were not being inherited by the systemd service running the tests. Add PassEnvironment directive to pass AUTH_MODE and other test config env vars from Docker to the systemd service. Fixes the CI gap where fingerprint mode issues went undetected.
This commit is contained in:
@@ -71,6 +71,7 @@ COPY test/validate-output.sh /opt/test/validate-output.sh
|
|||||||
RUN chmod +x /entrypoint.sh /opt/test/validate-output.sh
|
RUN chmod +x /entrypoint.sh /opt/test/validate-output.sh
|
||||||
|
|
||||||
# Create systemd service for the test script
|
# Create systemd service for the test script
|
||||||
|
# PassEnvironment passes Docker env vars (-e) from PID 1 to the service
|
||||||
RUN printf '%s\n' \
|
RUN printf '%s\n' \
|
||||||
'[Unit]' \
|
'[Unit]' \
|
||||||
'Description=OpenVPN Installation Test' \
|
'Description=OpenVPN Installation Test' \
|
||||||
@@ -79,6 +80,7 @@ RUN printf '%s\n' \
|
|||||||
'[Service]' \
|
'[Service]' \
|
||||||
'Type=oneshot' \
|
'Type=oneshot' \
|
||||||
'Environment=HOME=/root' \
|
'Environment=HOME=/root' \
|
||||||
|
'PassEnvironment=AUTH_MODE TLS_SIG TLS_KEY_FILE TLS_VERSION_MIN TLS13_CIPHERSUITES CLIENT_IPV6 VPN_SUBNET_IPV6' \
|
||||||
'WorkingDirectory=/root' \
|
'WorkingDirectory=/root' \
|
||||||
'ExecStart=/entrypoint.sh' \
|
'ExecStart=/entrypoint.sh' \
|
||||||
'RemainAfterExit=yes' \
|
'RemainAfterExit=yes' \
|
||||||
|
|||||||
Reference in New Issue
Block a user