diff options
| author | Robert Pluim | 2025-06-20 11:57:41 +0200 |
|---|---|---|
| committer | Robert Pluim | 2025-06-20 11:57:41 +0200 |
| commit | dcead54ed54d14420f5cee10b0e4a24bba244722 (patch) | |
| tree | cff43f082f41b11ddbd750d576236acc3a6f8629 | |
| parent | 1c168e166df90e830dfdd780accc09630653d92f (diff) | |
| download | emacs-dcead54ed54d14420f5cee10b0e4a24bba244722.tar.gz emacs-dcead54ed54d14420f5cee10b0e4a24bba244722.zip | |
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).
| -rw-r--r-- | test/lisp/net/network-stream-tests.el | 19 |
1 files 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 @@ | |||
| 141 | )))) | 141 | )))) |
| 142 | 142 | ||
| 143 | (defun network-test--resolve-system-name () | 143 | (defun network-test--resolve-system-name () |
| 144 | (cl-loop for address in (network-lookup-address-info (system-name)) | 144 | (let ((addresses (network-lookup-address-info (system-name)))) |
| 145 | when (or (and (= (length address) 5) | 145 | (if addresses |
| 146 | ;; IPv4 localhost addresses start with 127. | 146 | (cl-loop for address in (network-lookup-address-info (system-name)) |
| 147 | (= (elt address 0) 127)) | 147 | when (or (and (= (length address) 5) |
| 148 | (and (= (length address) 9) | 148 | ;; IPv4 localhost addresses start with 127. |
| 149 | ;; IPv6 localhost address. | 149 | (= (elt address 0) 127)) |
| 150 | (equal address [0 0 0 0 0 0 0 1 0]))) | 150 | (and (= (length address) 9) |
| 151 | return t)) | 151 | ;; IPv6 localhost address. |
| 152 | (equal address [0 0 0 0 0 0 0 1 0]))) | ||
| 153 | return t) | ||
| 154 | t))) | ||
| 152 | 155 | ||
| 153 | (ert-deftest echo-server-with-dns () | 156 | (ert-deftest echo-server-with-dns () |
| 154 | (skip-when (network-test--resolve-system-name)) | 157 | (skip-when (network-test--resolve-system-name)) |