diff options
Diffstat (limited to 'tests/open/24.t')
-rw-r--r-- | tests/open/24.t | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/open/24.t b/tests/open/24.t index ca709f221214..c899be00f363 100644 --- a/tests/open/24.t +++ b/tests/open/24.t @@ -1,17 +1,32 @@ #!/bin/sh +# vim: filetype=sh noexpandtab ts=8 sw=8 # $FreeBSD: head/tools/regression/pjdfstest/tests/open/24.t 211352 2010-08-15 21:24:17Z pjd $ -desc="open returns EOPNOTSUPP when trying to open UNIX domain socket" - dir=`dirname $0` . ${dir}/../misc.sh +# POSIX doesn't explicitly state the errno for open(2)'ing sockets. +case ${os} in +Darwin|FreeBSD) + expected_error=EOPNOTSUPP + ;; +Linux) + expected_error=ENXIO + ;; +*) + echo "1..0 # SKIP: unsupported OS: ${os}" + exit 0 + ;; +esac + +desc="open returns $expected_error when trying to open UNIX domain socket" + echo "1..5" n0=`namegen` expect 0 bind ${n0} -expect "EOPNOTSUPP" open ${n0} O_RDONLY -expect "EOPNOTSUPP" open ${n0} O_WRONLY -expect "EOPNOTSUPP" open ${n0} O_RDWR +expect $expected_error open ${n0} O_RDONLY +expect $expected_error open ${n0} O_WRONLY +expect $expected_error open ${n0} O_RDWR expect 0 unlink ${n0} |