From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id g2dHON0oeWG5DQAAWB0awg (envelope-from ) for ; Wed, 27 Oct 2021 06:24:29 -0400 Received: by simark.ca (Postfix, from userid 112) id D67F01EE18; Wed, 27 Oct 2021 06:24:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 219ED1E940 for ; Wed, 27 Oct 2021 06:24:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 532643858434 for ; Wed, 27 Oct 2021 10:24:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 532643858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635330268; bh=08DPCI1yhrlTva8MEHghtUqSuKB8+35+HgthW9IhDOE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=yABWXD8JwuP/COIeMmmFxHxWTFHaBFvteNcXS75qNIFVg+cDWY5VohX4W3gJ0+1zb RZDR/kZ9jtdaQf/xd0eCmHFuNMvOJyjNewi8FO1IqPrfig0TUol7ZLMTADLWXTb8Lz uf4nWHMYxTrF9li985g133vuv1iyn9Uyoww9awdA= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 3496E3858401 for ; Wed, 27 Oct 2021 10:24:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3496E3858401 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 215541FD3B; Wed, 27 Oct 2021 10:24:09 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0652213B59; Wed, 27 Oct 2021 10:24:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Vb5yAMkoeWEYRwAAMHmgww (envelope-from ); Wed, 27 Oct 2021 10:24:09 +0000 Date: Wed, 27 Oct 2021 12:24:07 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix port detection in gdb.debuginfod/fetch_src_and_symbols.exp Message-ID: <20211027102405.GA6737@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, On OBS I ran into this failure with test-case gdb.debuginfod/fetch_src_and_symbols.exp: ... Failed to listen for connections: Address already in use^M [Thu Oct 21 11:48:49 2021] (559/559): started http server on IPv6 port=8000^M ... FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: find port timeout ... The test-case is trying to start debuginfod on a port to see if it's available, and it handles either this message: "started http server on IPv4 IPv6 port=$port" meaning success, or: "failed to bind to port" meaning failure, in which case the debuginfod instance is killed, and we try the next port. The test-case only uses the v4 address 127.0.0.1, so fix this by: - accepting "started http server on IPv4 port=$port" - rejecting "started http server on IPv6 port=$port" Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Fix port detection in gdb.debuginfod/fetch_src_and_symbols.exp --- gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp index 93490fce41e..f8fcbbae8a4 100644 --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp @@ -180,12 +180,17 @@ proc local_url { } { spawn debuginfod -vvvv -d $db -p $port -F $debugdir expect { "started http server on IPv4 IPv6 port=$port" { set found 1 } - "failed to bind to port" { kill_wait_spawned_process $spawn_id } + "started http server on IPv4 port=$port" { set found 1 } + "started http server on IPv6 port=$port" {} + "failed to bind to port" {} timeout { fail "find port timeout" return -1 } } + if { ! $found } { + kill_wait_spawned_process $spawn_id + } } set metrics [list "ready 1" \