Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Migrate the ssp tests from regress to atf.
details: https://anonhg.NetBSD.org/src/rev/51a42166ee63
branches: trunk
changeset: 760103:51a42166ee63
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Dec 27 02:04:18 2010 +0000
description:
Migrate the ssp tests from regress to atf.
Of the 17 tests, 4 fail in both the regress and atf style. 3 additional
tests fails in atf that did NOT fail in regress: gets, fgets, and read.
I will investigate why, and update when I can, but it is still useful to
get these tests into the new format where they can be exercised.
diffstat:
distrib/sets/lists/tests/mi | 41 +++++-
etc/mtree/NetBSD.dist.tests | 4 +-
tests/lib/libc/Makefile | 4 +-
tests/lib/libc/ssp/Makefile | 47 ++++++
tests/lib/libc/ssp/h_fgets.c | 46 ++++++
tests/lib/libc/ssp/h_getcwd.c | 47 ++++++
tests/lib/libc/ssp/h_gets.c | 43 +++++
tests/lib/libc/ssp/h_memcpy.c | 48 ++++++
tests/lib/libc/ssp/h_memmove.c | 48 ++++++
tests/lib/libc/ssp/h_memset.c | 45 ++++++
tests/lib/libc/ssp/h_raw.c | 55 +++++++
tests/lib/libc/ssp/h_read.c | 47 ++++++
tests/lib/libc/ssp/h_readlink.c | 47 ++++++
tests/lib/libc/ssp/h_snprintf.c | 45 ++++++
tests/lib/libc/ssp/h_sprintf.c | 43 +++++
tests/lib/libc/ssp/h_strcat.c | 46 ++++++
tests/lib/libc/ssp/h_strcpy.c | 45 ++++++
tests/lib/libc/ssp/h_strncat.c | 48 ++++++
tests/lib/libc/ssp/h_strncpy.c | 47 ++++++
tests/lib/libc/ssp/h_vsnprintf.c | 57 +++++++
tests/lib/libc/ssp/h_vsprintf.c | 55 +++++++
tests/lib/libc/ssp/t_ssp.sh | 280 +++++++++++++++++++++++++++++++++++++++
22 files changed, 1184 insertions(+), 4 deletions(-)
diffs (truncated from 1316 to 300 lines):
diff -r 4ccd41d8d684 -r 51a42166ee63 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sun Dec 26 23:55:52 2010 +0000
+++ b/distrib/sets/lists/tests/mi Mon Dec 27 02:04:18 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.191 2010/12/26 13:35:54 pgoyette Exp $
+# $NetBSD: mi,v 1.192 2010/12/27 02:04:18 pgoyette Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -324,6 +324,25 @@
./usr/libdata/debug/usr/tests/lib/libc/gen/t_siginfo.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/hash tests-lib-debug
./usr/libdata/debug/usr/tests/lib/libc/hash/t_sha2.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp tests-lib-debug
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_fgets.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_getcwd.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_gets.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_memcpy.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_memmove.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_memset.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_raw.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_read.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_readlink.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_snprintf.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_sprintf.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_strcat.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_strcpy.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_strncat.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_strncpy.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_vsnprintf.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/h_vsprintf.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/ssp/t_ssp.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/stdio tests-lib-debug
./usr/libdata/debug/usr/tests/lib/libc/stdio/t_fmemopen.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/stdio/t_format.debug tests-lib-debug debug,atf
@@ -1558,6 +1577,26 @@
./usr/tests/lib/libc/stdlib/t_environment_pth tests-lib-tests atf
./usr/tests/lib/libc/stdlib/t_mi_vector_hash tests-lib-tests atf
./usr/tests/lib/libc/stdlib/t_strtox tests-lib-tests atf
+./usr/tests/lib/libc/ssp tests-lib-tests
+./usr/tests/lib/libc/ssp/Atffile tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_fgets tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_getcwd tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_gets tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_memcpy tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_memmove tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_memset tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_raw tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_read tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_readlink tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_snprintf tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_sprintf tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_strcat tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_strcpy tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_strncat tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_strncpy tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_vsnprintf tests-lib-tests atf
+./usr/tests/lib/libc/ssp/h_vsprintf tests-lib-tests atf
+./usr/tests/lib/libc/ssp/t_ssp tests-lib-tests atf
./usr/tests/lib/libc/stdio tests-lib-tests
./usr/tests/lib/libc/stdio/Atffile tests-lib-tests atf
./usr/tests/lib/libc/stdio/t_fmemopen tests-lib-tests atf
diff -r 4ccd41d8d684 -r 51a42166ee63 etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests Sun Dec 26 23:55:52 2010 +0000
+++ b/etc/mtree/NetBSD.dist.tests Mon Dec 27 02:04:18 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.dist.tests,v 1.7 2010/12/25 21:10:25 pgoyette Exp $
+# $NetBSD: NetBSD.dist.tests,v 1.8 2010/12/27 02:04:19 pgoyette Exp $
./usr/libdata/debug/usr/tests
./usr/libdata/debug/usr/tests/atf
@@ -47,6 +47,7 @@
./usr/libdata/debug/usr/tests/lib/libc
./usr/libdata/debug/usr/tests/lib/libc/gen
./usr/libdata/debug/usr/tests/lib/libc/hash
+./usr/libdata/debug/usr/tests/lib/libc/ssp
./usr/libdata/debug/usr/tests/lib/libc/stdio
./usr/libdata/debug/usr/tests/lib/libc/stdlib
./usr/libdata/debug/usr/tests/lib/libc/string
@@ -140,6 +141,7 @@
./usr/tests/lib/libc
./usr/tests/lib/libc/gen
./usr/tests/lib/libc/hash
+./usr/tests/lib/libc/ssp
./usr/tests/lib/libc/stdio
./usr/tests/lib/libc/stdlib
./usr/tests/lib/libc/string
diff -r 4ccd41d8d684 -r 51a42166ee63 tests/lib/libc/Makefile
--- a/tests/lib/libc/Makefile Sun Dec 26 23:55:52 2010 +0000
+++ b/tests/lib/libc/Makefile Mon Dec 27 02:04:18 2010 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.9 2010/12/25 21:10:25 pgoyette Exp $
+# $NetBSD: Makefile,v 1.10 2010/12/27 02:04:19 pgoyette Exp $
.include <bsd.own.mk>
-TESTS_SUBDIRS+= gen hash stdlib stdio string
+TESTS_SUBDIRS+= gen hash ssp stdlib stdio string
TESTSDIR= ${TESTSBASE}/lib/libc
diff -r 4ccd41d8d684 -r 51a42166ee63 tests/lib/libc/ssp/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/ssp/Makefile Mon Dec 27 02:04:18 2010 +0000
@@ -0,0 +1,47 @@
+# $NetBSD: Makefile,v 1.1 2010/12/27 02:04:19 pgoyette Exp $
+
+NOMAN= # defined
+
+.include <bsd.own.mk>
+
+WARNS= 4
+
+CPPFLAGS+= -D_FORTIFY_SOURCE=2
+CFLAGS+= -fstack-protector-all -Wstack-protector
+LDFLAGS+= -fstack-protector-all -Wstack-protector
+
+# Bootstrap hack
+
+.ifmake !clean && !obj && !cleandir
+.BEGIN:
+ ${AR} cr libssp_nonshared.a
+.endif
+
+CLEANFILES+= libssp_nonshared.a
+LDFLAGS+= -L.
+
+TESTSDIR= ${TESTSBASE}/lib/libc/ssp
+
+TESTS_SH+= t_ssp
+
+BINDIR= ${TESTSDIR}
+
+PROGS= h_fgets
+PROGS+= h_gets
+PROGS+= h_getcwd
+PROGS+= h_memcpy
+PROGS+= h_memmove
+PROGS+= h_memset
+PROGS+= h_raw
+PROGS+= h_read
+PROGS+= h_readlink
+PROGS+= h_snprintf
+PROGS+= h_sprintf
+PROGS+= h_strcat
+PROGS+= h_strcpy
+PROGS+= h_strncat
+PROGS+= h_strncpy
+PROGS+= h_vsnprintf
+PROGS+= h_vsprintf
+
+.include <bsd.test.mk>
diff -r 4ccd41d8d684 -r 51a42166ee63 tests/lib/libc/ssp/h_fgets.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/ssp/h_fgets.c Mon Dec 27 02:04:18 2010 +0000
@@ -0,0 +1,46 @@
+/* $NetBSD: h_fgets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 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 <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_fgets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ int len = atoi(argv[1]);
+ (void)fgets(b, len, stdin);
+ (void)printf("%s\n", b);
+
+ return 0;
+}
diff -r 4ccd41d8d684 -r 51a42166ee63 tests/lib/libc/ssp/h_getcwd.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/ssp/h_getcwd.c Mon Dec 27 02:04:18 2010 +0000
@@ -0,0 +1,47 @@
+/* $NetBSD: h_getcwd.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 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 <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_getcwd.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[MAXPATHLEN];
+ size_t len = atoi(argv[1]);
+ (void)getcwd(b, len);
+ (void)printf("%s\n", b);
+ return 0;
+}
diff -r 4ccd41d8d684 -r 51a42166ee63 tests/lib/libc/ssp/h_gets.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/ssp/h_gets.c Mon Dec 27 02:04:18 2010 +0000
@@ -0,0 +1,43 @@
+/* $NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2008 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 <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+ char b[10];
+ (void)gets(b);
+ (void)printf("%s\n", b);
+ return 0;
+}
Home |
Main Index |
Thread Index |
Old Index