t_ulimit.sh revision 1.1
11.1Snjoly# $NetBSD: t_ulimit.sh,v 1.1 2012/06/11 18:32:59 njoly Exp $
21.1Snjoly#
31.1Snjoly# Copyright (c) 2012 The NetBSD Foundation, Inc.
41.1Snjoly# All rights reserved.
51.1Snjoly#
61.1Snjoly# Redistribution and use in source and binary forms, with or without
71.1Snjoly# modification, are permitted provided that the following conditions
81.1Snjoly# are met:
91.1Snjoly# 1. Redistributions of source code must retain the above copyright
101.1Snjoly#    notice, this list of conditions and the following disclaimer.
111.1Snjoly# 2. Redistributions in binary form must reproduce the above copyright
121.1Snjoly#    notice, this list of conditions and the following disclaimer in the
131.1Snjoly#    documentation and/or other materials provided with the distribution.
141.1Snjoly#
151.1Snjoly# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
161.1Snjoly# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
171.1Snjoly# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
181.1Snjoly# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
191.1Snjoly# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
201.1Snjoly# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
211.1Snjoly# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
221.1Snjoly# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
231.1Snjoly# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
241.1Snjoly# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
251.1Snjoly# POSSIBILITY OF SUCH DAMAGE.
261.1Snjoly#
271.1Snjoly
281.1Snjoly# ulimit builtin test.
291.1Snjoly
301.1Snjolyatf_test_case limits
311.1Snjolylimits_head() {
321.1Snjoly	atf_set "descr" "Checks for limits flags"
331.1Snjoly}
341.1Snjolylimits_body() {
351.1Snjoly	atf_check -s eq:0 -o ignore -e empty \
361.1Snjoly	    /bin/sh -c "ulimit -a"
371.1Snjoly	for l in $(ulimit -a | sed 's,^.*(,,;s, .*$,,');
381.1Snjoly	do
391.1Snjoly	    atf_check -s eq:0 -o ignore -e empty \
401.1Snjoly	        /bin/sh -c "ulimit $l"
411.1Snjoly	done
421.1Snjoly}
431.1Snjoly
441.1Snjolyatf_init_test_cases() {
451.1Snjoly	atf_add_test_case limits
461.1Snjoly}
47