From 3f433004cd3275828c7c911329bd4333eca7911d Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Fri, 20 Jun 2025 11:57:41 +0200 Subject: [PATCH] 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) --- test/lisp/net/network-stream-tests.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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)) -- 2.39.5