From 27c83dcf421b56e310982c916c24377043fe38cb Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 20 Jan 2019 06:09:47 +0100 Subject: [PATCH] tests: consistently disable isolate-workers in tests That is to prevent coverage reporting in tests. Signed-off-by: Nikos Mavrogiannopoulos --- .gitlab-ci.yml | 4 ++-- tests/common.sh | 10 ++++++++++ tests/data/multiple-routes.config | 2 ++ tests/data/test-ban.config | 2 ++ tests/data/test-cert-opt-pass.config | 2 ++ tests/data/test-ciphers.config | 2 +- tests/data/test-compression-lz4.config | 2 +- tests/data/test-compression-lzs.config | 2 +- tests/data/test-cookie-invalidation.config | 2 ++ tests/data/test-cookie-timeout-2.config | 2 ++ tests/data/test-cookie-timeout.config | 2 ++ tests/data/test-ed25519.config | 2 ++ tests/data/test-enc-key.config | 2 ++ tests/data/test-enc-key2.config | 2 ++ tests/data/test-explicit-ip.config | 2 ++ tests/data/test-group-cert.config | 2 ++ tests/data/test-group-pass.config | 2 ++ tests/data/test-gssapi-local-map.config | 2 ++ tests/data/test-gssapi-opt-cert.config | 2 ++ tests/data/test-gssapi-opt-pass.config | 2 ++ tests/data/test-gssapi.config | 2 ++ tests/data/test-haproxy-auth.config | 2 ++ tests/data/test-haproxy-connect.config | 2 +- tests/data/test-iroute.config | 2 ++ tests/data/test-multi-cookie.config | 2 ++ tests/data/test-otp-cert.config | 2 ++ tests/data/test-otp.config | 2 ++ tests/data/test-pam-noauth.config | 2 ++ tests/data/test-pam.config | 2 ++ tests/data/test-pass-opt-cert.config | 2 ++ tests/data/test-pass-script.config | 2 ++ tests/data/test-rsa-pss.config | 2 ++ tests/data/test-san-cert.config | 2 ++ tests/data/test-sighup-key-change.config | 2 ++ tests/data/test-sighup.config | 2 ++ tests/data/test-stress.config | 2 ++ tests/data/test-traffic.config | 2 +- tests/data/test-user-cert.config | 2 ++ tests/data/test-user-config.config | 2 ++ tests/data/test-user-group-cert-no-pass.config | 2 ++ tests/data/test-user-group-cert.config | 2 ++ tests/data/test-vhost-pass-cert.config | 2 ++ tests/data/test1.config | 2 ++ tests/data/test3.config | 2 ++ tests/test-pass-cert | 1 + 45 files changed, 92 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 68a4bef1..27903ceb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,7 +67,7 @@ Build/Fedora: image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - git submodule update --init && autoreconf -fvi && - ./configure --disable-maintainer-mode --without-docker-tests --with-werror --enable-code-coverage && make -j$(nproc) && make check -j$(nproc) + ./configure --disable-maintainer-mode --without-docker-tests --with-werror --enable-code-coverage && make -j$(nproc) && make check -j$(nproc) COVERAGE=1 && make files-update && make dist && make local-code-coverage-output tags: - shared @@ -190,7 +190,7 @@ pages: stage: deploy image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: - mkdir -p public/coverage && make V=1 CODE_COVERAGE_OUTPUT_DIRECTORY=public/coverage CODE_COVERAGE_BRANCH_COVERAGE=1 code-coverage-capture && + - mkdir -p public/coverage && make V=1 CODE_COVERAGE_OUTPUT_DIRECTORY=public/coverage CODE_COVERAGE_BRANCH_COVERAGE=1 code-coverage-capture && make CODE_COVERAGE_OUTPUT_DIRECTORY=public/coverage local-code-coverage-output tags: - shared diff --git a/tests/common.sh b/tests/common.sh index 6424dbad..d057029f 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -49,10 +49,20 @@ update_config() { file=$1 username=$(whoami) group=$(groups|cut -f 1 -d ' ') + + if test -z "${ISOLATE_WORKERS}";then + if test "${COVERAGE}" = "1";then + ISOLATE_WORKERS=false + else + ISOLATE_WORKERS=true + fi + fi + cp "${srcdir}/data/${file}" "$file.$$.tmp" sed -i -e 's|@USERNAME@|'${username}'|g' "$file.$$.tmp" \ -e 's|@GROUP@|'${group}'|g' "$file.$$.tmp" \ -e 's|@SRCDIR@|'${srcdir}'|g' "$file.$$.tmp" \ + -e 's|@ISOLATE_WORKERS@|'${ISOLATE_WORKERS}'|g' "$file.$$.tmp" \ -e 's|@OTP_FILE@|'${OTP_FILE}'|g' "$file.$$.tmp" \ -e 's|@CRLNAME@|'${CRLNAME}'|g' "$file.$$.tmp" \ -e 's|@PORT@|'${PORT}'|g' "$file.$$.tmp" \ diff --git a/tests/data/multiple-routes.config b/tests/data/multiple-routes.config index 886941ce..75a5de70 100644 --- a/tests/data/multiple-routes.config +++ b/tests/data/multiple-routes.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-ban.config b/tests/data/test-ban.config index f52d2a47..5d457874 100644 --- a/tests/data/test-ban.config +++ b/tests/data/test-ban.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-cert-opt-pass.config b/tests/data/test-cert-opt-pass.config index b2995cb6..710a059a 100644 --- a/tests/data/test-cert-opt-pass.config +++ b/tests/data/test-cert-opt-pass.config @@ -5,6 +5,8 @@ auth = "certificate" enable-auth = "plain[passwd=@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-ciphers.config b/tests/data/test-ciphers.config index 100c92df..bfb02726 100644 --- a/tests/data/test-ciphers.config +++ b/tests/data/test-ciphers.config @@ -5,7 +5,7 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" -isolate-workers = false +isolate-workers = @ISOLATE_WORKERS@ max-ban-score = 0 diff --git a/tests/data/test-compression-lz4.config b/tests/data/test-compression-lz4.config index b86c3455..d750aac7 100644 --- a/tests/data/test-compression-lz4.config +++ b/tests/data/test-compression-lz4.config @@ -5,7 +5,7 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" -isolate-workers = false +isolate-workers = @ISOLATE_WORKERS@ max-ban-score = 0 diff --git a/tests/data/test-compression-lzs.config b/tests/data/test-compression-lzs.config index 84994676..d5f4d7a8 100644 --- a/tests/data/test-compression-lzs.config +++ b/tests/data/test-compression-lzs.config @@ -5,7 +5,7 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" -isolate-workers = false +isolate-workers = @ISOLATE_WORKERS@ max-ban-score = 0 diff --git a/tests/data/test-cookie-invalidation.config b/tests/data/test-cookie-invalidation.config index 2cc79d78..74f05cdf 100644 --- a/tests/data/test-cookie-invalidation.config +++ b/tests/data/test-cookie-invalidation.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-cookie-timeout-2.config b/tests/data/test-cookie-timeout-2.config index 05a985ac..dc443c39 100644 --- a/tests/data/test-cookie-timeout-2.config +++ b/tests/data/test-cookie-timeout-2.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-cookie-timeout.config b/tests/data/test-cookie-timeout.config index c705bbb5..af01f4bb 100644 --- a/tests/data/test-cookie-timeout.config +++ b/tests/data/test-cookie-timeout.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-ed25519.config b/tests/data/test-ed25519.config index b67b5468..5e666182 100644 --- a/tests/data/test-ed25519.config +++ b/tests/data/test-ed25519.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + max-ban-score = 0 # A banner to be displayed on clients diff --git a/tests/data/test-enc-key.config b/tests/data/test-enc-key.config index 38a4fe78..0bb0aee6 100644 --- a/tests/data/test-enc-key.config +++ b/tests/data/test-enc-key.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-enc-key2.config b/tests/data/test-enc-key2.config index 9f083636..bfb6b694 100644 --- a/tests/data/test-enc-key2.config +++ b/tests/data/test-enc-key2.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-explicit-ip.config b/tests/data/test-explicit-ip.config index 8ca0785e..f2247a3f 100644 --- a/tests/data/test-explicit-ip.config +++ b/tests/data/test-explicit-ip.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-group-cert.config b/tests/data/test-group-cert.config index 0a5e86c4..d51d09a2 100644 --- a/tests/data/test-group-cert.config +++ b/tests/data/test-group-cert.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[./data/test-group.passwd]" #auth = "pam" +isolate-workers = false + select-group = group1 select-group = group2 diff --git a/tests/data/test-group-pass.config b/tests/data/test-group-pass.config index 5ea69761..54b75882 100644 --- a/tests/data/test-group-pass.config +++ b/tests/data/test-group-pass.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test-group.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-gssapi-local-map.config b/tests/data/test-gssapi-local-map.config index b6883480..a946099a 100644 --- a/tests/data/test-gssapi-local-map.config +++ b/tests/data/test-gssapi-local-map.config @@ -5,6 +5,8 @@ #auth = "plain[./data/test1.passwd]" auth = "gssapi" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-gssapi-opt-cert.config b/tests/data/test-gssapi-opt-cert.config index ac165d75..679205f4 100644 --- a/tests/data/test-gssapi-opt-cert.config +++ b/tests/data/test-gssapi-opt-cert.config @@ -6,6 +6,8 @@ auth = "gssapi[require-local-user-map=false]" enable-auth = certificate +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-gssapi-opt-pass.config b/tests/data/test-gssapi-opt-pass.config index 637cad4d..be25cabb 100644 --- a/tests/data/test-gssapi-opt-pass.config +++ b/tests/data/test-gssapi-opt-pass.config @@ -6,6 +6,8 @@ auth = "gssapi[require-local-user-map=false]" enable-auth = "plain[passwd=@SRCDIR@/data/test1.passwd]" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-gssapi.config b/tests/data/test-gssapi.config index 700576b4..77f004b1 100644 --- a/tests/data/test-gssapi.config +++ b/tests/data/test-gssapi.config @@ -5,6 +5,8 @@ #auth = "plain[./data/test1.passwd]" auth = "gssapi[require-local-user-map=false]" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-haproxy-auth.config b/tests/data/test-haproxy-auth.config index c65dbc56..67210167 100644 --- a/tests/data/test-haproxy-auth.config +++ b/tests/data/test-haproxy-auth.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + max-ban-score = 0 # A banner to be displayed on clients diff --git a/tests/data/test-haproxy-connect.config b/tests/data/test-haproxy-connect.config index d722de78..86c60e2c 100644 --- a/tests/data/test-haproxy-connect.config +++ b/tests/data/test-haproxy-connect.config @@ -5,7 +5,7 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" -isolate-workers = false +isolate-workers = @ISOLATE_WORKERS@ max-ban-score = 0 diff --git a/tests/data/test-iroute.config b/tests/data/test-iroute.config index b23f855a..e06a74f3 100644 --- a/tests/data/test-iroute.config +++ b/tests/data/test-iroute.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-multi-cookie.config b/tests/data/test-multi-cookie.config index 57c9a7e6..b6ee5788 100644 --- a/tests/data/test-multi-cookie.config +++ b/tests/data/test-multi-cookie.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-otp-cert.config b/tests/data/test-otp-cert.config index 32994334..62f0e60f 100644 --- a/tests/data/test-otp-cert.config +++ b/tests/data/test-otp-cert.config @@ -5,6 +5,8 @@ auth = "certificate" auth = "plain[passwd=@SRCDIR@/data/test-otp.passwd,otp=@OTP_FILE@]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-otp.config b/tests/data/test-otp.config index bfd0c7c5..d7f7c43d 100644 --- a/tests/data/test-otp.config +++ b/tests/data/test-otp.config @@ -5,6 +5,8 @@ auth = "plain[passwd=@SRCDIR@/data/test-otp.passwd,otp=@OTP_FILE@]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-pam-noauth.config b/tests/data/test-pam-noauth.config index c637a41a..c732471c 100644 --- a/tests/data/test-pam-noauth.config +++ b/tests/data/test-pam-noauth.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test-pam.passwd]" acct = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-pam.config b/tests/data/test-pam.config index 2c7bd9a9..95e20d6d 100644 --- a/tests/data/test-pam.config +++ b/tests/data/test-pam.config @@ -4,6 +4,8 @@ #auth = "certificate" auth = "pam[gid-min=1000]" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-pass-opt-cert.config b/tests/data/test-pass-opt-cert.config index a3b1ebbc..37d92615 100644 --- a/tests/data/test-pass-opt-cert.config +++ b/tests/data/test-pass-opt-cert.config @@ -5,6 +5,8 @@ auth = "plain[passwd=@SRCDIR@/data/test1.passwd]" enable-auth = "certificate" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-pass-script.config b/tests/data/test-pass-script.config index af5fbbd8..b7d44653 100644 --- a/tests/data/test-pass-script.config +++ b/tests/data/test-pass-script.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-rsa-pss.config b/tests/data/test-rsa-pss.config index 3d335bb3..bd4ec617 100644 --- a/tests/data/test-rsa-pss.config +++ b/tests/data/test-rsa-pss.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + max-ban-score = 0 # A banner to be displayed on clients diff --git a/tests/data/test-san-cert.config b/tests/data/test-san-cert.config index cb74ce97..c678429a 100644 --- a/tests/data/test-san-cert.config +++ b/tests/data/test-san-cert.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-sighup-key-change.config b/tests/data/test-sighup-key-change.config index 84f83bce..f0418f41 100644 --- a/tests/data/test-sighup-key-change.config +++ b/tests/data/test-sighup-key-change.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-sighup.config b/tests/data/test-sighup.config index ad9de58d..9c555679 100644 --- a/tests/data/test-sighup.config +++ b/tests/data/test-sighup.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-stress.config b/tests/data/test-stress.config index f3c7bda7..1602e5a5 100644 --- a/tests/data/test-stress.config +++ b/tests/data/test-stress.config @@ -5,6 +5,8 @@ auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-traffic.config b/tests/data/test-traffic.config index d39b616a..787cdc02 100644 --- a/tests/data/test-traffic.config +++ b/tests/data/test-traffic.config @@ -5,7 +5,7 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" -isolate-workers = false +isolate-workers = @ISOLATE_WORKERS@ max-ban-score = 0 diff --git a/tests/data/test-user-cert.config b/tests/data/test-user-cert.config index 4b9dba39..9b9ebfe8 100644 --- a/tests/data/test-user-cert.config +++ b/tests/data/test-user-cert.config @@ -5,6 +5,8 @@ auth = "certificate" auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-user-config.config b/tests/data/test-user-config.config index 2ef75b2e..1f26945c 100644 --- a/tests/data/test-user-config.config +++ b/tests/data/test-user-config.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[./data/test1.passwd]" #auth = "pam" +isolate-workers = false + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test-user-group-cert-no-pass.config b/tests/data/test-user-group-cert-no-pass.config index 4fc4152a..13b489bb 100644 --- a/tests/data/test-user-group-cert-no-pass.config +++ b/tests/data/test-user-group-cert-no-pass.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[@SRCDIR@/data/test-group.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + select-group = group1 select-group = group2 diff --git a/tests/data/test-user-group-cert.config b/tests/data/test-user-group-cert.config index ec5a0131..7999f2d8 100644 --- a/tests/data/test-user-group-cert.config +++ b/tests/data/test-user-group-cert.config @@ -5,6 +5,8 @@ auth = "certificate" auth = "plain[@SRCDIR@/data/test-group.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + select-group = group1 select-group = group2 diff --git a/tests/data/test-vhost-pass-cert.config b/tests/data/test-vhost-pass-cert.config index 848f590e..21bdfcb3 100644 --- a/tests/data/test-vhost-pass-cert.config +++ b/tests/data/test-vhost-pass-cert.config @@ -5,6 +5,8 @@ auth = "plain[passwd=@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/data/test1.config b/tests/data/test1.config index 42ee3e29..251a822b 100644 --- a/tests/data/test1.config +++ b/tests/data/test1.config @@ -5,6 +5,8 @@ auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + max-ban-score = 0 # A banner to be displayed on clients diff --git a/tests/data/test3.config b/tests/data/test3.config index fb4a9706..83eab956 100644 --- a/tests/data/test3.config +++ b/tests/data/test3.config @@ -5,6 +5,8 @@ auth = "certificate" #auth = "plain[@SRCDIR@/data/test1.passwd]" #auth = "pam" +isolate-workers = @ISOLATE_WORKERS@ + # A banner to be displayed on clients #banner = "Welcome" diff --git a/tests/test-pass-cert b/tests/test-pass-cert index 329d29f8..ab221776 100755 --- a/tests/test-pass-cert +++ b/tests/test-pass-cert @@ -22,6 +22,7 @@ SERV="${SERV:-../src/ocserv}" srcdir=${srcdir:-.} NO_NEED_ROOT=1 PORT=4445 +ISOLATE_WORKERS=false . `dirname $0`/common.sh