aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml16
-rwxr-xr-xautogen.sh1
-rw-r--r--configure.seed28
-rw-r--r--tests/Makefile.am2
-rwxr-xr-xtests/do.sh.in (renamed from tests/do.sh)24
-rwxr-xr-xtests/do_valgrind.sh.in57
-rwxr-xr-xtests/vagrind_test.sh35
7 files changed, 114 insertions, 49 deletions
diff --git a/.travis.yml b/.travis.yml
index bf1128123..f4e0e06b3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,21 @@ matrix:
- autogen
- os: linux
+ env: DISABLE_GCRYPT=y
+ compiler: gcc
+ dist: bionic
+ addons:
+ apt:
+ packages:
+ - fakeroot
+ - debhelper
+ - dpkg-dev
+ - libpcap-dev
+ - libgcrypt20-dev
+ - libjson-c-dev
+ - autogen
+
+ - os: linux
compiler: clang
dist: bionic
addons:
@@ -197,6 +212,7 @@ script:
./configure ; fi
- if [ -n "$BUILD_DPKG_PACKAGE" ]; then cd ./packages/ubuntu ;
./configure && dpkg-buildpackage -b -us -uc ; cd ../.. ; fi
+ - if [ -n "$DISABLE_GCRYPT" ]; then ./configure --disable-gcrypt ; fi
- make
- make -C example ndpiSimpleIntegration
- make dist
diff --git a/autogen.sh b/autogen.sh
index 842dafeec..be307a2ff 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -57,6 +57,7 @@ autoreconf -ivf
cat configure | sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | sed "s/#define VERSION/#define NDPI_VERSION/g" > configure.tmp
cat configure.tmp > configure
+echo "./configure $@"
chmod +x configure
./configure $@
diff --git a/configure.seed b/configure.seed
index 3f7f6a92c..1e65e047d 100644
--- a/configure.seed
+++ b/configure.seed
@@ -189,23 +189,24 @@ AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"])
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
-if ! test "${with_mipsel+set}" = set; then :
dnl> GCRYPT
+GCRYPT_ENABLED=1
AC_ARG_ENABLE([gcrypt],
[AS_HELP_STRING([--disable-gcrypt], [Avoid compiling with libgcrypt/libgpg-error, even if they are present. QUIC sub-classification may be missing])],
- [:],
+ [GCRYPT_ENABLED=0],
[AC_CHECK_LIB(gcrypt, gcry_cipher_checktag)])
-if test "x$ac_cv_lib_gcrypt_gcry_cipher_checktag" = xyes; then :
- ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt"
-else
- $as_unset ac_cv_lib_gcrypt_gcry_cipher_checktag
- AC_CHECK_LIB(gpg-error, gpg_strerror_r)
- AC_CHECK_LIB(gcrypt, gcry_cipher_checktag)
- if test "x$ac_cv_lib_gcrypt_gcry_cipher_checktag" = xyes -a "x$ac_cv_lib_gpg_error_gpg_strerror_r" = xyes; then :
- ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt -lgpg-error"
+AS_IF([test "x$enable_gcrypt" = "xyes"], [
+ if test "x$ac_cv_lib_gcrypt_gcry_cipher_checktag" = xyes; then :
+ ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt"
+ else
+ $as_unset ac_cv_lib_gcrypt_gcry_cipher_checktag
+ AC_CHECK_LIB(gpg-error, gpg_strerror_r)
+ AC_CHECK_LIB(gcrypt, gcry_cipher_checktag)
+ if test "x$ac_cv_lib_gcrypt_gcry_cipher_checktag" = xyes -a "x$ac_cv_lib_gpg_error_gpg_strerror_r" = xyes; then :
+ ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt -lgpg-error"
+ fi
fi
-fi
-fi
+])
dnl> PCRE
AC_ARG_WITH(pcre, [ --with-pcre Enable nDPI build with libpcre])
@@ -218,6 +219,8 @@ fi
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile tests/unit/Makefile tests/dga/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile fuzz/Makefile src/include/ndpi_api.h])
+AC_CONFIG_FILES([tests/do.sh], [chmod +x tests/do.sh])
+AC_CONFIG_FILES([tests/do_valgrind.sh], [chmod +x tests/do_valgrind.sh])
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
AC_SUBST(GIT_RELEASE)
AC_SUBST(NDPI_MAJOR)
@@ -236,5 +239,6 @@ AC_SUBST(EXTRA_TARGETS)
AC_SUBST(BUILD_MINGW)
AC_SUBST(JSONC_CFLAGS)
AC_SUBST(JSONC_LIBS)
+AC_SUBST(GCRYPT_ENABLED)
AC_SUBST(GNU_PREFIX)
AC_OUTPUT
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 82625902c..271516b87 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
TESTS = do.sh
-EXTRA_DIST = do.sh vagrind_test.sh ossfuzz.sh pcap result
+EXTRA_DIST = ossfuzz.sh pcap result
all:
@echo -n ""
diff --git a/tests/do.sh b/tests/do.sh.in
index b24af5f1c..4894be0f4 100755
--- a/tests/do.sh
+++ b/tests/do.sh.in
@@ -2,11 +2,19 @@
cd "$(dirname "${0}")"
+GCRYPT_ENABLED=@GCRYPT_ENABLED@
+GCRYPT_PCAPS="gquic.pcap quic-23.pcap quic-24.pcap quic-27.pcap quic-28.pcap quic-29.pcap quic-mvfst-22.pcap quic-mvfst-27.pcap quic-mvfst-exp.pcap quic_q50.pcap quic_t50.pcap quic_t51.pcap quic_0RTT.pcap quic_interop_V.pcapng quic-33.pcapng doq.pcapng doq_adguard.pcapng dlt_ppp.pcap"
READER="../example/ndpiReader -p ../example/protos.txt -c ../example/categories.txt"
RC=0
PCAPS=`cd pcap; /bin/ls *.pcap *.pcapng`
+if [ ! -x "../example/ndpiReader" ]; then
+ echo "$0: Missing $(realpath ../example/ndpiReader)"
+ echo "$0: Run ./configure and make first"
+ exit 1
+fi
+
fuzzy_testing() {
if [ -f ../fuzz/fuzz_ndpi_reader ]; then
../fuzz/fuzz_ndpi_reader -max_total_time="${MAX_TOTAL_TIME:-592}" -print_pcs=1 -workers="${FUZZY_WORKERS:-0}" -jobs="${FUZZY_JOBS:-0}" pcap/
@@ -25,7 +33,21 @@ build_results() {
}
check_results() {
- for f in $PCAPS; do
+ for f in $PCAPS; do
+ SKIP_PCAP=0
+ if [ $GCRYPT_ENABLED -eq 0 ]; then
+ for g in $GCRYPT_PCAPS; do
+ if [ $f = $g ]; then
+ SKIP_PCAP=1
+ break
+ fi
+ done
+ fi
+ if [ $SKIP_PCAP -eq 1 ]; then
+ printf "%-32s\tSKIPPED\n" "$f"
+ continue
+ fi
+
if [ -f result/$f.out ]; then
CMD="$READER -q -t -i pcap/$f -w /tmp/reader.out -v 2"
$CMD
diff --git a/tests/do_valgrind.sh.in b/tests/do_valgrind.sh.in
new file mode 100755
index 000000000..8ab0509a8
--- /dev/null
+++ b/tests/do_valgrind.sh.in
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+cd "$(dirname "${0}")"
+
+GCRYPT_ENABLED=@GCRYPT_ENABLED@
+GCRYPT_PCAPS="gquic.pcap quic-23.pcap quic-24.pcap quic-27.pcap quic-28.pcap quic-29.pcap quic-mvfst-22.pcap quic-mvfst-27.pcap quic-mvfst-exp.pcap quic_q50.pcap quic_t50.pcap quic_t51.pcap quic_0RTT.pcap quic_interop_V.pcapng quic-33.pcapng doq.pcapng doq_adguard.pcapng dlt_ppp.pcap"
+READER="valgrind -q --leak-check=full ../example/ndpiReader -p ../example/protos.txt -c ../example/categories.txt"
+
+RC=0
+PCAPS=`cd pcap; /bin/ls *.pcap`
+
+if [ ! -x "../example/ndpiReader" ]; then
+ echo "$0: Missing $(realpath ../example/ndpiReader)"
+ echo "$0: Run ./configure and make first"
+ exit 1
+fi
+
+check_results() {
+ for f in $PCAPS; do
+ SKIP_PCAP=0
+ if [ $GCRYPT_ENABLED -eq 0 ]; then
+ for g in $GCRYPT_PCAPS; do
+ if [ $f = $g ]; then
+ SKIP_PCAP=1
+ break
+ fi
+ done
+ fi
+ if [ $SKIP_PCAP -eq 1 ]; then
+ printf "%-32s\tSKIPPED\n" "$f"
+ continue
+ fi
+
+ CMD="$READER -q -i pcap/$f > /tmp/reader.out"
+ $CMD
+ NUM_DIFF=0
+
+ if [ -f /tmp/reader.out ]; then
+ NUM_DIFF=`wc -l /tmp/reader.out`
+ fi
+
+ if [ $NUM_DIFF -eq 0 ]; then
+ printf "%-32s\tOK\n" "$f"
+ else
+ printf "%-32s\tERROR\n" "$f"
+ echo "$CMD"
+ cat /tmp/reader.out
+ RC=1
+ fi
+
+ /bin/rm -f /tmp/reader.out
+ done
+}
+
+check_results
+
+exit $RC
diff --git a/tests/vagrind_test.sh b/tests/vagrind_test.sh
deleted file mode 100755
index 01d76e6a4..000000000
--- a/tests/vagrind_test.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-cd "$(dirname "${0}")"
-
-READER="valgrind -q --leak-check=full ../example/ndpiReader -p ../example/protos.txt -c ../example/categories.txt"
-
-RC=0
-PCAPS=`cd pcap; /bin/ls *.pcap`
-
-check_results() {
- for f in $PCAPS; do
- CMD="$READER -q -i pcap/$f > /tmp/reader.out"
- $CMD
- NUM_DIFF=0
-
- if [ -f /tmp/reader.out ]; then
- NUM_DIFF=`wc -l /tmp/reader.out`
- fi
-
- if [ $NUM_DIFF -eq 0 ]; then
- printf "%-32s\tOK\n" "$f"
- else
- printf "%-32s\tERROR\n" "$f"
- echo "$CMD"
- cat /tmp/reader.out
- RC=1
- fi
-
- /bin/rm -f /tmp/reader.out
- done
-}
-
-check_results
-
-exit $RC