From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Cyprien Nicolas Newsgroups: gmane.lisp.guile.bugs Subject: bug#36340: Test failures when networking is disabled Date: Sun, 7 Jul 2019 15:26:46 +0200 Message-ID: <7983c7cd-8c1c-3d8e-f35e-6204880ffb4f@nicolas.tf> References: <52873187-7898-41ff-be3c-fd9fe2a8802b@nicolas.tf> <878strb1pk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------60E7FB9D4C5D81126F01399E" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="46647"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 Cc: 36340@debbugs.gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jul 07 15:27:18 2019 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hk7CH-000C0V-M0 for guile-bugs@m.gmane.org; Sun, 07 Jul 2019 15:27:17 +0200 Original-Received: from localhost ([::1]:35402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hk7CG-0007tg-7W for guile-bugs@m.gmane.org; Sun, 07 Jul 2019 09:27:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38531) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hk7C6-0007tN-NL for bug-guile@gnu.org; Sun, 07 Jul 2019 09:27:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hk7C4-0000Zj-Lr for bug-guile@gnu.org; Sun, 07 Jul 2019 09:27:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47492) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hk7C2-0000Xp-6u for bug-guile@gnu.org; Sun, 07 Jul 2019 09:27:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hk7C2-0004RE-1g for bug-guile@gnu.org; Sun, 07 Jul 2019 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Cyprien Nicolas Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 07 Jul 2019 13:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36340 X-GNU-PR-Package: guile Original-Received: via spool by 36340-submit@debbugs.gnu.org id=B36340.156250601117042 (code B ref 36340); Sun, 07 Jul 2019 13:27:01 +0000 Original-Received: (at 36340) by debbugs.gnu.org; 7 Jul 2019 13:26:51 +0000 Original-Received: from localhost ([127.0.0.1]:56313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hk7Br-0004Qn-71 for submit@debbugs.gnu.org; Sun, 07 Jul 2019 09:26:51 -0400 Original-Received: from cubran.fulax.net ([91.224.149.126]:35629 ident=cubran) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hk7Bo-0004Qf-Qs for 36340@debbugs.gnu.org; Sun, 07 Jul 2019 09:26:50 -0400 Original-Received: from [192.168.1.9] (static-176-139-30-77.ftth.abo.bbox.fr [176.139.30.77]) by cubran.fulax.net (Postfix) with ESMTPSA id D8D8596036; Sun, 7 Jul 2019 13:26:46 +0000 (UTC) Authentication-Results: cubran.fulax.net; dmarc=none header.from=nicolas.tf DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nicolas.tf; s=beta; t=1562506006; bh=ufkNouHpgWpyT5SNdrFgkqk08lrDu7axUioZb99toyM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=HuOvKuILaEc5bs+Ir2kNlA0pCO3wwVdz+zRFC7sa10XiTAld91SJhfw3oCMRzeEsz 2hW1fjFOkYpGkT8Z7slH272TbzA+vOqLtvK6mU9e4pBvy/UfHRZUreayjYb57rGopT 5M3mOLeaeJ5V1PPk/scNhWe9HQ8EOAo6xUMxLXHEHGvfp0p+kdBtXvF58Jcw2UEhqp 7NSnZRGVHkCOOwdLZzPvav0DX8tqiBsSu2ksq8QqVQJYoOKOyO8LU5Mfq9WjSjFsY7 bSRnMxRqmkZW9EZlrNF6WvdyVTIp+RTLoSl06nJeyKwHOQZOf9MELJgOOKYnsWk6Zf s26I5TV6NpZQgRq1uYctNwXFnxGhra2903/cr68XNRoPn6Y21xaSbAIdRcRP3Nv/NV jOjzx8MNIEhF2q/KinL7tAmze24nwAGpbbhebRckFAsH3DibrqIFDVpKkczfyEd0mg PSV8k/CLIJM9z7d8LxlJd1CSNKQ5QwnBFXGrGPSnmmURRwphm8Xi/4rmOAJHm3/4aD WM72T17TAu9oEtKydp+q4EW+bgXNJAuZAKH2ve0YL62j42hcFxXv6/Rt9w0rQkJ0xs Qmjff43jARfArt8nvNv6a8hMdiWSQ+/Jd0QsrKGnJF9QCzQcTQYm8SX1rB8QQOBuxX wIxbw7M6SXkrb9HtCdiYQi1g In-Reply-To: <878strb1pk.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9391 Archived-At: This is a multi-part message in MIME format. --------------60E7FB9D4C5D81126F01399E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 24/06/2019 14:35, Ludovic Courtès wrote: > Hi Cyprien! :-) > > Cyprien Nicolas skribis: > >> Is guile configured with --disable-networking still a supported >> configuration? > > In theory yes, but as you found out, it’s not well tested. > > The way we’d normally addressing in the test suite is by testing: > > (provided? 'socket) > > and/or: > > (provided? 'net-db) > > and throwing to unresolved or skipping tests altogether. > > Would you like to propose a patch that does that for all the instances > that you found? Do you mean also harmonizing current tests that uses (memq 'socket *features*) ; web-uri.test and/or (defined? 'AF_INET) ; 00-socket.test or only fixing failing ones? The attached path mimics net-db.test style for skipping tests for 00-repl-server.test (I hope the indentation is correct). However, we still have the ice-9 suspendable-ports module issue which compiles fine but fails to load (actually not related to tests). Thanks, --------------60E7FB9D4C5D81126F01399E Content-Type: text/x-patch; name="guile-tests-00-repl-server.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="guile-tests-00-repl-server.patch" --- guile-2.2.6/test-suite/tests/00-repl-server.test.old 2017-04-14 23:26:40.000000000 +0200 +++ guile-2.2.6/test-suite/tests/00-repl-server.test 2019-07-07 15:14:59.681831790 +0200 @@ -105,47 +105,48 @@ ;;; Since we call 'primitive-fork', these tests must run before any ;;; tests that create threads. -(with-test-prefix "repl-server" +(if (provided? 'socket) + (with-test-prefix "repl-server" - (pass-if-equal "simple expression" - "scheme@(repl-server)> $1 = 42\n" - (with-repl-server socket - (read-until-prompt socket %last-line-before-prompt) - - ;; Wait until 'repl-reader' in boot-9 has written the prompt. - ;; Otherwise, if we write too quickly, 'repl-reader' checks for - ;; 'char-ready?' and doesn't print the prompt. - (match (select (list socket) '() (list socket) 3) - (((_) () ()) - (display "(+ 40 2)\n(quit)\n" socket) - (read-string socket))))) - - (pass-if "HTTP inter-protocol attack" ;CVE-2016-8606 - (with-repl-server socket - ;; Avoid SIGPIPE when the server closes the connection. - (sigaction SIGPIPE SIG_IGN) - - (read-until-prompt socket %last-line-before-prompt) - - ;; Simulate an HTTP inter-protocol attack. - (write-request (build-request (string->uri "http://localhost")) - socket) - - ;; Make sure the server reacts by closing the connection. If it - ;; fails to do that, this test hangs. - (catch 'system-error - (lambda () - (let loop ((n 0)) - (display "(+ 40 2)\n(quit)\n" socket) ;trigger EPIPE - (read-string socket) - (if (> n 5) - #f ;failure - (begin - (sleep 1) - (loop (+ 1 n)))))) - (lambda args - (->bool (memv (system-error-errno args) - (list ECONNRESET EPIPE ECONNABORTED)))))))) + (pass-if-equal "simple expression" + "scheme@(repl-server)> $1 = 42\n" + (with-repl-server socket + (read-until-prompt socket %last-line-before-prompt) + + ;; Wait until 'repl-reader' in boot-9 has written the prompt. + ;; Otherwise, if we write too quickly, 'repl-reader' checks for + ;; 'char-ready?' and doesn't print the prompt. + (match (select (list socket) '() (list socket) 3) + (((_) () ()) + (display "(+ 40 2)\n(quit)\n" socket) + (read-string socket))))) + + (pass-if "HTTP inter-protocol attack" ;CVE-2016-8606 + (with-repl-server socket + ;; Avoid SIGPIPE when the server closes the connection. + (sigaction SIGPIPE SIG_IGN) + + (read-until-prompt socket %last-line-before-prompt) + + ;; Simulate an HTTP inter-protocol attack. + (write-request (build-request (string->uri "http://localhost")) + socket) + + ;; Make sure the server reacts by closing the connection. If it + ;; fails to do that, this test hangs. + (catch 'system-error + (lambda () + (let loop ((n 0)) + (display "(+ 40 2)\n(quit)\n" socket) ;trigger EPIPE + (read-string socket) + (if (> n 5) + #f ;failure + (begin + (sleep 1) + (loop (+ 1 n)))))) + (lambda args + (->bool (memv (system-error-errno args) + (list ECONNRESET EPIPE ECONNABORTED))))))))) ;;; Local Variables: ;;; eval: (put 'with-repl-server 'scheme-indent-function 1) --------------60E7FB9D4C5D81126F01399E--