X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-bsd-sockets%2Ftests.lisp;h=5d15ab03d32ec45dc786b3f45dd6e89221a0505e;hb=ecae2f9323086c64d026d4ce719590907f486c63;hp=eea023a805342f4723157ae64cbafef557fd435b;hpb=9cf13e525f0496e50e01abca173cc0e2037d55ee;p=sbcl.git diff --git a/contrib/sb-bsd-sockets/tests.lisp b/contrib/sb-bsd-sockets/tests.lisp index eea023a..5d15ab0 100644 --- a/contrib/sb-bsd-sockets/tests.lisp +++ b/contrib/sb-bsd-sockets/tests.lisp @@ -133,27 +133,35 @@ Tests are in the file tests.lisp and also make good examples. ;;; to look at /etc/syslog.conf or local equivalent to find out where ;;; the message ended up -#-sunos (deftest simple-local-client - (let ((s (make-instance 'local-socket :type :datagram))) - (format t "Connecting ~A... " s) - (finish-output) - (handler-case - (socket-connect s "/dev/log") - (sb-bsd-sockets::socket-error () - (setq s (make-instance 'local-socket :type :stream)) - (format t "failed~%Retrying with ~A... " s) - (finish-output) - (socket-connect s "/dev/log"))) - (format t "ok.~%") - (let ((stream (socket-make-stream s :input t :output t :buffering :none))) - (format stream - "<7>bsd-sockets: Don't panic. We're testing local-domain client code; this message can safely be ignored") - t)) - t) - - -;;; these require that the internet (or bits of it, atleast) is available + (progn + ;; SunOS (Solaris) and Darwin systems don't have a socket at + ;; /dev/log. We might also be building in a chroot or + ;; 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")))) + (let ((s (make-instance 'local-socket :type :datagram))) + (format t "Connecting ~A... " s) + (finish-output) + (handler-case + (socket-connect s "/dev/log") + (sb-bsd-sockets::socket-error () + (setq s (make-instance 'local-socket :type :stream)) + (format t "failed~%Retrying with ~A... " s) + (finish-output) + (socket-connect s "/dev/log"))) + (format t "ok.~%") + (let ((stream (socket-make-stream s :input t :output t :buffering :none))) + (format stream + "<7>bsd-sockets: Don't panic. We're testing local-domain client code; this message can safely be ignored")))) + t) + t) + + +;;; these require that the internet (or bits of it, at least) is available #+internet-available (deftest get-host-by-name