Module Name: src
Committed By: jruoho
Date: Tue Apr 10 02:39:34 UTC 2012
Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/sysctl: Makefile
Added Files:
src/tests/sbin/sysctl: t_sysctl.sh
Log Message:
Test that sysctl(8) does not segfault, as reported by pgoyette@ on current
users.
To generate a diff of this commit:
cvs rdiff -u -r1.462 -r1.463 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/sysctl/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/sysctl/t_sysctl.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.462 src/distrib/sets/lists/tests/mi:1.463
--- src/distrib/sets/lists/tests/mi:1.462 Fri Mar 30 09:27:10 2012
+++ src/distrib/sets/lists/tests/mi Tue Apr 10 02:39:34 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.462 2012/03/30 09:27:10 jruoho Exp $
+# $NetBSD: mi,v 1.463 2012/04/10 02:39:34 jruoho Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -2897,6 +2897,7 @@
./usr/tests/sbin/sysctl tests-sbin-tests
./usr/tests/sbin/sysctl/Atffile tests-sbin-tests atf
./usr/tests/sbin/sysctl/t_perm tests-sbin-tests atf
+./usr/tests/sbin/sysctl/t_sysctl tests-sbin-tests atf
./usr/tests/sys tests-sys-tests
./usr/tests/sys/Atffile tests-sys-tests atf
./usr/tests/sys/rc tests-sys-tests
Index: src/tests/sbin/sysctl/Makefile
diff -u src/tests/sbin/sysctl/Makefile:1.1 src/tests/sbin/sysctl/Makefile:1.2
--- src/tests/sbin/sysctl/Makefile:1.1 Mon May 9 17:53:54 2011
+++ src/tests/sbin/sysctl/Makefile Tue Apr 10 02:39:33 2012
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2011/05/09 17:53:54 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2012/04/10 02:39:33 jruoho Exp $
.include <bsd.own.mk>
TESTSDIR= ${TESTSBASE}/sbin/sysctl
-TESTS_SH= t_perm
+TESTS_SH= t_perm t_sysctl
.include <bsd.test.mk>
Added files:
Index: src/tests/sbin/sysctl/t_sysctl.sh
diff -u /dev/null src/tests/sbin/sysctl/t_sysctl.sh:1.1
--- /dev/null Tue Apr 10 02:39:34 2012
+++ src/tests/sbin/sysctl/t_sysctl.sh Tue Apr 10 02:39:33 2012
@@ -0,0 +1,44 @@
+# $NetBSD: t_sysctl.sh,v 1.1 2012/04/10 02:39:33 jruoho Exp $
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# 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.
+#
+
+atf_test_case basic
+basic_head() {
+ atf_set "descr" "Test that sysctl(8) works"
+}
+
+basic_body() {
+
+ atf_check -s exit:0 -o ignore -e empty -x "sysctl -a"
+}
+
+atf_init_test_cases() {
+
+ atf_add_test_case basic
+}