Source-Changes-HG archive

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

[src/trunk]: src Move posix_spawn tests to lib/libc/gen/posix_spawn - they te...



details:   https://anonhg.NetBSD.org/src/rev/528398a241d8
branches:  trunk
changeset: 773715:528398a241d8
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Feb 13 21:03:06 2012 +0000

description:
Move posix_spawn tests to lib/libc/gen/posix_spawn - they test both libc
and kernel, but that is an implementation detail unrelated to the tests
themselfs.
Ok: releng

diffstat:

 distrib/sets/lists/tests/mi                    |   53 ++++--
 etc/mtree/NetBSD.dist.tests                    |    6 +-
 tests/kernel/Makefile                          |    4 +-
 tests/kernel/posix_spawn/Makefile              |   28 ---
 tests/kernel/posix_spawn/Makefile.inc          |    1 -
 tests/kernel/posix_spawn/h_fileactions.c       |  104 --------------
 tests/kernel/posix_spawn/h_nonexec.sh          |    3 -
 tests/kernel/posix_spawn/h_spawn.c             |   50 ------
 tests/kernel/posix_spawn/h_spawnattr.c         |   90 ------------
 tests/kernel/posix_spawn/t_fileactions.c       |   92 ------------
 tests/kernel/posix_spawn/t_spawn.c             |  184 -------------------------
 tests/kernel/posix_spawn/t_spawnattr.c         |  173 -----------------------
 tests/lib/libc/gen/Makefile                    |    4 +-
 tests/lib/libc/gen/posix_spawn/Makefile        |   27 +++
 tests/lib/libc/gen/posix_spawn/Makefile.inc    |    1 +
 tests/lib/libc/gen/posix_spawn/h_fileactions.c |  104 ++++++++++++++
 tests/lib/libc/gen/posix_spawn/h_nonexec.sh    |    3 +
 tests/lib/libc/gen/posix_spawn/h_spawn.c       |   50 ++++++
 tests/lib/libc/gen/posix_spawn/h_spawnattr.c   |   90 ++++++++++++
 tests/lib/libc/gen/posix_spawn/t_fileactions.c |   92 ++++++++++++
 tests/lib/libc/gen/posix_spawn/t_spawn.c       |  184 +++++++++++++++++++++++++
 tests/lib/libc/gen/posix_spawn/t_spawnattr.c   |  173 +++++++++++++++++++++++
 22 files changed, 767 insertions(+), 749 deletions(-)

diffs (truncated from 1684 to 300 lines):

diff -r 1f2f9d73d1a2 -r 528398a241d8 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Mon Feb 13 19:59:59 2012 +0000
+++ b/distrib/sets/lists/tests/mi       Mon Feb 13 21:03:06 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.435 2012/02/11 23:31:23 martin Exp $
+# $NetBSD: mi,v 1.436 2012/02/13 21:03:06 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -322,13 +322,13 @@
 ./usr/libdata/debug/usr/tests/kernel/kqueue/write/t_fifo.debug         tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/kqueue/write/t_pipe.debug         tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/kqueue/write/t_ttypty.debug       tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/posix_spawn                       tests-kernel-tests
-./usr/libdata/debug/usr/tests/kernel/posix_spawn/t_spawn.debug         tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/posix_spawn/t_spawnattr.debug     tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/posix_spawn/t_fileactions.debug   tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/posix_spawn/h_spawn.debug         tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/posix_spawn/h_fileactions.debug   tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/posix_spawn/h_spawnattr.debug     tests-kernel-tests      debug,atf
+./usr/libdata/debug/usr/tests/kernel/posix_spawn                       tests-kernel-tests      obsolete
+./usr/libdata/debug/usr/tests/kernel/posix_spawn/t_spawn.debug         tests-kernel-tests      obsolete
+./usr/libdata/debug/usr/tests/kernel/posix_spawn/t_spawnattr.debug     tests-kernel-tests      obsolete
+./usr/libdata/debug/usr/tests/kernel/posix_spawn/t_fileactions.debug   tests-kernel-tests      obsolete
+./usr/libdata/debug/usr/tests/kernel/posix_spawn/h_spawn.debug         tests-kernel-tests      obsolete
+./usr/libdata/debug/usr/tests/kernel/posix_spawn/h_fileactions.debug   tests-kernel-tests      obsolete
+./usr/libdata/debug/usr/tests/kernel/posix_spawn/h_spawnattr.debug     tests-kernel-tests      obsolete
 ./usr/libdata/debug/usr/tests/kernel/t_extattrctl.debug                        tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_extent.debug                    tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_filedesc.debug                  tests-kernel-tests      debug,atf
@@ -365,6 +365,13 @@
 ./usr/libdata/debug/usr/tests/lib/libc/db                              tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/db/h_db.debug                   tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen                             tests-lib-debug
