Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Minimal execve(2) ATF test.



details:   https://anonhg.NetBSD.org/src/rev/7f72f301cb65
branches:  trunk
changeset: 329007:7f72f301cb65
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Tue Apr 29 06:29:02 2014 +0000

description:
Minimal execve(2) ATF test.

diffstat:

 distrib/sets/lists/debug/mi          |   3 +-
 distrib/sets/lists/tests/mi          |   7 +++-
 etc/mtree/NetBSD.dist.tests          |   4 +-
 tests/lib/libc/gen/Makefile          |   5 +-
 tests/lib/libc/gen/execve/Makefile   |  15 +++++++++
 tests/lib/libc/gen/execve/t_execve.c |  58 ++++++++++++++++++++++++++++++++++++
 6 files changed, 87 insertions(+), 5 deletions(-)

diffs (168 lines):

diff -r 605473097602 -r 7f72f301cb65 distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi       Tue Apr 29 01:21:02 2014 +0000
+++ b/distrib/sets/lists/debug/mi       Tue Apr 29 06:29:02 2014 +0000
@@ -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
diff -r 605473097602 -r 7f72f301cb65 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Tue Apr 29 01:21:02 2014 +0000
+++ b/distrib/sets/lists/tests/mi       Tue Apr 29 06:29:02 2014 +0000
@@ -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
diff -r 605473097602 -r 7f72f301cb65 etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Tue Apr 29 01:21:02 2014 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Tue Apr 29 06:29:02 2014 +0000
@@ -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
diff -r 605473097602 -r 7f72f301cb65 tests/lib/libc/gen/Makefile
--- a/tests/lib/libc/gen/Makefile       Tue Apr 29 01:21:02 2014 +0000
+++ b/tests/lib/libc/gen/Makefile       Tue Apr 29 06:29:02 2014 +0000
@@ -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
diff -r 605473097602 -r 7f72f301cb65 tests/lib/libc/gen/execve/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/gen/execve/Makefile        Tue Apr 29 06:29:02 2014 +0000
@@ -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>
diff -r 605473097602 -r 7f72f301cb65 tests/lib/libc/gen/execve/t_execve.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/gen/execve/t_execve.c      Tue Apr 29 06:29:02 2014 +0000
@@ -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();
+}



Home | Main Index | Thread Index | Old Index