aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Pluim2019-08-24 14:54:02 +0200
committerRobert Pluim2019-08-24 14:57:58 +0200
commit649fb174431fd030c4bef563af79fe65c5fbf979 (patch)
tree74327d78fdad557b033c8fc455ce93f5cc1ce628
parent42f8fa80706ee34bba98a922e2f42edcfe474bc9 (diff)
downloademacs-649fb174431fd030c4bef563af79fe65c5fbf979.tar.gz
emacs-649fb174431fd030c4bef563af79fe65c5fbf979.zip
Fix DNS tests
* test/src/process-tests.el: (lookup-family-specification, lookup-unicode-domains, unibyte-domain-name, lookup-google, non-existent-lookup-failure): Skip on Hydra, which doesn't have DNS. Fix buggy test condition. (Bug#37165)
-rw-r--r--test/src/process-tests.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 724da1c3e72..82eeee1150a 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -323,31 +323,39 @@ See Bug#30460."
323 invocation-directory)) 323 invocation-directory))
324 :stop t))) 324 :stop t)))
325 325
326;; All the following tests require working DNS, which appears not to
327;; be the case for hydra.nixos.org, so disable them there for now.
328
326(ert-deftest lookup-family-specification () 329(ert-deftest lookup-family-specification ()
327 "network-lookup-address-info should only accept valid family symbols." 330 "network-lookup-address-info should only accept valid family symbols."
331 (skip-unless (not (getenv "EMACS_HYDRA_CI")))
328 (should-error (network-lookup-address-info "google.com" 'both)) 332 (should-error (network-lookup-address-info "google.com" 'both))
329 (should (network-lookup-address-info "google.com" 'ipv4)) 333 (should (network-lookup-address-info "google.com" 'ipv4))
330 (should (network-lookup-address-info "google.com" 'ipv6))) 334 (should (network-lookup-address-info "google.com" 'ipv6)))
331 335
332(ert-deftest lookup-unicode-domains () 336(ert-deftest lookup-unicode-domains ()
333 "Unicode domains should fail" 337 "Unicode domains should fail"
338 (skip-unless (not (getenv "EMACS_HYDRA_CI")))
334 (should-error (network-lookup-address-info "faß.de")) 339 (should-error (network-lookup-address-info "faß.de"))
335 (should (length (network-lookup-address-info (puny-encode-domain "faß.de"))))) 340 (should (network-lookup-address-info (puny-encode-domain "faß.de"))))
336 341
337(ert-deftest unibyte-domain-name () 342(ert-deftest unibyte-domain-name ()
338 "Unibyte domain names should work" 343 "Unibyte domain names should work"
339 (should (length (network-lookup-address-info (string-to-unibyte "google.com"))))) 344 (skip-unless (not (getenv "EMACS_HYDRA_CI")))
345 (should (network-lookup-address-info (string-to-unibyte "google.com"))))
340 346
341(ert-deftest lookup-google () 347(ert-deftest lookup-google ()
342 "Check that we can look up google IP addresses" 348 "Check that we can look up google IP addresses"
349 (skip-unless (not (getenv "EMACS_HYDRA_CI")))
343 (let ((addresses-both (network-lookup-address-info "google.com")) 350 (let ((addresses-both (network-lookup-address-info "google.com"))
344 (addresses-v4 (network-lookup-address-info "google.com" 'ipv4)) 351 (addresses-v4 (network-lookup-address-info "google.com" 'ipv4))
345 (addresses-v6 (network-lookup-address-info "google.com" 'ipv6))) 352 (addresses-v6 (network-lookup-address-info "google.com" 'ipv6)))
346 (should (length addresses-both)) 353 (should addresses-both)
347 (should (length addresses-v4)) 354 (should addresses-v4)
348 (should (length addresses-v6)))) 355 (should addresses-v6)))
349 356
350(ert-deftest non-existent-lookup-failure () 357(ert-deftest non-existent-lookup-failure ()
358 (skip-unless (not (getenv "EMACS_HYDRA_CI")))
351 "Check that looking up non-existent domain returns nil" 359 "Check that looking up non-existent domain returns nil"
352 (should (eq nil (network-lookup-address-info "emacs.invalid")))) 360 (should (eq nil (network-lookup-address-info "emacs.invalid"))))
353 361