Module Name:    src
Committed By:   njoly
Date:           Mon Jun 11 18:32:59 UTC 2012

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/bin/sh: Makefile
Added Files:
        src/tests/bin/sh: t_ulimit.sh

Log Message:
New testcase to check limits flags for ulimit builtin.


To generate a diff of this commit:
cvs rdiff -u -r1.473 -r1.474 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/bin/sh/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/bin/sh/t_ulimit.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.473 src/distrib/sets/lists/tests/mi:1.474
--- src/distrib/sets/lists/tests/mi:1.473	Wed Jun  6 21:23:10 2012
+++ src/distrib/sets/lists/tests/mi	Mon Jun 11 18:32:59 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.473 2012/06/06 21:23:10 martin Exp $
+# $NetBSD: mi,v 1.474 2012/06/11 18:32:59 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1395,6 +1395,7 @@
 ./usr/tests/bin/sh/t_fsplit			tests-bin-tests		atf
 ./usr/tests/bin/sh/t_here			tests-bin-tests		atf
 ./usr/tests/bin/sh/t_set_e			tests-bin-tests		atf
+./usr/tests/bin/sh/t_ulimit			tests-bin-tests		atf
 ./usr/tests/bin/sh/t_varquote			tests-bin-tests		atf
 ./usr/tests/bin/sh/t_wait			tests-bin-tests		atf
 ./usr/tests/bin/tar				tests-bin-tests

Index: src/tests/bin/sh/Makefile
diff -u src/tests/bin/sh/Makefile:1.1 src/tests/bin/sh/Makefile:1.2
--- src/tests/bin/sh/Makefile:1.1	Sat Mar 17 16:33:11 2012
+++ src/tests/bin/sh/Makefile	Mon Jun 11 18:32:59 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2012/06/11 18:32:59 njoly Exp $
 
 .include <bsd.own.mk>
 
@@ -11,6 +11,7 @@ TESTS_SH+=	t_evaltested
 TESTS_SH+=	t_fsplit
 TESTS_SH+=	t_here
 TESTS_SH+=	t_set_e
+TESTS_SH+=	t_ulimit
 TESTS_SH+=	t_varquote
 TESTS_SH+=	t_wait
 

Added files:

Index: src/tests/bin/sh/t_ulimit.sh
diff -u /dev/null src/tests/bin/sh/t_ulimit.sh:1.1
--- /dev/null	Mon Jun 11 18:32:59 2012
+++ src/tests/bin/sh/t_ulimit.sh	Mon Jun 11 18:32:59 2012
@@ -0,0 +1,46 @@
+# $NetBSD: t_ulimit.sh,v 1.1 2012/06/11 18:32:59 njoly Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# ulimit builtin test.
+
+atf_test_case limits
+limits_head() {
+	atf_set "descr" "Checks for limits flags"
+}
+limits_body() {
+	atf_check -s eq:0 -o ignore -e empty \
+	    /bin/sh -c "ulimit -a"
+	for l in $(ulimit -a | sed 's,^.*(,,;s, .*$,,');
+	do
+	    atf_check -s eq:0 -o ignore -e empty \
+	        /bin/sh -c "ulimit $l"
+	done
+}
+
+atf_init_test_cases() {
+	atf_add_test_case limits
+}

Reply via email to