From a5d56f1cb7c64096a08eba5d3784e02a5d6ccbbd Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Sun, 15 Nov 2020 17:00:35 +0100 Subject: [PATCH] disable IPv6 restconf test by default --- test/lib.sh | 3 +-- test/test_restconf.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/lib.sh b/test/lib.sh index 6569bb15..26d3a496 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -42,8 +42,7 @@ if [ -f ./config.sh ]; then fi # Sanity nginx running on systemd platforms -# ./lib.sh: line 45: systemctl: command not found -if systemctl > /dev/null; then +if systemctl > /dev/null 2>&1 ; then nginxactive=$(systemctl show nginx |grep ActiveState=active) if [ "${WITH_RESTCONF}" = "fcgi" ]; then if [ -z "$nginxactive" ]; then diff --git a/test/test_restconf.sh b/test/test_restconf.sh index a1dfbce0..92e36435 100755 --- a/test/test_restconf.sh +++ b/test/test_restconf.sh @@ -10,6 +10,7 @@ # - evhtp: generate self-signed server certs # (3) IPv4/IPv6 (only loopback 127.0.0.1 / ::1) # - The tests runs through both +# - IPv6 by default disabled since docker does not support it out-of-the box # (4) local/backend config. Evhtp only # - The tests runs through both (if compiled with evhtp) # See also test_restconf2.sh @@ -21,6 +22,9 @@ APPNAME=example cfg=$dir/conf.xml +# Must explicitly enable IPv6 testing +: ${IPv6:=false} + # Use yang in example cat < $cfg @@ -372,7 +376,11 @@ if [ "${WITH_RESTCONF}" = "evhtp" ]; then protos="$protos https" fi for proto in $protos; do - for addr in 127.0.0.1 "\[::1\]"; do + addrs="127.0.0.1" + if $IPv6 ; then + addrs="$addrs \[::1\]" + fi + for addr in $addrs; do configs="local" if [ "${WITH_RESTCONF}" = "evhtp" ]; then # backend config retrieval only implemented for evhtp