From: Frank Ch. Eigler Date: Mon, 3 Feb 2020 19:11:53 +0000 (-0500) Subject: debuginfod test: assert curl & rpm2cpio during test prologue X-Git-Tag: elfutils-0.179~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b260496cedbdec7615b01a5634fb416c18733a11;p=thirdparty%2Felfutils.git debuginfod test: assert curl & rpm2cpio during test prologue On debian & ubuntu hosts, rpm2cpio is not available by default, and heck, curl might not be either. Check for both these programs during tests/run-debuginfod-find.sh startup, else exit-77 (skip). Signed-off-by: Frank Ch. Eigler --- diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh index 83ab3388f..6b5dbf842 100755 --- a/tests/run-debuginfod-find.sh +++ b/tests/run-debuginfod-find.sh @@ -18,6 +18,9 @@ . $srcdir/test-subr.sh # includes set -e +type curl 2>/dev/null || (echo "need curl"; exit 77) +type rpm2cpio 2>/dev/null || (echo "need rpm2cpio"; exit 77) + # for test case debugging, uncomment: # set -x # VERBOSE=-vvvv @@ -330,15 +333,13 @@ testrun ${abs_builddir}/debuginfod_build_id_find -e F/prog2 1 ######################################################################## -# Fetch some metrics, if curl program is installed -if type curl 2>/dev/null; then - curl -s http://127.0.0.1:$PORT1/badapi - curl -s http://127.0.0.1:$PORT1/metrics - curl -s http://127.0.0.1:$PORT2/metrics - curl -s http://127.0.0.1:$PORT1/metrics | grep -q 'http_responses_total.*result.*error' - curl -s http://127.0.0.1:$PORT1/metrics | grep -q 'http_responses_total.*result.*fdcache' - curl -s http://127.0.0.1:$PORT2/metrics | grep -q 'http_responses_total.*result.*upstream' -fi +# Fetch some metrics +curl -s http://127.0.0.1:$PORT1/badapi +curl -s http://127.0.0.1:$PORT1/metrics +curl -s http://127.0.0.1:$PORT2/metrics +curl -s http://127.0.0.1:$PORT1/metrics | grep -q 'http_responses_total.*result.*error' +curl -s http://127.0.0.1:$PORT1/metrics | grep -q 'http_responses_total.*result.*fdcache' +curl -s http://127.0.0.1:$PORT2/metrics | grep -q 'http_responses_total.*result.*upstream' ########################################################################