]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
automatically disable pppd tests if socat or pppd are missing
authorDaniel Lenski <dlenski@gmail.com>
Mon, 22 Feb 2021 07:14:00 +0000 (23:14 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 29 Mar 2021 02:27:01 +0000 (19:27 -0700)
This way, we can also automatically ENABLE them as soon as they're built into CI images.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
.gitlab-ci.yml
configure.ac

index 69993c080b44bee597a142213a317cdd5bbcab84..bbb0ce85fdc3f1f14b8ce78604e9c49dfea402bc 100644 (file)
@@ -51,7 +51,7 @@ CentOS8/GnuTLS:
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS8_BUILD
   script:
   - ./autogen.sh
-  - ./configure --with-java --without-gnutls-version-check --disable-dsa-tests CFLAGS=-g
+  - ./configure --with-java --without-gnutls-version-check --disable-dsa-tests --enable-ppp-tests CFLAGS=-g
   - make -j4
 # UTF-8 support is not available
   - make VERBOSE=1 XFAIL_TESTS="auth-nonascii" -j4 check
@@ -70,7 +70,7 @@ CentOS8/OpenSSL:
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS8_BUILD
   script:
   - ./autogen.sh
-  - ./configure --without-gnutls --with-openssl --with-java --without-openssl-version-check --disable-dsa-tests CFLAGS=-g
+  - ./configure --without-gnutls --with-openssl --with-java --without-openssl-version-check --disable-dsa-tests --enable-ppp-tests CFLAGS=-g
   - make -j4
 # UTF-8 support is not available
 # OpenSSL 1.1.0 disables 3DES and RC4 by default (https://www.openssl.org/blog/blog/2016/08/24/sweet32/)
@@ -90,7 +90,7 @@ CentOS6/OpenSSL:
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS6_BUILD
   script:
   - ./autogen.sh
-  - ./configure --with-java --without-openssl-version-check --enable-dtls-xfail CFLAGS=-g
+  - ./configure --with-java --without-openssl-version-check --enable-dtls-xfail --enable-ppp-tests CFLAGS=-g
   - make -j4
 # UTF-8 support is not available
   - make VERBOSE=1 XFAIL_TESTS="bad_dtls_test auth-nonascii" -j4 check
index b8d97d54d6e89af93be0bed85684ed6eae27efd9..2b5ca0e1b9813674ed3fe4634c8d70e839cbe986 100644 (file)
@@ -647,7 +647,6 @@ AM_CONDITIONAL(TEST_DSA, [test "$enable_dsa_tests" = "yes"])
 AC_ARG_ENABLE([ppp-tests],
        AS_HELP_STRING([--enable-ppp-tests], [Enable PPP tests (which require socat and pppd, and must run as root)]),
        [enable_ppp_tests=yes])
-AM_CONDITIONAL(TEST_PPP, [test "$enable_ppp_tests" = "yes"])
 
 AM_CONDITIONAL(OPENCONNECT_GNUTLS,  [ test "$ssl_library" = "GnuTLS" ])
 AM_CONDITIONAL(OPENCONNECT_OPENSSL, [ test "$ssl_library" = "OpenSSL" ])
@@ -1068,6 +1067,16 @@ AM_CONDITIONAL(BUILD_WWW, [test "${build_www}" = "yes"])
 PKG_CHECK_MODULES([CWRAP], [uid_wrapper, socket_wrapper], have_cwrap=yes, have_cwrap=no)
 AM_CONDITIONAL(HAVE_CWRAP, test "x$have_cwrap" != xno)
 
+if test "$enable_ppp_tests" = "yes"; then
+    AC_PATH_PROGS(SOCAT, [socat], [], $PATH:/bin:/usr/bin)
+    AC_PATH_PROGS(PPPD, [pppd], [], $PATH:/bin:/usr/bin:/sbin:/usr/sbin/)
+    if test -z "${ac_cv_path_SOCAT}" -o -z "${ac_cv_path_PPPD}"; then
+       AC_MSG_WARN([socat and/or pppd not found; disabling PPP tests])
+       enable_ppp_tests=no
+    fi
+fi
+AM_CONDITIONAL(TEST_PPP, [test "$enable_ppp_tests" = "yes"])
+
 have_netns=no
 AC_PATH_PROG(NUTTCP, nuttcp)
 if test -n "$ac_cv_path_NUTTCP"; then