1251881Speter# $NetBSD: t_sockets.sh,v 1.4 2010/06/04 08:39:40 jmmv Exp $
2251881Speter#
3251881Speter# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
4251881Speter# All rights reserved.
5251881Speter#
6251881Speter# Redistribution and use in source and binary forms, with or without
7251881Speter# modification, are permitted provided that the following conditions
8251881Speter# are met:
9251881Speter# 1. Redistributions of source code must retain the above copyright
10251881Speter#    notice, this list of conditions and the following disclaimer.
11251881Speter# 2. Redistributions in binary form must reproduce the above copyright
12251881Speter#    notice, this list of conditions and the following disclaimer in the
13251881Speter#    documentation and/or other materials provided with the distribution.
14251881Speter#
15251881Speter# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16251881Speter# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17251881Speter# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18251881Speter# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19251881Speter# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20251881Speter# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21251881Speter# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22251881Speter# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23251881Speter# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24251881Speter# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25251881Speter# POSSIBILITY OF SUCH DAMAGE.
26251881Speter#
27251881Speter
28251881Speteratf_test_case basic
29251881Speterbasic_head() {
30251881Speter	atf_set "descr" "Verifies that sockets can be created using" \
31251881Speter	                "socket/bind"
32251881Speter	atf_set "require.user" "root"
33251881Speter}
34251881Speterbasic_body() {
35251881Speter	test_mount
36251881Speter
37251881Speter	atf_check -s eq:0 -o empty -e empty $(atf_get_srcdir)/h_tools sockets a
38251881Speter	atf_check -s eq:0 -o empty -e empty rm a
39251881Speter
40251881Speter	atf_check -s eq:0 -o empty -e empty mkdir dir
41251881Speter	echo "$(atf_get_srcdir)/h_tools sockets dir/a" | kqueue_monitor 1 dir
42251881Speter	kqueue_check dir NOTE_WRITE
43251881Speter
44251881Speter	test_unmount
45251881Speter}
46251881Speter
47251881Speteratf_init_test_cases() {
48251881Speter	. $(atf_get_srcdir)/../h_funcs.subr
49	. $(atf_get_srcdir)/h_funcs.subr
50
51	atf_add_test_case basic
52}
53