X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-bsd-sockets%2Ftests.lisp;h=6f2201736b848271f272779889452bfe3e68ff95;hb=4e168fe00bbbb10196ef0bbfad2e85f7d361f5ae;hp=f0ceba2dfc9be747b2cc20931105ccaa2bab478c;hpb=c03ebb54770cfa613d4b706a80e5be231786a5d0;p=sbcl.git diff --git a/contrib/sb-bsd-sockets/tests.lisp b/contrib/sb-bsd-sockets/tests.lisp index f0ceba2..6f22017 100644 --- a/contrib/sb-bsd-sockets/tests.lisp +++ b/contrib/sb-bsd-sockets/tests.lisp @@ -20,6 +20,10 @@ (integerp (get-protocol-by-name "udp")) t) +;;; See https://bugs.launchpad.net/sbcl/+bug/659857 +;;; Apparently getprotobyname_r on FreeBSD says -1 and EINTR +;;; for unknown protocols... +#-(and freebsd sb-thread) (deftest get-protocol-by-name/error (handler-case (get-protocol-by-name "nonexistent-protocol") (unknown-protocol () @@ -45,7 +49,13 @@ ;; way to check the condition stuff on its own, which is a shame (handler-case (make-instance 'inet-socket :type :stream :protocol (get-protocol-by-name "udp")) - ((or socket-type-not-supported-error protocol-not-supported-error) (c) + ;; CLH FIXME! some versions of darwin just return a socket error + ;; here, not socket-type-not-supported-error or + ;; protocol-not-supported-error. + ((or #+darwin socket-error + socket-type-not-supported-error + protocol-not-supported-error) + (c) (declare (ignorable c)) t) (:no-error nil)) t) @@ -54,7 +64,14 @@ ;; same again with keywords (handler-case (make-instance 'inet-socket :type :stream :protocol :udp) - ((or protocol-not-supported-error socket-type-not-supported-error) (c) + ;; CLH FIXME! some versions of darwin just return a socket error + ;; here, not socket-type-not-supported-error or + ;; protocol-not-supported-error. + ((or + #+darwin socket-error + protocol-not-supported-error + socket-type-not-supported-error) + (c) (declare (ignorable c)) t) (:no-error nil)) t) @@ -162,9 +179,13 @@ ;; something, so don't fail this test just because the file is ;; unavailable, or if it's a symlink to some weird character ;; device. - (when (and (probe-file "/dev/log") - (sb-posix:s-issock - (sb-posix::stat-mode (sb-posix:stat "/dev/log")))) + (when (block nil + (handler-bind ((sb-posix:syscall-error + (lambda (e) + (declare (ignore e)) + (return nil)))) + (sb-posix:s-issock + (sb-posix::stat-mode (sb-posix:stat "/dev/log"))))) (let ((s (make-instance 'local-socket :type :datagram))) (format t "Connecting ~A... " s) (finish-output) @@ -196,6 +217,10 @@ (host-ent-name (get-host-by-address #(198 41 0 4))) "a.root-servers.net") +;;; These days lots of people seem to be using DNS servers that don't +;;; report resolving failures for non-existing domains. This test +;;; will fail there, so we've disabled it. +#+nil (deftest get-host-by-name-wrong (handler-case (get-host-by-name "foo.tninkpad.telent.net.")