summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2020-02-05 22:22:13 -0500
committerFrank Ch. Eigler <fche@redhat.com>2020-02-10 11:10:12 -0500
commitad09e791320d13149854ce7a0529842ea0d41a3d (patch)
treea7c63d1ae53a1c3ae798ff3b67800c708de38967
parent0245c6ed65a80bceb105317525f0cf38bf27b623 (diff)
downloadelfutils-ad09e791320d13149854ce7a0529842ea0d41a3d.tar.gz
debuginfod: testsuite for general archive (arch-linux) support
Tested analogously to how RPMs are. Signed-Off-By: Frank Ch. Eigler <fche@redhat.com>
-rw-r--r--tests/ChangeLog8
-rw-r--r--tests/Makefile.am7
-rwxr-xr-xtests/run-debuginfod-find.sh16
3 files changed, 25 insertions, 6 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 6baf97b8..84953adb 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,6 +1,12 @@
+2020-02-05 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfo-tars/*: New test files from Eli Schwartz of ArchLinux.
+ * Makefile.am (EXTRA_DIST): Package them.
+ * run-debuginfod-find.sh: Run basic archive extraction tests.
+
2020-02-03 Frank Ch. Eigler <fche@redhat.com>
- * run-debuginfod.find.sh: Protect against missing curl & rpm2cpio.
+ * run-debuginfod-find.sh: Protect against missing curl & rpm2cpio.
2020-01-19 Frank Ch. Eigler <fche@redhat.com>
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 21b25986..19df44b6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -468,7 +468,12 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
debuginfod-debs/hithere_1.0-1.debian.tar.xz \
debuginfod-debs/hithere_1.0-1.dsc \
debuginfod-debs/hithere_1.0-1_amd64.deb \
- debuginfod-debs/hithere_1.0.orig.tar.gz
+ debuginfod-debs/hithere_1.0.orig.tar.gz \
+ debuginfod-tars/hello-1-1-x86_64.pkg.tar.xz \
+ debuginfod-tars/hello-debug-1-1-x86_64.pkg.tar.bz2 \
+ debuginfod-tars/pacman-sources/PKGBUILD \
+ debuginfod-tars/pacman-sources/README.md \
+ debuginfod-tars/pacman-sources/hello.c
diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh
index 6b5dbf84..939826cd 100755
--- a/tests/run-debuginfod-find.sh
+++ b/tests/run-debuginfod-find.sh
@@ -20,6 +20,7 @@
type curl 2>/dev/null || (echo "need curl"; exit 77)
type rpm2cpio 2>/dev/null || (echo "need rpm2cpio"; exit 77)
+type bzcat 2>/dev/null || (echo "need bzcat"; exit 77)
# for test case debugging, uncomment:
# set -x
@@ -39,7 +40,7 @@ cleanup()
if [ $PID2 -ne 0 ]; then kill $PID2; wait $PID2; fi
if [ $PID3 -ne 0 ]; then kill $PID3; wait $PID3; fi
- rm -rf F R D L ${PWD}/.client_cache*
+ rm -rf F R D L Z ${PWD}/.client_cache*
exit_cleanup
}
@@ -61,8 +62,8 @@ done
# So we gather the LD_LIBRARY_PATH with this cunning trick:
ldpath=`testrun sh -c 'echo $LD_LIBRARY_PATH'`
-mkdir F R L D
-# not tempfiles F R L D - they are directories which we clean up manually
+mkdir F R L D Z
+# not tempfiles F R L D Z - they are directories which we clean up manually
ln -s ${abs_builddir}/dwfllines L/foo # any program not used elsewhere in this test
wait_ready()
@@ -92,7 +93,7 @@ wait_ready()
fi
}
-env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -R -d $DB -p $PORT1 -t0 -g0 --fdcache-fds 1 --fdcache-mbs 2 R F L &
+env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -R -d $DB -p $PORT1 -t0 -g0 --fdcache-fds 1 --fdcache-mbs 2 -Z .tar.xz -Z .tar.bz2=bzcat R F Z L &
PID1=$!
# Server must become ready
wait_ready $PORT1 'ready' 1
@@ -177,10 +178,15 @@ filename=`testrun ${abs_top_builddir}/debuginfod/debuginfod-find source $BUILDID
cmp $filename ${PWD}/prog2.c
cp -rvp ${abs_srcdir}/debuginfod-rpms R
+cp -rvp ${abs_srcdir}/debuginfod-tars Z
kill -USR1 $PID1
# All rpms need to be in the index
rpms=$(find R -name \*rpm | wc -l)
wait_ready $PORT1 'scanned_total{source=".rpm archive"}' $rpms
+txz=$(find Z -name \*tar.xz | wc -l)
+wait_ready $PORT1 'scanned_total{source=".tar.xz archive"}' $txz
+tb2=$(find Z -name \*tar.bz2 | wc -l)
+wait_ready $PORT1 'scanned_total{source=".tar.bz2 archive"}' $tb2
kill -USR1 $PID1 # two hits of SIGUSR1 may be needed to resolve .debug->dwz->srefs
# Expect all source files found in the rpms (they are all called hello.c :)
@@ -249,6 +255,8 @@ archive_test f0aa15b8aba4f3c28cac3c2a73801fefa644a9f2 /usr/src/debug/hello-1.0/h
# rhel6
archive_test bbbf92ebee5228310e398609c23c2d7d53f6e2f9 /usr/src/debug/hello-1.0/hello.c $SHA
archive_test d44d42cbd7d915bc938c81333a21e355a6022fb7 /usr/src/debug/hello-1.0/hello.c $SHA
+# arch
+archive_test cee13b2ea505a7f37bd20d271c6bc7e5f8d2dfcb /usr/src/debug/hello.c 7a1334e086b97e5f124003a6cfb3ed792d10cdf4
RPM_BUILDID=d44d42cbd7d915bc938c81333a21e355a6022fb7 # in rhel6/ subdir, for a later test