From 841b54b767c8cfd44f3e00093bc555be1bd5f937 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 12 Apr 2023 15:04:07 -0400 Subject: add back "archive" response json --- tests/run-debuginfod-find-metadata.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/run-debuginfod-find-metadata.sh') diff --git a/tests/run-debuginfod-find-metadata.sh b/tests/run-debuginfod-find-metadata.sh index 2928f9a4..c378bcdd 100755 --- a/tests/run-debuginfod-find-metadata.sh +++ b/tests/run-debuginfod-find-metadata.sh @@ -26,7 +26,7 @@ type curl 2>/dev/null || { echo "need curl"; exit 77; } type jq 2>/dev/null || { echo "need jq"; exit 77; } pkg-config json-c libcurl || { echo "one or more libraries are missing (libjson-c, libcurl)"; exit 77; } -debuginfod-find --help 2>&1 | grep metadata || { echo "compiled without metadata support"; exit 77; } +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${VALGRIND_CMD} ${abs_builddir}/../debuginfod/debuginfod-find --help 2>&1 | grep metadata || { echo "compiled without metadata support"; exit 77; } DB=${PWD}/.debuginfod_tmp.sqlite @@ -79,9 +79,10 @@ test $N_FOUND -eq 2 # Query via the webapi as well -EXPECTED='[ { "type": "executable", "buildid": "f17a29b5a25bd4960531d82aa6b07c8abe84fa66", "file": "/usr/bin/hithere"} ]' curl http://127.0.0.1:$PORT2'/metadata?key=glob&value=/usr/bin/*hi*' -test `curl http://127.0.0.1:$PORT2'/metadata?key=glob&value=/usr/bin/*hi*' | jq ". == $EXPECTED" ` = 'true' +test `curl -s http://127.0.0.1:$PORT2'/metadata?key=glob&value=/usr/bin/*hi*' | jq '.[0].buildid == "f17a29b5a25bd4960531d82aa6b07c8abe84fa66"'` = 'true' +test `curl -s http://127.0.0.1:$PORT2'/metadata?key=glob&value=/usr/bin/*hi*' | jq '.[0].file == "/usr/bin/hithere"'` = 'true' +test `curl -s http://127.0.0.1:$PORT2'/metadata?key=glob&value=/usr/bin/*hi*' | jq '.[0].archive | test(".*hithere.*deb")'` = 'true' # An empty array is returned on server error or if the file DNE RESULTF=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod-find metadata file "/this/isnt/there"` -- cgit v1.2.1