emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 99e9bdc: Make a network-stream test more robust


From: Lars Ingebrigtsen
Subject: master 99e9bdc: Make a network-stream test more robust
Date: Tue, 4 Aug 2020 11:25:46 -0400 (EDT)

branch: master
commit 99e9bdcd4105ac70f8f7ee06f2450cdbb15dbf3b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make a network-stream test more robust
    
    * test/lisp/net/network-stream-tests.el
    (network-test--resolve-system-name): New function.
    (echo-server-with-dns): Skip test if (system-name) doesn't look
    like it's going to resolve (bug#42535).
---
 test/lisp/net/network-stream-tests.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/lisp/net/network-stream-tests.el 
b/test/lisp/net/network-stream-tests.el
index 7a98254..f44682e 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -136,7 +136,20 @@
      (t
       ))))
 
+(defun network-test--resolve-system-name ()
+  (cl-loop for address in (network-lookup-address-info (system-name))
+           when (or (and (= (length address) 5)
+                         ;; IPv4 localhost addresses start with 127.
+                         (= (elt address 0) 127))
+                    (and (= (length address) 9)
+                         ;; IPv6 localhost addresses start with 0.
+                         (= (elt address 0) 0)))
+           return t))
+
 (ert-deftest echo-server-with-dns ()
+  (unless (network-test--resolve-system-name)
+    (ert-skip "Can't test resolver for (system-name)"))
+
   (let* ((server (make-server (system-name)))
          (port (aref (process-contact server :local) 4))
          (proc (make-network-process :name "foo"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]