Make the `getaddrinfo' "no name" test more robust.
authorLudovic Courtès <ludo@gnu.org>
Sun, 14 Feb 2010 23:43:20 +0000 (00:43 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 14 Feb 2010 23:43:20 +0000 (00:43 +0100)
* test-suite/tests/net-db.test ("getaddrinfo")["no name"]: Check for
  `EAI_EAGAIN' too.

test-suite/tests/net-db.test

index e1f7c08..23a534d 100644 (file)
             (getaddrinfo "does-not-exist")
             #f)
           (lambda (key errcode)
-            (and (= errcode EAI_NONAME)
+            ;; In some cases (e.g., in a chroot without
+            ;; /etc/{hosts,resolv.conf}), this can result in `EAI_EAGAIN'.
+            (and (or (= errcode EAI_NONAME)
+                     (= errcode EAI_AGAIN))
                  (string? (gai-strerror errcode))))))
 
       (pass-if "wrong service name"