unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Cyprien Nicolas <cyprien@nicolas.tf>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 36340@debbugs.gnu.org
Subject: bug#36340: Test failures when networking is disabled
Date: Sun, 7 Jul 2019 15:26:46 +0200	[thread overview]
Message-ID: <7983c7cd-8c1c-3d8e-f35e-6204880ffb4f@nicolas.tf> (raw)
In-Reply-To: <878strb1pk.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]

On 24/06/2019 14:35, Ludovic Courtès wrote:
> Hi Cyprien!  :-)
> 
> Cyprien Nicolas <cyprien@nicolas.tf> 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,

[-- Attachment #2: guile-tests-00-repl-server.patch --]
[-- Type: text/x-patch, Size: 3726 bytes --]

--- 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)

      reply	other threads:[~2019-07-07 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-23 11:44 bug#36340: Test failures when networking is disabled Cyprien Nicolas
2019-06-24 12:35 ` Ludovic Courtès
2019-07-07 13:26   ` Cyprien Nicolas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7983c7cd-8c1c-3d8e-f35e-6204880ffb4f@nicolas.tf \
    --to=cyprien@nicolas.tf \
    --cc=36340@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).