+./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn                 tests-kernel-tests
+./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/t_spawn.debug           tests-kernel-tests      debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/t_spawnattr.debug       tests-kernel-tests      debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/t_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_fileactions.debug     tests-kernel-tests      debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn/h_spawnattr.debug       tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_alarm.debug               tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_assert.debug              tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/t_basedirname.debug         tests-lib-debug         debug,atf
@@ -1897,16 +1904,16 @@
 ./usr/tests/kernel/kqueue/write/t_fifo         tests-kernel-tests              atf
 ./usr/tests/kernel/kqueue/write/t_pipe         tests-kernel-tests              atf
 ./usr/tests/kernel/kqueue/write/t_ttypty       tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn                 tests-kernel-tests
-./usr/tests/kernel/posix_spawn/Atffile         tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/t_spawn         tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/t_spawnattr     tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/t_fileactions   tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/h_spawn         tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/h_spawnattr     tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/h_fileactions   tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/h_nonexec       tests-kernel-tests              atf
-./usr/tests/kernel/posix_spawn/h_zero          tests-kernel-tests              atf
+./usr/tests/kernel/posix_spawn                 tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/Atffile         tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/t_spawn         tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/t_spawnattr     tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/t_fileactions   tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/h_spawn         tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/h_spawnattr     tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/h_fileactions   tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/h_nonexec       tests-kernel-tests              obsolete
+./usr/tests/kernel/posix_spawn/h_zero          tests-kernel-tests              obsolete
 ./usr/tests/kernel/t_extattrctl                        tests-kernel-tests              atf
 ./usr/tests/kernel/t_extent                    tests-kernel-tests              atf
 ./usr/tests/kernel/t_filedesc                  tests-kernel-tests              atf
@@ -1955,6 +1962,16 @@
 ./usr/tests/lib/libc/db/t_db                   tests-lib-tests         atf
 ./usr/tests/lib/libc/gen                       tests-lib-tests
 ./usr/tests/lib/libc/gen/Atffile               tests-lib-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/t_spawn           tests-kernel-tests      atf
+./usr/tests/lib/libc/gen/posix_spawn/t_spawnattr       tests-kernel-tests      atf
+./usr/tests/lib/libc/gen/posix_spawn/t_fileactions     tests-kernel-tests      atf
+./usr/tests/lib/libc/gen/posix_spawn/h_spawn           tests-kernel-tests      atf
+./usr/tests/lib/libc/gen/posix_spawn/h_spawnattr       tests-kernel-tests      atf
+./usr/tests/lib/libc/gen/posix_spawn/h_fileactions     tests-kernel-tests      atf
+./usr/tests/lib/libc/gen/posix_spawn/h_nonexec tests-kernel-tests              atf
+./usr/tests/lib/libc/gen/posix_spawn/h_zero    tests-kernel-tests              atf
 ./usr/tests/lib/libc/gen/t_alarm               tests-lib-tests         atf
 ./usr/tests/lib/libc/gen/t_assert              tests-lib-tests         atf
 ./usr/tests/lib/libc/gen/t_basedirname         tests-lib-tests         atf
diff -r 1f2f9d73d1a2 -r 528398a241d8 etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Mon Feb 13 19:59:59 2012 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Mon Feb 13 21:03:06 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.59 2012/02/11 23:31:23 martin Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.60 2012/02/13 21:03:06 martin Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -44,7 +44,6 @@
 ./usr/libdata/debug/usr/tests/kernel/kqueue
 ./usr/libdata/debug/usr/tests/kernel/kqueue/read
 ./usr/libdata/debug/usr/tests/kernel/kqueue/write
-./usr/libdata/debug/usr/tests/kernel/posix_spawn
 ./usr/libdata/debug/usr/tests/kernel/tty
 ./usr/libdata/debug/usr/tests/lib
 ./usr/libdata/debug/usr/tests/lib/csu
@@ -52,6 +51,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc
 ./usr/libdata/debug/usr/tests/lib/libc/db
 ./usr/libdata/debug/usr/tests/lib/libc/gen
+./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
 ./usr/libdata/debug/usr/tests/lib/libc/inet
@@ -169,7 +169,6 @@
 ./usr/tests/kernel/kqueue
 ./usr/tests/kernel/kqueue/read
 ./usr/tests/kernel/kqueue/write
-./usr/tests/kernel/posix_spawn
 ./usr/tests/kernel/tty
 ./usr/tests/lib
 ./usr/tests/lib/csu
@@ -177,6 +176,7 @@
 ./usr/tests/lib/libc
 ./usr/tests/lib/libc/db
 ./usr/tests/lib/libc/gen
+./usr/tests/lib/libc/gen/posix_spawn
 ./usr/tests/lib/libc/hash
 ./usr/tests/lib/libc/hash/data
 ./usr/tests/lib/libc/locale
diff -r 1f2f9d73d1a2 -r 528398a241d8 tests/kernel/Makefile
--- a/tests/kernel/Makefile     Mon Feb 13 19:59:59 2012 +0000
+++ b/tests/kernel/Makefile     Mon Feb 13 21:03:06 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2012/02/11 23:31:24 martin Exp $
+# $NetBSD: Makefile,v 1.24 2012/02/13 21:03:06 martin Exp $
 
 NOMAN=         # defined
 
