This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 3/4] binutils/testsuite: Store server database in tmpdir
- From: Aaron Merey <amerey at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 16 Jan 2020 22:32:48 -0500
- Subject: [PATCH 3/4] binutils/testsuite: Store server database in tmpdir
binutils/testsuite: Store server database in tmpdir.
Specify tmpdir as the location of the server's database.
Otherwise it will be written to $HOME, the default location.
* binutils/testsuite/binutils-all/debuginfod.exp:
Specify tmpdir as the location of the server's
database.
---
binutils/testsuite/binutils-all/debuginfod.exp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/binutils/testsuite/binutils-all/debuginfod.exp b/binutils/testsuite/binutils-all/debuginfod.exp
index 200224f75b..42a861d084 100644
--- a/binutils/testsuite/binutils-all/debuginfod.exp
+++ b/binutils/testsuite/binutils-all/debuginfod.exp
@@ -75,8 +75,8 @@ if { ![binutils_assemble $srcdir/$subdir/linkdebug.s tmpdir/linkdebug.debug] } {
# Find an unused port
set port [exec sh -c "while true; do PORT=`expr '(' \$RANDOM % 1000 ')' + 9000`; ss -atn | fgrep \":\$PORT\" || break; done; echo \$PORT"]
-# Specify the directory that files retrieved from the server are written to.
set cache [file join [pwd] "tmpdir/.debuginfod_cache"]
+set db [file join [pwd] "tmpdir/.debuginfod.db"]
setenv DEBUGINFOD_URLS ""
setenv DEBUGINFOD_TIMEOUT 30
@@ -88,8 +88,9 @@ file mkdir tmpdir/dbg
file rename -force tmpdir/testprog.debug tmpdir/dbg
file rename -force tmpdir/linkdebug.debug tmpdir/dbg
-# Remove an old cache if it exists
+# Remove old cache and database if they exist.
file delete -force $cache
+file delete -force $db
# Check whether objdump and readelf are configured with debuginfod.
# To check this we attempt to follow a broken debuglink. If configured
@@ -114,7 +115,7 @@ proc sigint_handler {} {
trap sigint_handler INT
# Start a debuginfod server.
-set debuginfod_pid [exec debuginfod -p $port -F tmpdir/dbg 2>/dev/null &]
+set debuginfod_pid [exec debuginfod -d $db -p $port -F tmpdir/dbg 2>/dev/null &]
if { !$debuginfod_pid } {
fail "$test (server init)"
@@ -187,5 +188,4 @@ if { [regexp ".*DEBUGINFOD.*" $conf_readelf] } {
untested "$test (readelf not configured with debuginfod)"
}
-file delete -force $cache
catch {exec kill -INT $debuginfod_pid}
--
2.23.0