summaryrefslogtreecommitdiff
path: root/tests/run-debuginfod-find-metadata.sh
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2023-04-12 15:04:07 -0400
committerFrank Ch. Eigler <fche@redhat.com>2023-04-12 15:04:07 -0400
commit841b54b767c8cfd44f3e00093bc555be1bd5f937 (patch)
tree113487985609766b6f45ff1c03b5121288085737 /tests/run-debuginfod-find-metadata.sh
parentf8f563a6aabc0310d6a351cc0d9b322296a52dce (diff)
downloadelfutils-841b54b767c8cfd44f3e00093bc555be1bd5f937.tar.gz
add back "archive" response jsonusers/fche/try-pr29472d
Diffstat (limited to 'tests/run-debuginfod-find-metadata.sh')
-rwxr-xr-xtests/run-debuginfod-find-metadata.sh7
1 files changed, 4 insertions, 3 deletions
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"`