@@ -6,7 +6,7 @@
 
 TESTSDIR=      ${TESTSBASE}/kernel
 
-TESTS_SUBDIRS= posix_spawn kqueue tty
+TESTS_SUBDIRS= kqueue tty
 
 TESTS_C=       t_lock
 TESTS_C+=      t_lwpctl
diff -r 1f2f9d73d1a2 -r 528398a241d8 tests/kernel/posix_spawn/Makefile
--- a/tests/kernel/posix_spawn/Makefile Mon Feb 13 19:59:59 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2012/02/11 23:31:24 martin Exp $
-
-NOMAN=         # defined
-
-.include <bsd.own.mk>
-
-TESTSDIR=      ${TESTSBASE}/kernel/posix_spawn
-
-TESTS_C=       t_spawn
-TESTS_C+=      t_fileactions
-TESTS_C+=      t_spawnattr
-
-BINDIR=                ${TESTSDIR}
-SCRIPTSDIR=    ${TESTSDIR}
-
-PROGS=         h_fileactions
-PROGS+=                h_spawn
-PROGS+=                h_spawnattr
-SCRIPTS=       h_nonexec h_zero
-
-h_zero:
-       dd if=/dev/zero of=h_zero bs=1k count=2
-       chmod a+x h_zero
-
-CLEANFILES+=   h_nonexec h_zero
-
-.include <bsd.test.mk>
-
diff -r 1f2f9d73d1a2 -r 528398a241d8 tests/kernel/posix_spawn/Makefile.inc
--- a/tests/kernel/posix_spawn/Makefile.inc     Mon Feb 13 19:59:59 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-.include "../Makefile.inc"
diff -r 1f2f9d73d1a2 -r 528398a241d8 tests/kernel/posix_spawn/h_fileactions.c
--- a/tests/kernel/posix_spawn/h_fileactions.c  Mon Feb 13 19:59:59 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/* $NetBSD: h_fileactions.c,v 1.1 2012/02/11 23:31:24 martin Exp $ */
-
-/*-
- * Copyright (c) 2012 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles Zhang <charles%NetBSD.org@localhost> and
- * Martin Husemann <martin%NetBSD.org@localhost>.
- *
- * 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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/stat.h>
-
-#define BUFSIZE        16
-
-/*
- * This checks (hardcoded) the assumptions that are setup from the
- * main test program via posix spawn file actions.
- * Program exits with EXIT_SUCCESS or EXIT_FAILURE accordingly
- * (and does some stderr diagnostics in case of errors).
- */
-int
-main(int argc, char **argv)
-{
-       int res = EXIT_SUCCESS;
-       char buf[BUFSIZE];
-       struct stat sb0, sb1;
-
-       strcpy(buf, "test...");
-       /* file desc 3 should be closed via addclose */
-       if (read(3, buf, BUFSIZE) != -1 || errno != EBADF) {
-               fprintf(stderr, "%s: filedesc 3 is not closed\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       /* file desc 4 should be closed via closeonexec */
-       if (read(4, buf, BUFSIZE) != -1 || errno != EBADF) {
-               fprintf(stderr, "%s: filedesc 4 is not closed\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       /* file desc 5 remains open */
-       if (write(5, buf, BUFSIZE) <= 0) {
-               fprintf(stderr, "%s: could not write to filedesc 5\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       /* file desc 6 should be open (via addopen) */
-       if (write(6, buf, BUFSIZE) <= 0) {
-               fprintf(stderr, "%s: could not write to filedesc 6\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       /* file desc 7 should refer to stdout */
-       fflush(stdout);
-       if (fstat(fileno(stdout), &sb0) != 0) {
-               fprintf(stderr, "%s: could not fstat stdout\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       if (fstat(7, &sb1) != 0) {
-               fprintf(stderr, "%s: could not fstat filedesc 7\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       if (write(7, buf, strlen(buf)) <= 0) {
-               fprintf(stderr, "%s: could not write to filedesc 7\n",
-                   getprogname());
-               res = EXIT_FAILURE;
-       }
-       if (memcmp(&sb0, &sb1, sizeof sb0) != 0) {
-               fprintf(stderr, "%s: stat results differ\n", getprogname());
-               res = EXIT_FAILURE;
-       }
-
-       return res;
-}
-
diff -r 1f2f9d73d1a2 -r 528398a241d8 tests/kernel/posix_spawn/h_nonexec.sh
--- a/tests/kernel/posix_spawn/h_nonexec.sh     Mon Feb 13 19:59:59 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-#! /nonexistent
-
-# this is just a dummy script, trying to be non-executable
diff -r 1f2f9d73d1a2 -r 528398a241d8 tests/kernel/posix_spawn/h_spawn.c



Home | Main Index | Thread Index | Old Index