From: Robert Pluim Date: Fri, 20 Jun 2025 09:57:41 +0000 (+0200) Subject: Fix echo-server-with-dns for really broken systems X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3f433004cd3275828c7c911329bd4333eca7911d;p=emacs.git Fix echo-server-with-dns for really broken systems *test/lisp/net/network-stream-tests.el (network-test--resolve-system-name): Check to see if we get any address result at all (looking at you macOS). (cherry picked from commit dcead54ed54d14420f5cee10b0e4a24bba244722) --- diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el index 4762170bbbf..1684900f7db 100644 --- a/test/lisp/net/network-stream-tests.el +++ b/test/lisp/net/network-stream-tests.el @@ -141,14 +141,17 @@ )))) (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 address. - (equal address [0 0 0 0 0 0 0 1 0]))) - return t)) + (let ((addresses (network-lookup-address-info (system-name)))) + (if addresses + (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 address. + (equal address [0 0 0 0 0 0 0 1 0]))) + return t) + t))) (ert-deftest echo-server-with-dns () (skip-when (network-test--resolve-system-name))