]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix pfs test for out-of-tree builds
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 26 Mar 2021 14:52:40 +0000 (14:52 +0000)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 26 Mar 2021 14:55:50 +0000 (14:55 +0000)
Originally we generated config files from autoconf, so we had:
 • ${srcdir}/tests/configs/test-foo.in
 • ${builddir}/tests/configs/test-foo

Later, we wanted to generate files more dynamically at runtime with
different contents, so we added the update_config() function in
tests/common.sh which did its own substitution to a temporary file,
from
 • $(srcdir}/tests/configs/test-foo

The pfs and obsolete-server-crypto tests appear to use a broken hybrid
of the two, first creating ${builddir}/tests/configs/test-foo from
autoconf and then attempting to use ${srcdir}/tests/configs/test-foo
at runtime. The latter isn't going to exist if ${srcdir} != ${builddir}.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
configure.ac
tests/configs/test-obsolete-server-crypto.config [moved from tests/configs/test-obsolete-server-crypto.config.in with 94% similarity]

index e1dc907c82b9f69033453278b0fad082d56c2bf2..d1716dfe7235fa4531b63e390f27e7e11ad3290b 100644 (file)
@@ -1084,8 +1084,7 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
           $(top_srcdir)/openconnect.8.in \
           $(top_srcdir)/tests/softhsm2.conf.in \
           $(top_srcdir)/tests/configs/test-user-cert.config.in \
-          $(top_srcdir)/tests/configs/test-user-pass.config.in \
-          $(top_srcdir)/tests/configs/test-obsolete-server-crypto.config.in'])
+          $(top_srcdir)/tests/configs/test-user-pass.config.in'])
 
 RAWLINGUAS=`sed -e "/^#/d" -e "s/#.*//" "${srcdir}/po/LINGUAS"`
 # Remove newlines
@@ -1117,8 +1116,7 @@ AC_CONFIG_FILES(Makefile openconnect.pc po/Makefile www/Makefile \
                libopenconnect.map openconnect.8 www/styles/Makefile \
                www/inc/Makefile www/images/Makefile tests/Makefile \
                tests/softhsm2.conf tests/configs/test-user-cert.config \
-               tests/configs/test-user-pass.config \
-               tests/configs/test-obsolete-server-crypto.config)
+               tests/configs/test-user-pass.config)
 AC_OUTPUT
 
 AC_DEFUN([SUMMARY],
similarity index 94%
rename from tests/configs/test-obsolete-server-crypto.config.in
rename to tests/configs/test-obsolete-server-crypto.config
index e1ed797d3ac8961889e2f15d00f22b780caf998a..628e734d40784e8bc352ef6e5ed5ef6b86140d75 100644 (file)
@@ -2,7 +2,7 @@
 # all should succeed.
 # Options: certificate, pam. 
 #auth = "certificate"
-auth = "plain[@abs_top_srcdir@/tests/configs/test1.passwd]"
+auth = "plain[@SRCDIR@/configs/test1.passwd]"
 #auth = "pam"
 
 # A banner to be displayed on clients
@@ -48,8 +48,8 @@ try-mtu-discovery = false
 #
 # There may be multiple certificate and key pairs and each key
 # should correspond to the preceding certificate.
-server-cert = @abs_top_srcdir@/tests/certs/server-cert.pem
-server-key = @abs_top_srcdir@/tests/certs/server-key.pem
+server-cert = @SRCDIR@/certs/server-cert.pem
+server-key = @SRCDIR@/certs/server-key.pem
 
 # Diffie-Hellman parameters. Only needed if you require support
 # for the DHE ciphersuites (by default this server supports ECDHE).
@@ -75,7 +75,7 @@ server-key = @abs_top_srcdir@/tests/certs/server-key.pem
 # The Certificate Authority that will be used
 # to verify clients if certificate authentication
 # is set.
-ca-cert = @abs_top_srcdir@/tests/certs/ca.pem
+ca-cert = @SRCDIR@/certs/ca.pem
 
 # The object identifier that will be used to read the user ID in the client certificate.
 # The object identifier should be part of the certificate's DN
@@ -129,12 +129,12 @@ pid-file = ./ocserv.pid
 
 # socket file used for IPC, will be appended with .PID
 # It must be accessible within the chroot environment (if any)
-socket-file = ./ocserv-socket
+socket-file = @OCCTL_SOCKET@
 
 # The user the worker processes will be run as. It should be
 # unique (no other services run as this user).
-run-as-user = @OCSERV_USER@
-run-as-group = @OCSERV_GROUP@
+run-as-user = @USERNAME@
+run-as-group = @GROUP@
 
 # Network settings