Index: projects/stable-10-backport-test-changes/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c =================================================================== --- projects/stable-10-backport-test-changes/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c (revision 313467) +++ projects/stable-10-backport-test-changes/contrib/netbsd-tests/lib/libc/c063/t_utimensat.c (revision 313468) @@ -1,212 +1,215 @@ /* $NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Emmanuel Dreyfus. * * 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 __RCSID("$NetBSD: t_utimensat.c,v 1.5 2013/03/17 04:46:06 jmmv Exp $"); #include #include #include #include #include #include #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #define DIR "dir" #define FILE "dir/utimensat" #define BASEFILE "utimensat" #define LINK "dir/symlink" #define BASELINK "symlink" #define FILEERR "dir/symlink" const struct timespec tptr[] = { { 0x12345678, 987654321 }, { 0x15263748, 123456789 }, }; ATF_TC(utimensat_fd); ATF_TC_HEAD(utimensat_fd, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat works with fd"); } ATF_TC_BODY(utimensat_fd, tc) { int dfd; int fd; struct stat st; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1); ATF_REQUIRE(utimensat(dfd, BASEFILE, tptr, 0) == 0); ATF_REQUIRE(close(dfd) == 0); ATF_REQUIRE(stat(FILE, &st) == 0); ATF_REQUIRE(st.st_atimespec.tv_sec == tptr[0].tv_sec); ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec); ATF_REQUIRE(st.st_mtimespec.tv_sec == tptr[1].tv_sec); ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec); } ATF_TC(utimensat_fdcwd); ATF_TC_HEAD(utimensat_fdcwd, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat works with fd as AT_FDCWD"); } ATF_TC_BODY(utimensat_fdcwd, tc) { int fd; struct stat st; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(chdir(DIR) == 0); ATF_REQUIRE(utimensat(AT_FDCWD, BASEFILE, tptr, 0) == 0); ATF_REQUIRE(stat(BASEFILE, &st) == 0); ATF_REQUIRE(st.st_atimespec.tv_sec == tptr[0].tv_sec); ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec); ATF_REQUIRE(st.st_mtimespec.tv_sec == tptr[1].tv_sec); ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec); } ATF_TC(utimensat_fdcwderr); ATF_TC_HEAD(utimensat_fdcwderr, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat fails with fd as AT_FDCWD and bad path"); } ATF_TC_BODY(utimensat_fdcwderr, tc) { ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE(utimensat(AT_FDCWD, FILEERR, tptr, 0) == -1); } ATF_TC(utimensat_fderr1); ATF_TC_HEAD(utimensat_fderr1, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat fail with bad path"); } ATF_TC_BODY(utimensat_fderr1, tc) { int dfd; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1); ATF_REQUIRE(utimensat(dfd, FILEERR, tptr, 0) == -1); ATF_REQUIRE(close(dfd) == 0); } ATF_TC(utimensat_fderr2); ATF_TC_HEAD(utimensat_fderr2, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat fails with bad fdat"); } ATF_TC_BODY(utimensat_fderr2, tc) { int dfd; int fd; char cwd[MAXPATHLEN]; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE((dfd = open(getcwd(cwd, MAXPATHLEN), O_RDONLY, 0)) != -1); ATF_REQUIRE(utimensat(dfd, BASEFILE, tptr, 0) == -1); ATF_REQUIRE(close(dfd) == 0); } ATF_TC(utimensat_fderr3); ATF_TC_HEAD(utimensat_fderr3, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat fails with fd as -1"); } ATF_TC_BODY(utimensat_fderr3, tc) { int fd; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); ATF_REQUIRE(close(fd) == 0); ATF_REQUIRE(utimensat(-1, FILE, tptr, 0) == -1); } ATF_TC(utimensat_fdlink); ATF_TC_HEAD(utimensat_fdlink, tc) { atf_tc_set_md_var(tc, "descr", "See that utimensat works on symlink"); } ATF_TC_BODY(utimensat_fdlink, tc) { int dfd; struct stat st; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE(symlink(FILE, LINK) == 0); /* NB: FILE does not exists */ ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1); ATF_REQUIRE(utimensat(dfd, BASELINK, tptr, 0) == -1); ATF_REQUIRE(errno = ENOENT); ATF_REQUIRE(utimensat(dfd, BASELINK, tptr, AT_SYMLINK_NOFOLLOW) == 0); ATF_REQUIRE(close(dfd) == 0); ATF_REQUIRE(lstat(LINK, &st) == 0); ATF_REQUIRE(st.st_atimespec.tv_sec == tptr[0].tv_sec); ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec); ATF_REQUIRE(st.st_mtimespec.tv_sec == tptr[1].tv_sec); ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, utimensat_fd); ATF_TP_ADD_TC(tp, utimensat_fdcwd); ATF_TP_ADD_TC(tp, utimensat_fdcwderr); ATF_TP_ADD_TC(tp, utimensat_fderr1); ATF_TP_ADD_TC(tp, utimensat_fderr2); ATF_TP_ADD_TC(tp, utimensat_fderr3); ATF_TP_ADD_TC(tp, utimensat_fdlink); return atf_no_error(); } Index: projects/stable-10-backport-test-changes/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh =================================================================== --- projects/stable-10-backport-test-changes/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh (revision 313467) +++ projects/stable-10-backport-test-changes/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh (revision 313468) @@ -1,460 +1,463 @@ # $NetBSD: t_ssp.sh,v 1.7 2014/04/06 19:28:59 christos 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. # h_pass() { echo "Executing command [ $2$1 ]" eval $2 atf_check -s exit:0 -o ignore -e ignore $1 } h_fail() { echo "Executing command [ $2$1 ]" # Begin FreeBSD ulimit -c 0 if true; then eval $2 atf_check -s signal -o ignore -e ignore $1 else # End FreeBSD eval $2 atf_check -s signal:6 -o ignore -e ignore $1 # Begin FreeBSD fi # End FreeBSD } atf_test_case sprintf sprintf_head() { atf_set "descr" "Checks sprintf(3)" } sprintf_body() { prog="$(atf_get_srcdir)/h_sprintf" h_pass "$prog ok" # Begin FreeBSD if true; then h_fail "$prog 0123456789ab" else # End FreeBSD h_fail "$prog 0123456789" # Begin FreeBSD fi # End FreeBSD } atf_test_case vsprintf vsprintf_head() { atf_set "descr" "Checks vsprintf(3)" } vsprintf_body() { prog="$(atf_get_srcdir)/h_vsprintf" h_pass "$prog ok" # Begin FreeBSD if true; then h_fail "$prog 0123456789ab" else # End FreeBSD h_fail "$prog 0123456789" # Begin FreeBSD fi # End FreeBSD } atf_test_case snprintf snprintf_head() { atf_set "descr" "Checks snprintf(3)" } snprintf_body() { prog="$(atf_get_srcdir)/h_snprintf" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case vsnprintf vsnprintf_head() { atf_set "descr" "Checks vsnprintf(3)" } vsnprintf_body() { prog="$(atf_get_srcdir)/h_vsnprintf" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case gets gets_head() { atf_set "descr" "Checks gets(3)" } gets_body() { prog="$(atf_get_srcdir)/h_gets" h_pass "$prog" "echo ok |" # Begin FreeBSD if true; then h_fail "$prog" "echo 0123456789ab |" else # End FreeBSD h_fail "$prog" "echo 0123456789 |" # Begin FreeBSD fi # End FreeBSD } atf_test_case fgets fgets_head() { atf_set "descr" "Checks fgets(3)" } fgets_body() { prog="$(atf_get_srcdir)/h_fgets" h_pass "$prog 10" "echo ok |" # Begin FreeBSD if true; then h_fail "$prog 13" "echo 0123456789abc |" else # End FreeBSD h_fail "$prog 11" "echo busted |" # Begin FreeBSD fi # End FreeBSD } atf_test_case memcpy memcpy_head() { atf_set "descr" "Checks memcpy(3)" } memcpy_body() { prog="$(atf_get_srcdir)/h_memcpy" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case memmove memmove_head() { atf_set "descr" "Checks memmove(3)" } memmove_body() { prog="$(atf_get_srcdir)/h_memmove" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case memset memset_head() { atf_set "descr" "Checks memset(3)" } memset_body() { prog="$(atf_get_srcdir)/h_memset" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case strcpy strcpy_head() { atf_set "descr" "Checks strcpy(3)" } strcpy_body() { prog="$(atf_get_srcdir)/h_strcpy" h_pass "$prog 0123456" # Begin FreeBSD if true; then h_fail "$prog 0123456789ab" else # End FreeBSD h_fail "$prog 0123456789" # Begin FreeBSD fi # End FreeBSD } atf_test_case stpcpy stpcpy_head() { atf_set "descr" "Checks stpcpy(3)" } stpcpy_body() { prog="$(atf_get_srcdir)/h_stpcpy" h_pass "$prog 0123456" # Begin FreeBSD if true; then h_fail "$prog 0123456789ab" else # End FreeBSD h_fail "$prog 0123456789" # Begin FreeBSD fi # End FreeBSD } atf_test_case strcat strcat_head() { atf_set "descr" "Checks strcat(3)" } strcat_body() { prog="$(atf_get_srcdir)/h_strcat" h_pass "$prog 0123456" h_fail "$prog 0123456789ABCDEF" } atf_test_case strncpy strncpy_head() { atf_set "descr" "Checks strncpy(3)" } strncpy_body() { prog="$(atf_get_srcdir)/h_strncpy" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case stpncpy stpncpy_head() { atf_set "descr" "Checks stpncpy(3)" } stpncpy_body() { prog="$(atf_get_srcdir)/h_stpncpy" h_pass "$prog 10" # Begin FreeBSD if true; then h_fail "$prog 13" else # End FreeBSD h_fail "$prog 11" # Begin FreeBSD fi # End FreeBSD } atf_test_case strncat strncat_head() { atf_set "descr" "Checks strncat(3)" } strncat_body() { prog="$(atf_get_srcdir)/h_strncat" # Begin FreeBSD h_pass "$prog 8" if true; then h_fail "$prog 11" else # End FreeBSD h_fail "$prog 9" # Begin FreeBSD fi # End FreeBSD } atf_test_case raw raw_head() { atf_set "descr" "Checks raw array overflow" } raw_body() { prog="$(atf_get_srcdir)/h_raw" + # Begin FreeBSD + [ -x $prog ] || atf_skip "$prog is missing; skipping testcase" + # End FreeBSD h_pass "$prog 9" # Begin FreeBSD if true; then h_fail "$prog 12" else # End FreeBSD h_fail "$prog 10" # Begin FreeBSD fi # End FreeBSD } atf_test_case read read_head() { atf_set "descr" "Checks read(2)" } read_body() { prog="$(atf_get_srcdir)/h_read" h_pass "$prog 1024" "echo foo |" # Begin FreeBSD if true; then h_fail "$prog 1027" "echo bar |" else # End FreeBSD h_fail "$prog 1025" "echo bar |" # Begin FreeBSD fi # End FreeBSD } atf_test_case readlink readlink_head() { atf_set "descr" "Checks readlink(2)" } readlink_body() { prog="$(atf_get_srcdir)/h_readlink" # Begin FreeBSD if true; then h_pass "$prog 512" h_fail "$prog 523" else # End FreeBSD h_pass "$prog 1024" h_fail "$prog 1025" # Begin FreeBSD fi # End FreeBSD } atf_test_case getcwd getcwd_head() { atf_set "descr" "Checks getcwd(3)" } getcwd_body() { prog="$(atf_get_srcdir)/h_getcwd" h_pass "$prog 1024" # Begin FreeBSD if false; then # End FreeBSD h_fail "$prog 1025" # Begin FreeBSD fi # End FreeBSD } atf_init_test_cases() { atf_add_test_case sprintf atf_add_test_case vsprintf atf_add_test_case snprintf atf_add_test_case vsnprintf atf_add_test_case gets atf_add_test_case fgets atf_add_test_case memcpy atf_add_test_case memmove atf_add_test_case memset atf_add_test_case stpcpy atf_add_test_case stpncpy atf_add_test_case strcat atf_add_test_case strcpy atf_add_test_case strncat atf_add_test_case strncpy atf_add_test_case raw atf_add_test_case read atf_add_test_case readlink atf_add_test_case getcwd } Index: projects/stable-10-backport-test-changes/lib/libc/tests/c063/Makefile =================================================================== --- projects/stable-10-backport-test-changes/lib/libc/tests/c063/Makefile (revision 313467) +++ projects/stable-10-backport-test-changes/lib/libc/tests/c063/Makefile (revision 313468) @@ -1,26 +1,27 @@ # $FreeBSD$ TESTSDIR= ${TESTSBASE}/lib/libc/c063 -#TODO: t_o_search, t_utimensat +#TODO: t_o_search NETBSD_ATF_TESTS_C= faccessat_test NETBSD_ATF_TESTS_C+= fchmodat_test NETBSD_ATF_TESTS_C+= fchownat_test NETBSD_ATF_TESTS_C+= fexecve_test NETBSD_ATF_TESTS_C+= fstatat_test NETBSD_ATF_TESTS_C+= linkat_test NETBSD_ATF_TESTS_C+= mkdirat_test NETBSD_ATF_TESTS_C+= mkfifoat_test NETBSD_ATF_TESTS_C+= mknodat_test NETBSD_ATF_TESTS_C+= openat_test NETBSD_ATF_TESTS_C+= readlinkat_test NETBSD_ATF_TESTS_C+= renameat_test NETBSD_ATF_TESTS_C+= symlinkat_test NETBSD_ATF_TESTS_C+= unlinkat_test +NETBSD_ATF_TESTS_C+= utimensat CFLAGS+= -D_INCOMPLETE_XOPEN_C063 .include "../Makefile.netbsd-tests" .include Index: projects/stable-10-backport-test-changes/lib/libc/tests/ssp/Makefile =================================================================== --- projects/stable-10-backport-test-changes/lib/libc/tests/ssp/Makefile (revision 313467) +++ projects/stable-10-backport-test-changes/lib/libc/tests/ssp/Makefile (revision 313468) @@ -1,45 +1,49 @@ # $FreeBSD$ .include TESTSDIR= ${TESTSBASE}/lib/libc/ssp NO_WERROR= WARNS?= 2 CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector .if ${COMPILER_TYPE} == "clang" CFLAGS.h_raw+= -fsanitize=bounds .elif ${COMPILER_TYPE} == "gcc" CFLAGS.h_raw+= --param ssp-buffer-size=1 DPADD+= ${LIBSSP} LDADD+= -lssp .endif NETBSD_ATF_TESTS_SH= ssp_test BINDIR= ${TESTSDIR} PROGS= h_fgets PROGS+= h_gets PROGS+= h_getcwd PROGS+= h_memcpy PROGS+= h_memmove PROGS+= h_memset +# This testcase doesn't run properly when not compiled with -fsantize=bounds +# with clang, which is currently contingent on a compiler_rt update +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500 PROGS+= h_raw +.endif PROGS+= h_read PROGS+= h_readlink PROGS+= h_snprintf PROGS+= h_sprintf PROGS+= h_stpcpy PROGS+= h_stpncpy PROGS+= h_strcat PROGS+= h_strcpy PROGS+= h_strncat PROGS+= h_strncpy PROGS+= h_vsnprintf PROGS+= h_vsprintf .include "../Makefile.netbsd-tests" .include Index: projects/stable-10-backport-test-changes =================================================================== --- projects/stable-10-backport-test-changes (revision 313467) +++ projects/stable-10-backport-test-changes (revision 313468) Property changes on: projects/stable-10-backport-test-changes ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r276527,277648