Module Name: src
Committed By: uebayasi
Date: Tue Apr 29 06:29:02 UTC 2014
Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/lib/libc/gen: Makefile
Added Files:
src/tests/lib/libc/gen/execve: Makefile t_execve.c
Log Message:
Minimal execve(2) ATF test.
To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.566 -r1.567 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.103 -r1.104 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.39 -r1.40 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/gen/execve/Makefile \
src/tests/lib/libc/gen/execve/t_execve.c
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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.59 src/distrib/sets/lists/debug/mi:1.60
--- src/distrib/sets/lists/debug/mi:1.59 Thu Apr 24 21:46:44 2014
+++ src/distrib/sets/lists/debug/mi Tue Apr 29 06:29:02 2014
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.59 2014/04/24 21:46:44 pooka Exp $
+# $NetBSD: mi,v 1.60 2014/04/29 06:29:02 uebayasi Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib
@@ -1792,6 +1792,7 @@
./usr/libdata/debug/usr/tests/lib/libc/c063/t_unlinkat.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/c063/t_utimensat.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/db/h_db.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/gen/execve/t_execve.debug tests-kernel-tests debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/h_fileactions.debug tests-kernel-tests debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/h_spawn.debug tests-kernel-tests debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/h_spawnattr.debug tests-kernel-tests debug,atf
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.566 src/distrib/sets/lists/tests/mi:1.567
--- src/distrib/sets/lists/tests/mi:1.566 Thu Apr 17 23:15:27 2014
+++ src/distrib/sets/lists/tests/mi Tue Apr 29 06:29:02 2014
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.566 2014/04/17 23:15:27 pgoyette Exp $
+# $NetBSD: mi,v 1.567 2014/04/29 06:29:02 uebayasi Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -85,6 +85,7 @@
./usr/libdata/debug/usr/tests/lib/libc/c063 tests-lib-debug
./usr/libdata/debug/usr/tests/lib/libc/db tests-lib-debug
./usr/libdata/debug/usr/tests/lib/libc/gen tests-lib-debug
+./usr/libdata/debug/usr/tests/lib/libc/gen/execve tests-kernel-tests
./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn tests-kernel-tests
./usr/libdata/debug/usr/tests/lib/libc/getaddrinfo tests-obsolete obsolete
./usr/libdata/debug/usr/tests/lib/libc/getaddrinfo/data tests-obsolete obsolete
@@ -1910,6 +1911,10 @@
./usr/tests/lib/libc/gen tests-lib-tests
./usr/tests/lib/libc/gen/Atffile tests-lib-tests atf
./usr/tests/lib/libc/gen/Kyuafile tests-lib-tests atf,kyua
+./usr/tests/lib/libc/gen/execve tests-kernel-tests
+./usr/tests/lib/libc/gen/execve/Atffile tests-kernel-tests atf
+./usr/tests/lib/libc/gen/execve/Kyuafile tests-kernel-tests atf,kyua
+./usr/tests/lib/libc/gen/execve/t_execve tests-kernel-tests atf
./usr/tests/lib/libc/gen/posix_spawn tests-kernel-tests
./usr/tests/lib/libc/gen/posix_spawn/Atffile tests-kernel-tests atf
./usr/tests/lib/libc/gen/posix_spawn/Kyuafile tests-kernel-tests atf,kyua
Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.103 src/etc/mtree/NetBSD.dist.tests:1.104
--- src/etc/mtree/NetBSD.dist.tests:1.103 Sat Feb 8 19:45:51 2014
+++ src/etc/mtree/NetBSD.dist.tests Tue Apr 29 06:29:02 2014
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.dist.tests,v 1.103 2014/02/08 19:45:51 jmmv Exp $
+# $NetBSD: NetBSD.dist.tests,v 1.104 2014/04/29 06:29:02 uebayasi Exp $
./usr/libdata/debug/usr/tests
./usr/libdata/debug/usr/tests/atf
@@ -75,6 +75,7 @@
./usr/libdata/debug/usr/tests/lib/libc/c063
./usr/libdata/debug/usr/tests/lib/libc/db
./usr/libdata/debug/usr/tests/lib/libc/gen
+./usr/libdata/debug/usr/tests/lib/libc/gen/execve
./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn
./usr/libdata/debug/usr/tests/lib/libc/hash
./usr/libdata/debug/usr/tests/lib/libc/locale
@@ -236,6 +237,7 @@
./usr/tests/lib/libc/c063
./usr/tests/lib/libc/db
./usr/tests/lib/libc/gen
+./usr/tests/lib/libc/gen/execve
./usr/tests/lib/libc/gen/posix_spawn
./usr/tests/lib/libc/hash
./usr/tests/lib/libc/hash/data
Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.39 src/tests/lib/libc/gen/Makefile:1.40
--- src/tests/lib/libc/gen/Makefile:1.39 Thu Jan 30 15:04:04 2014
+++ src/tests/lib/libc/gen/Makefile Tue Apr 29 06:29:02 2014
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.39 2014/01/30 15:04:04 joerg Exp $
+# $NetBSD: Makefile,v 1.40 2014/04/29 06:29:02 uebayasi Exp $
.include <bsd.own.mk>
TESTSDIR= ${TESTSBASE}/lib/libc/gen
-TESTS_SUBDIRS= posix_spawn
+TESTS_SUBDIRS= execve
+TESTS_SUBDIRS+= posix_spawn
TESTS_C+= t_alarm
TESTS_C+= t_assert
Added files:
Index: src/tests/lib/libc/gen/execve/Makefile
diff -u /dev/null src/tests/lib/libc/gen/execve/Makefile:1.1
--- /dev/null Tue Apr 29 06:29:02 2014
+++ src/tests/lib/libc/gen/execve/Makefile Tue Apr 29 06:29:02 2014
@@ -0,0 +1,15 @@
+# $NetBSD: Makefile,v 1.1 2014/04/29 06:29:02 uebayasi Exp $
+
+NOMAN= # defined
+WARNS=4
+
+.include <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/lib/libc/gen/execve
+
+TESTS_C= t_execve
+
+BINDIR= ${TESTSDIR}
+SCRIPTSDIR= ${TESTSDIR}
+
+.include <bsd.test.mk>
Index: src/tests/lib/libc/gen/execve/t_execve.c
diff -u /dev/null src/tests/lib/libc/gen/execve/t_execve.c:1.1
--- /dev/null Tue Apr 29 06:29:02 2014
+++ src/tests/lib/libc/gen/execve/t_execve.c Tue Apr 29 06:29:02 2014
@@ -0,0 +1,58 @@
+/* $NetBSD: t_execve.c,v 1.1 2014/04/29 06:29:02 uebayasi Exp $ */
+
+/*-
+ * Copyright (c) 2014 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.
+ */
+
+#include <atf-c.h>
+
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <unistd.h>
+
+ATF_TC(t_execve_null);
+
+ATF_TC_HEAD(t_execve_null, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Tests an empty execve(2) executing");
+}
+
+ATF_TC_BODY(t_execve_null, tc)
+{
+ int err;
+
+ err = execve(NULL, NULL, NULL);
+ ATF_REQUIRE(err == -1);
+ ATF_REQUIRE(errno == EFAULT);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, t_execve_null);
+
+ return atf_no_error();
+}