[2/4] binutils/testsuite: Prevent debuginfod server from querying itself

Message ID CAJDtP-TMpK999FfVpnL2fB3p11H-SfAw-65koa=8e5Vqm+-t8A@mail.gmail.com
State New
Headers show
Series
  • [1/4] binutils/testsuite: Replace set ::env with setenv
Related show

Commit Message

Aaron Merey Jan. 17, 2020, 3:31 a.m.

Patch

binutils/testsuite: Prevent debuginfod server from querying itself.

Set DEBUGINFOD_URLS after the server has started. Prevents it
from querying itself in cases where it is not able to find a
debug file (though this should not happen).

	* binutils/testsuite/binutils-all/debuginfod.exp:
	Start server before setting environment variable.
---
 binutils/testsuite/binutils-all/debuginfod.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/binutils/testsuite/binutils-all/debuginfod.exp b/binutils/testsuite/binutils-all/debuginfod.exp
index d73073ef17..200224f75b 100644
--- a/binutils/testsuite/binutils-all/debuginfod.exp
+++ b/binutils/testsuite/binutils-all/debuginfod.exp
@@ -78,7 +78,7 @@  set port [exec sh -c "while true; do PORT=`expr '(' \$RANDOM % 1000 ')' + 9000`;
 # Specify the directory that files retrieved from the server are written to.
 set cache [file join [pwd] "tmpdir/.debuginfod_cache"]
 
-setenv DEBUGINFOD_URLS http://127.0.0.1:$port
+setenv DEBUGINFOD_URLS ""
 setenv DEBUGINFOD_TIMEOUT 30
 setenv DEBUGINFOD_CACHE_PATH $cache
 
@@ -140,6 +140,8 @@  if { !$ready } {
     return
 }
 
+setenv DEBUGINFOD_URLS http://127.0.0.1:$port
+
 # Test whether prog can fetch separate debuginfo using debuginfod
 # if it's configured to do so.
 proc test_fetch_debuglink { prog progargs } {
-- 
2.23.0