summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOmar Sandoval <[email protected]>2024-07-23 15:35:37 -0700
committerAaron Merey <[email protected]>2024-07-24 18:13:40 -0400
commit64186d7548db976caffa9d2ba210eed66cdc808f (patch)
treedbba025ded2af2788bd4982cc7a4b1bc8a8c17d6 /tests
parenta49d5c0e6dee7026c54699f6024ecd0a22a9aa5b (diff)
debuginfod: fix skipping <built-in> source file
dwarf_extract_source_paths explicitly skips source files that equal "<built-in>", but dwarf_filesrc may return a path like "dir/<built-in>". Check for and skip that case, too. In particular, the test debuginfod RPMs have paths like this. However, the test cases didn't catch this because they have a bug, too: they follow symlinks, which results in double-counting every file. Fix that, too. Signed-off-by: Omar Sandoval <[email protected]>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run-debuginfod-archive-groom.sh2
-rwxr-xr-xtests/run-debuginfod-extraction.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/run-debuginfod-archive-groom.sh b/tests/run-debuginfod-archive-groom.sh
index e2c394ef..0131158f 100755
--- a/tests/run-debuginfod-archive-groom.sh
+++ b/tests/run-debuginfod-archive-groom.sh
@@ -109,7 +109,7 @@ for i in $newrpms; do
rpm2cpio ../$i | cpio -ivd;
cd ..;
done
-sourcefiles=$(find -name \*\\.debug \
+sourcefiles=$(find -name \*\\.debug -type f \
| env LD_LIBRARY_PATH=$ldpath xargs \
${abs_top_builddir}/src/readelf --debug-dump=decodedline \
| grep mtime: | wc --lines)
diff --git a/tests/run-debuginfod-extraction.sh b/tests/run-debuginfod-extraction.sh
index da6b25cf..f49dc6f6 100755
--- a/tests/run-debuginfod-extraction.sh
+++ b/tests/run-debuginfod-extraction.sh
@@ -94,7 +94,7 @@ for i in $newrpms; do
rpm2cpio ../$i | cpio -ivd;
cd ..;
done
-sourcefiles=$(find -name \*\\.debug \
+sourcefiles=$(find -name \*\\.debug -type f \
| env LD_LIBRARY_PATH=$ldpath xargs \
${abs_top_builddir}/src/readelf --debug-dump=decodedline \
| grep mtime: | wc --lines)