From b7ef2ed847e17dc169cfaf902d6c2eb2977ea067 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Sun, 21 Feb 2021 23:14:00 -0800 Subject: [PATCH] automatically disable pppd tests if socat or pppd are missing This way, we can also automatically ENABLE them as soon as they're built into CI images. Signed-off-by: Daniel Lenski --- .gitlab-ci.yml | 6 +++--- configure.ac | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69993c08..bbb0ce85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/configure.ac b/configure.ac index b8d97d54..2b5ca0e1 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -- 2.50.1