From 152343e22124d02712c4d9847bc46dbe700a46c1 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Fri, 3 Jun 2022 13:12:22 +0200 Subject: [PATCH] Fix statistics system test on Oracle Linux 7 The statistics system test fails on Oracle Linux 7 when libxml2, Curl, and xsltproc are present: I:statistics:checking bind9.xsl vs xml (17) diff: curl.out.17.xsl: No such file or directory tests.sh: line 183: curl.out.17.xml: No such file or directory cp: cannot stat 'curl.out.17.xml': No such file or directory grep: xsltproc.out.17: No such file or directory This is because the Oracle Linux 7 Curl does not know about the --http1.1 option and silently fails with: + /usr/bin/curl --http1.1 http://10.53.0.3:7252 curl: option --http1.1: is unknown curl: try 'curl --help' or 'curl --manual' for more information The following test "checking bind9.xml socket statistics" then needs to check for existence of stats.xml.out file which is artifact of the previous test. (cherry picked from commit 49cb8969292b4acec61ca2b2ea10f56522bfc2fe) --- bin/tests/system/statistics/tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/statistics/tests.sh b/bin/tests/system/statistics/tests.sh index 4d36120dfd..02125ae772 100644 --- a/bin/tests/system/statistics/tests.sh +++ b/bin/tests/system/statistics/tests.sh @@ -170,7 +170,7 @@ n=`expr $n + 1` ret=0 echo_i "checking bind9.xsl vs xml ($n)" -if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; then +if $FEATURETEST --have-libxml2 && "${CURL}" --http1.1 http://10.53.0.3:${EXTRAPORT1} > /dev/null 2>&1 && [ -x "${XSLTPROC}" ] ; then $DIGCMD +notcp +recurse @10.53.0.3 soa . > dig.out.test$n.1 2>&1 $DIGCMD +notcp +recurse @10.53.0.3 soa example > dig.out.test$n.2 2>&1 # check multiple requests over the same socket @@ -220,7 +220,7 @@ if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; th grep "

Memory Usage Summary

" xsltproc.out.${n} >/dev/null || ret=1 grep "

Memory Contexts

" xsltproc.out.${n} >/dev/null || ret=1 else - echo_i "skipping test as libxml2 and/or curl and/or xsltproc was not found" + echo_i "skipping test as libxml2 and/or curl with HTTP/1.1 support and/or xsltproc was not found" fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -228,7 +228,7 @@ n=`expr $n + 1` ret=0 echo_i "checking bind9.xml socket statistics ($n)" -if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; then +if $FEATURETEST --have-libxml2 && [ -e stats.xml.out ] && [ -x "${XSLTPROC}" ] ; then # Socket statistics (expect no errors) grep "0" stats.xml.out >/dev/null || ret=1 grep "0" stats.xml.out >/dev/null || ret=1 @@ -244,7 +244,7 @@ if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; th grep "0" stats.xml.out >/dev/null || ret=1 grep "0" stats.xml.out >/dev/null || ret=1 else - echo_i "skipping test as libxml2 and/or curl and/or xsltproc was not found" + echo_i "skipping test as libxml2 and/or stats.xml.out file and/or xsltproc was not found" fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret`