From 4ef189df49a8f329db34aa473860ecbaa4e96a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 2 Jan 2020 11:45:12 +0100 Subject: [PATCH 1/3] Add all.sh components with ZLIB enabled ZLIB support is deprecated, but until it's removed it should still be tested. --- tests/scripts/all.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 8f25c6b29..873b2bc7b 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -652,6 +652,31 @@ component_test_full_cmake_gcc_asan () { if_build_succeeded tests/compat.sh } +component_test_zlib_make() { + msg "build: zlib enabled, make" + scripts/config.pl set MBEDTLS_ZLIB_SUPPORT + make ZLIB=1 CFLAGS='-Werror -O1' + + msg "test: main suites (zlib, make)" + make test + + msg "test: ssl-opt.sh (zlib, make)" + if_build_succeeded tests/ssl-opt.sh +} + +component_test_zlib_cmake() { + msg "build: zlib enabled, cmake" + scripts/config.pl set MBEDTLS_ZLIB_SUPPORT + cmake -D ENABLE_ZLIB_SUPPORT=On -D CMAKE_BUILD_TYPE:String=Check . + make + + msg "test: main suites (zlib, cmake)" + make test + + msg "test: ssl-opt.sh (zlib, cmake)" + if_build_succeeded tests/ssl-opt.sh +} + component_test_ref_configs () { msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . From 95a17fbe172654c4c54acb032852d3d5d432fab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 2 Jan 2020 11:58:00 +0100 Subject: [PATCH 2/3] Add test for record compression in ssl-opt.sh Deprecated but still needs to be tested. --- tests/ssl-opt.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index fa334c38b..9384d6ccb 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -905,6 +905,18 @@ run_test "Default, DTLS" \ -s "Protocol is DTLSv1.2" \ -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" +requires_config_enabled MBEDTLS_ZLIB_SUPPORT +run_test "Default (compression enabled)" \ + "$P_SRV debug_level=3" \ + "$P_CLI debug_level=3" \ + 0 \ + -s "Allocating compression buffer" \ + -c "Allocating compression buffer" \ + -s "Record expansion is unknown (compression)" \ + -c "Record expansion is unknown (compression)" \ + -S "error" \ + -C "error" + # Test current time in ServerHello requires_config_enabled MBEDTLS_HAVE_TIME run_test "ServerHello contains gmt_unix_time" \ From 114d339756a1f77c21ef585d871dcae3d4222d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 24 Jan 2020 10:17:20 +0100 Subject: [PATCH 3/3] Add detection for zlib headers to all.sh --- tests/scripts/all.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 873b2bc7b..ee0547c46 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -663,6 +663,17 @@ component_test_zlib_make() { msg "test: ssl-opt.sh (zlib, make)" if_build_succeeded tests/ssl-opt.sh } +support_test_zlib_make () { + base=support_test_zlib_$$ + cat <<'EOF' > ${base}.c +#include "zlib.h" +int main(void) { return 0; } +EOF + gcc -o ${base}.exe ${base}.c -lz 2>/dev/null + ret=$? + rm -f ${base}.* + return $ret +} component_test_zlib_cmake() { msg "build: zlib enabled, cmake" @@ -676,6 +687,9 @@ component_test_zlib_cmake() { msg "test: ssl-opt.sh (zlib, cmake)" if_build_succeeded tests/ssl-opt.sh } +support_test_zlib_cmake () { + support_test_zlib_make "$@" +} component_test_ref_configs () { msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s