History log of /freebsd-10-stable/contrib/netbsd-tests/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
337244 03-Aug-2018 asomers

MFC r328266:

mlock(2): correct documentation for error conditions.

The man page is years out of date regarding errors. Our implementation _does_
allow unaligned addresses, and it _does_not_ check for negative lengths,
because the length is unsigned. It checks for overflow instead.

Update the tests accordingly.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D13826

330520 05-Mar-2018 asomers

MFC r320726, r320727

r320726:
Expect :snprintf_float to segfault

This issue started occurring within the past month or so.

PR: 220502
Reported by: Jenkins (amd64-head job)

r320727:
:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.

Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.

MFC with: r320726
PR: 220502

330422 04-Mar-2018 bdrewery

MFC r329271:

nanosleep(2): Fix bogus incrementing of rmtp by tc_tick_sbt on [EINTR].

321878 01-Aug-2017 asomers

MFC r320737, r320914

r320737:
Fix cleanup in lib/libc/gen/setdomainname_test

ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR: 219967
Reviewed by: ngie
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11188

r320914:
Remove an extraneous strlen from t_setdomainname.c

Reported by: Coverity
CID: 1377568
X-MFC-With: 320737
Sponsored by: Spectra Logic Corp

320710 06-Jul-2017 ngie

MFC r319637:

Add testcases for `cat -b`

320708 06-Jul-2017 ngie

MFC r319634:

Add additional testcases for cat(1)

Verify the following additional cases:
- -s (in isolation, in addition to the -se testcase obtained via the
NetBSD test).
- -vt

319484 02-Jun-2017 ngie

MFC r318211:

Fix up previous commit

- Apply the logic to the FreeBSD block
- Fix a typo with the getconf(1) call that I would have caught, were
it not for the fact that I got the blocks wrong.
- Consolidate the hardcoded buffer sizes to the NetBSD block.

This would have been discovered had I run the test on a system where
PATH_MAX != 1024 (I don't have that at my disposal right at this moment).

MFC with: r318210

319483 02-Jun-2017 ngie

MFC r318210:

ssp_test:read:: query the value of MAXPATHLEN via getconf(1)

In the event the value of PATH_MAX was changed, the assumption that
MAXPATHLEN is 1024 (and hence the buffer length required to trigger
SSP to fail for read(2)) would be invalidated. Query getconf(1) for
the actual value of MAXPATHLEN via _XOPEN_PATH_MAX instead, and
increment the value by 1 to ensure that the SSP support tests the
stack smashing support properly.

319094 29-May-2017 ngie

MFC r316179,r316180,r316181,r316260:

r316179 (by cem):

t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflow

msgsnd's msgsz argument is the size of the message following the 'long'
message type. Don't include the message type in the size of the message
when invoking msgsnd(2).

CID: 1368712

r316180 (by cem):

Follow-up to r316179: More of the same

CIDs: 1368705, 1368706, 1368707, 1368710

r316181 (by cem):

t_msgctl: Fix the same msgsnd() misuse as t_msgsnd

msgsnd(2)'s msgsz argument does not describe the full structure, only the
message component.

CIDs: 1368703, 1368711

r316260:

Annotate all changes made in r316178-r316180 with __FreeBSD__

Restore the stock (upstream) code under an #else block, so it's easier
for me to visualize and understand the code that needs to be upstreamed.

319093 29-May-2017 ngie

MFC r318315:

lib/libc/gen/realpath_test: make check result from getcwd(3)

This is being done to avoid dereferencing a NULL pointer via strlcat,
obscuring the underlying issue with the getcwd(3) call.

319007 27-May-2017 ngie

MFC r318546:

sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic

The previous logic was flawed in the sense that it assumed that /dev/md3
was always available. This was a caveat I noted in r306038, that I hadn't
gotten around to solving before now.

Cache the device for the mountpoint after executing mdmfs, then use the
cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
device.

Apply sed expressions to use reuse logic in the NetBSD code that could
also be applied to FreeBSD, just with different tools.

318756 23-May-2017 ngie

:raw no longer SIGSEGVs on FreeBSD; revert the signal expectation

This is a direct commit to ^/stable/10, since this expectation was only
added to ^/stable/10's copy of t_raw.c.

PR: 216954
Sponsored by: Dell EMC Isilon

318327 15-May-2017 brooks

MFC r317660, r317710

r317660:
Support clnt_raw's use of FD_SETSIZE as a fake file descriptor.

Accomplish this by allocating space for it in __svc_xports and allowing
it to be registered. The failure to allocate space was causing an
out-of-bounds read in svc_getreq_common(). The failure to register
caused PR 211804.

The bug was found with CHERI bounds checking.

PR: 211804
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D10528

r317710:
Remove expected failure now that it was fixed in r317660.

PR: 211804
Reviewed by: ngie
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10576

314817 07-Mar-2017 ngie

MFC r314450,r313439:

r314450:

Add additional __FreeBSD_version guards around the hsearch_r testcases

The reasoning for this is the same as r276046: to ease MFCing the tests
to ^/stable/10 .

This was accidentally missed in r313439

r313439 | ngie | 2017-02-08 01:46:15 -0800 (Wed, 08 Feb 2017) | 25 lines

Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head

The primary end-goal of this drop is ease future merges with NetBSD and
collaborate further with the NetBSD project.

The goal was (largely, not completely as some items are still oustanding
in the NetBSD GNATS system) achieved by doing the following:
- Pushing as many changes required to port contrib/netbsd-tests
back to NetBSD as possible, then pull the upstream applied changes
back in to FreeBSD.
- Diff reduce with upstream where possible by:
-- Improving libnetbsd header, etc compat glue.
-- Using _SED variables to modify test scripts on the fly for items
that could not be upstreamed to NetBSD.

As a bonus for this work, this change also introduces testcases for
uniq(1).

Many thanks to Christos for working with me to get many of the changes
back into the NetBSD project.

In collaboration with: Christos Zoulas <christos@netbsd.org>


dev/audio/t_pad_output.bz2.uue
dev/cgd/t_cgd_3des.c
dev/cgd/t_cgd_aes.c
dev/cgd/t_cgd_blowfish.c
dev/clock_subr
dev/scsipi/t_cd.c
dev/sysmon/t_swwdog.c
fs/common/h_fsmacros.h
fs/ffs/h_quota2_tests.c
fs/ffs/t_fifos.c
fs/ffs/t_mount.c
fs/ffs/t_quota2_1.c
fs/ffs/t_quota2_remount.c
fs/ffs/t_snapshot.c
fs/ffs/t_snapshot_log.c
fs/ffs/t_snapshot_v2.c
fs/hfs/t_pathconvert.c
fs/kernfs/t_basic.c
fs/lfs/t_pr.c
fs/msdosfs/t_snapshot.c
fs/nfs/t_mountd.c
fs/nullfs/t_basic.c
fs/ptyfs/t_nullpts.c
fs/ptyfs/t_ptyfs.c
fs/puffs/t_basic.c
fs/puffs/t_fuzz.c
fs/puffs/t_io.c
fs/tmpfs/t_mknod.sh
fs/tmpfs/t_readdir.sh
fs/tmpfs/t_renamerace.c
fs/umapfs/t_basic.c
fs/union/t_pr.c
fs/vfs/t_full.c
fs/vfs/t_io.c
fs/vfs/t_mtime_otrunc.c
fs/vfs/t_renamerace.c
fs/vfs/t_ro.c
fs/vfs/t_rwtoro.c
fs/vfs/t_union.c
fs/vfs/t_unpriv.c
fs/vfs/t_vfsops.c
fs/vfs/t_vnops.c
include/sys/t_socket.c
kernel/arch
kernel/kqueue/read/t_fifo.c
kernel/kqueue/read/t_file.c
kernel/kqueue/read/t_file2.c
kernel/kqueue/read/t_pipe.c
kernel/kqueue/read/t_ttypty.c
kernel/kqueue/t_ioctl.c
kernel/kqueue/t_proc1.c
kernel/kqueue/t_proc2.c
kernel/kqueue/t_proc3.c
kernel/kqueue/t_sig.c
kernel/kqueue/t_vnode.c
kernel/kqueue/write/t_fifo.c
kernel/kqueue/write/t_pipe.c
kernel/kqueue/write/t_ttypty.c
kernel/t_extent.c
kernel/t_filedesc.c
kernel/t_lock.c
kernel/t_mqueue.c
kernel/t_ptrace.c
kernel/t_ptrace_wait.c
kernel/t_pty.c
kernel/t_rnd.c
lib/libc/c063/t_mkfifoat.c
lib/libc/db/t_db.sh
lib/libc/gen/exect
lib/libc/gen/posix_spawn/t_spawnattr.c
lib/libc/gen/t_glob.c
lib/libc/gen/t_humanize_number.c
lib/libc/gen/t_sleep.c
lib/libc/hash/h_hash.c
lib/libc/hash/t_hmac.c
lib/libc/hash/t_sha2.c
lib/libc/locale/t_io.c
lib/libc/regex/debug.c
lib/libc/regex/t_exhaust.c
lib/libc/regex/t_regex_att.c
lib/libc/rpc/t_rpc.c
lib/libc/setjmp/t_setjmp.c
lib/libc/setjmp/t_threadjmp.c
lib/libc/ssp/h_memset.c
lib/libc/ssp/h_read.c
lib/libc/stdlib/h_getopt.c
lib/libc/stdlib/h_getopt_long.c
lib/libc/stdlib/t_hsearch.c
lib/libc/stdlib/t_strtod.c
lib/libc/string/t_strlen.c
lib/libc/sys/t_clock_gettime.c
lib/libc/sys/t_connect.c
lib/libc/sys/t_dup.c
lib/libc/sys/t_getcontext.c
lib/libc/sys/t_getrusage.c
lib/libc/sys/t_kevent.c
lib/libc/sys/t_link.c
lib/libc/sys/t_listen.c
lib/libc/sys/t_mincore.c
lib/libc/sys/t_mlock.c
lib/libc/sys/t_mmap.c
lib/libc/sys/t_msgctl.c
lib/libc/sys/t_msgrcv.c
lib/libc/sys/t_msgsnd.c
lib/libc/sys/t_msync.c
lib/libc/sys/t_nanosleep.c
lib/libc/sys/t_pipe.c
lib/libc/sys/t_pipe2.c
lib/libc/sys/t_posix_fadvise.c
lib/libc/sys/t_revoke.c
lib/libc/sys/t_select.c
lib/libc/sys/t_setrlimit.c
lib/libc/sys/t_sigaction.c
lib/libc/sys/t_sigqueue.c
lib/libc/sys/t_socketpair.c
lib/libc/sys/t_stat.c
lib/libc/sys/t_timer_create.c
lib/libc/sys/t_truncate.c
lib/libc/sys/t_umask.c
lib/libc/sys/t_unlink.c
lib/libc/sys/t_wait.c
lib/libc/sys/t_wait_noproc.c
lib/libc/sys/t_write.c
lib/libm/t_ilogb.c
lib/libm/t_pow.c
lib/libm/t_precision.c
lib/libm/t_scalbn.c
lib/libposix/t_rename.c
lib/libpthread/h_common.h
lib/libpthread/t_condwait.c
lib/libpthread/t_detach.c
lib/libpthread/t_fork.c
lib/libpthread/t_fpu.c
lib/libpthread/t_join.c
lib/libpthread/t_mutex.c
lib/libpthread/t_once.c
lib/libpthread/t_sem.c
lib/libpthread/t_swapcontext.c
lib/libpthread_dbg
lib/librefuse
lib/librt/t_sem.c
lib/librumpclient/t_fd.c
lib/semaphore/sem.c
libexec/ld.elf_so/t_dlerror-cleared.c
libexec/ld.elf_so/t_dlerror-false.c
libexec/ld.elf_so/t_dlinfo.c
libexec/ld.elf_so/t_ifunc.c
modules/t_builtin.c
net/bpf/t_bpf.c
net/bpf/t_mbuf.c
net/bpfilter/t_bpfilter.c
net/bpfjit/t_bpfjit.c
net/bpfjit/t_cop.c
net/bpfjit/t_extmem.c
net/bpfjit/t_mbuf.c
net/carp/t_basic.c
net/carp/t_basic.sh
net/config/netconfig.c
net/icmp/t_forward.c
net/icmp/t_ping.c
net/if/t_ifconfig.sh
net/if_loop/t_pr.c
net/if_tun
net/if_vlan
net/ndp/t_ra.sh
net/net/t_raw.c
rump/modautoload/t_modautoload.c
rump/rumpkern/t_kern.c
rump/rumpkern/t_lwproc.c
rump/rumpkern/t_modcmd.c
rump/rumpkern/t_modlinkset.c
rump/rumpkern/t_signals.c
rump/rumpkern/t_threads.c
rump/rumpkern/t_tsleep.c
rump/rumpkern/t_vm.c
rump/rumpvfs/t_basic.c
rump/rumpvfs/t_etfs.c
rump/rumpvfs/t_p2kifs.c
sys/uvm
usr.bin/grep/t_grep.sh
usr.bin/mixerctl
usr.bin/uniq
usr.sbin/mtree/t_mtree.sh
/freebsd-10-stable/etc/mtree/BSD.tests.dist
/freebsd-10-stable/lib/libc/tests/hash/Makefile
/freebsd-10-stable/lib/libc/tests/regex/Makefile
/freebsd-10-stable/tests/sys/fs/tmpfs/Makefile
/freebsd-10-stable/usr.bin/uniq/Makefile
/freebsd-10-stable/usr.bin/uniq/tests
/freebsd-10-stable/usr.bin/uniq/tests/Makefile
314004 21-Feb-2017 ngie

MFC r312520:

Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test
suite as usr.bin/sed/sed_test

Don't expect :emptybackref to fail -- it succeeds on FreeBSD

Expect :preserve_leading_ws_ia to fail -- it fails on ^/stable/10, but not on
^/stable/11 or ^/head

313718 14-Feb-2017 ngie

MFC r313377:

Expect :floatunditf to fail on FreeBSD/i386

The precision error on FreeBSD/i386 doesn't match the expected output in
long double form.

313632 11-Feb-2017 ngie

MFC r312102,r312108:

r312102:

Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD

r312108:

Delete trailing whitespace and use __arraycount instead of nitems in contrib code

313535 10-Feb-2017 ngie

MFC r311925,r311968,r311969,r312008:

r311925:

Import testcase updates with code contributed back to NetBSD

This also (inadvertently) contains an update to
contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).

In collaboration with: christos@NetBSD.org

r311968:

Fix lib/libc/sys/access_test after r311925

sys/param.h needs to be #included in order for __FreeBSD_version to be checked

r311969:

Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile

This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

r312008:

Upgrade NetBSD tests to 01.11.2017_23.20 snapshot

This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on: amd64, i386


crypto/libcrypto/t_libcrypto.sh
crypto/libcrypto/t_pubkey.sh
dev/audio/h_pad.c
dev/audio/t_pad_output.bz2.uue
dev/cgd/t_cgd_3des.c
dev/cgd/t_cgd_aes.c
dev/cgd/t_cgd_blowfish.c
fs/ffs/ffs_common.sh
fs/fifofs/t_fifo.c
fs/psshfs/t_psshfs.sh
fs/puffs/t_basic.c
fs/vfs/t_vnops.c
h_macros.h
kernel/msg.h
kernel/t_mqueue.c
kernel/t_ptrace.c
kernel/t_ptrace_wait.c
kernel/t_ptrace_wait.h
kernel/t_ptrace_wait3.c
kernel/t_ptrace_wait4.c
kernel/t_ptrace_wait6.c
kernel/t_ptrace_waitid.c
kernel/t_ptrace_waitpid.c
lib/libc/arch/sparc64/exec_prot_support.c
lib/libc/arch/sparc64/return_one.S
lib/libc/c063/t_faccessat.c
lib/libc/c063/t_fchmodat.c
lib/libc/c063/t_fchownat.c
lib/libc/c063/t_fexecve.c
lib/libc/c063/t_fstatat.c
lib/libc/c063/t_mkfifoat.c
lib/libc/c063/t_mknodat.c
lib/libc/c063/t_o_search.c
lib/libc/c063/t_openat.c
lib/libc/c063/t_readlinkat.c
lib/libc/c063/t_unlinkat.c
lib/libc/c063/t_utimensat.c
lib/libc/db/h_db.c
lib/libc/db/t_db.sh
lib/libc/gen/posix_spawn/t_fileactions.c
lib/libc/gen/t_assert.c
lib/libc/gen/t_dir.c
lib/libc/gen/t_fnmatch.c
lib/libc/gen/t_ftok.c
lib/libc/gen/t_humanize_number.c
lib/libc/gen/t_sleep.c
lib/libc/gen/t_time.c
lib/libc/gen/t_ttyname.c
lib/libc/gen/t_vis.c
lib/libc/rpc/t_rpc.c
lib/libc/stdlib/t_strtod.c
lib/libc/string/t_memcpy.c
lib/libc/string/t_memmem.c
lib/libc/string/t_strchr.c
lib/libc/string/t_strerror.c
lib/libc/sync/cpp_atomic_ops_linkable.cc
lib/libc/sys/t_access.c
lib/libc/sys/t_chroot.c
lib/libc/sys/t_clock_nanosleep.c
lib/libc/sys/t_getrusage.c
lib/libc/sys/t_mincore.c
lib/libc/sys/t_mmap.c
lib/libc/sys/t_wait.c
lib/libc/sys/t_wait_noproc.c
lib/libc/sys/t_wait_noproc_wnohang.c
lib/libc/t_cdb.c
lib/libm/t_casinh.c
lib/libm/t_fe_round.c
lib/libm/t_ilogb.c
lib/libm/t_ldexp.c
lib/libm/t_precision.c
lib/libpthread/h_common.h
lib/libpthread/t_mutex.c
lib/libpthread/t_timedmutex.c
lib/librumpclient/h_execthr.c
lib/librumphijack/t_tcpip.sh
lib/libusbhid/t_usbhid.c
net/arp/t_arp.sh
net/arp/t_dad.sh
net/icmp/t_icmp6_redirect.sh
net/icmp/t_icmp_redirect.sh
net/if/t_compat.c
net/if/t_ifconfig.sh
net/if_bridge/t_bridge.sh
net/if_gif/t_gif.sh
net/if_pppoe/t_pppoe.sh
net/if_tap/t_tap.sh
net/mcast/t_mcast.sh
net/ndp/t_dad.sh
net/ndp/t_ndp.sh
net/ndp/t_ra.sh
net/net/t_forwarding.sh
net/net/t_ipaddress.sh
net/net/t_ipv6_lifetime.sh
net/net/t_ipv6address.sh
net/net/t_mtudisc.sh
net/net/t_mtudisc6.sh
net/net/t_ping6_opts.sh
net/net_common.sh
net/route/t_change.sh
net/route/t_flags.sh
net/route/t_flags6.sh
net/route/t_route.sh
rump/modautoload/t_modautoload.c
rump/rumpkern/t_lwproc.c
sys/net/t_print.c
usr.bin/config/t_config.sh
usr.bin/netpgpverify/t_netpgpverify.sh
usr.bin/xlint/lint1/d_c99_anon_union.c
usr.bin/xlint/lint1/d_c99_union_cast.c
/freebsd-10-stable/lib/libc/tests/db/Makefile
/freebsd-10-stable/lib/libc/tests/gen/Makefile
/freebsd-10-stable/lib/libc/tests/stdlib/Makefile
/freebsd-10-stable/lib/libc/tests/sys/Makefile
/freebsd-10-stable/lib/libthr/tests/Makefile
/freebsd-10-stable/lib/msun/tests/Makefile
313521 10-Feb-2017 ngie

MFC r311229,r311244:

r311229:

humanize_number_basic: don't leak buf

CID: 1251407

r311244:

mmap_prot_3, mmap_truncate, mmap_truncate_signal: don't leak fd and map

CID: 978306, 1251406, 1288196, 1300541

313520 10-Feb-2017 ngie

MFC r311233,r311377:

r311233:

Fix Coverity issues

- Initialize .sun_len before passing it to strlcpy and bind.
- Close fd on error

CID: 978283, 979581

r311377:

Redo fix for CID 979581

The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].

SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.

313518 10-Feb-2017 ngie

MFC r309774,r309778,r309779,r309780:

r309774:

Only run mdconfig -d -u 3 if /dev/md3 exists on the system

This will prevent "cleanup failures" (exit code != 0 returned) when
tmpfs is not loaded

r309778:

Make test_unmount usable in cleanup subroutines

- Duplicate test_unmount to _test_unmount
- Remove atf_check calls
- Call _test_unmount from test_unmount, checking the exit code
at the end, and returning it to maintain the test_unmount
"contract"

r309779:

- Ignore errors from umount
- Use _test_unmount instead of test_unmount in cleanup

r309780:

Use _test_unmount instead of test_unmount in cleanup to avoid
false positives with atf_check when tmpfs is not loaded, etc

313517 10-Feb-2017 ngie

MFC r309373:
r309373 (by bdrewery):

Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired.

This uses the same fix as r294894 did for the mlock test. The code from
that commit is moved into a common object file which PROGS supports
building first.

313516 10-Feb-2017 ngie

MFC r307701:

Expect tests/sys/fs/tmpfs/link_test:kqueue to fail

It fails with: "dir/b did not receive NOTE_LINK"

Also, add needed cleanup logic to cleanup the mountpoint after the fact

PR: 213662

313515 10-Feb-2017 ngie

MFC r307553,r307583:

r307553 (by br):

Skip test on MIPS as it modifies TLS pointer in set_mcontext().

Discussed with: kib

r307583 (by br):

Skip test on FreeBSD only. So test can be upstreamed to NetBSD.

Requested by: ngie

313514 10-Feb-2017 ngie

MFC r307190,r307196,r307204,r307205:

r307190:

Skip :uchg on FreeBSD

Unfortunately removing files with uchg set always succeeds with root on
FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
because mounting tmpfs requires root

PR: 212861

r307196:

Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD

- Add inttypes.h #include for PRId64 macro
- Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
fhandle_t, unlike NetBSD's copy of fhp, which is void*.

r307204:

Expect :large to fail on FreeBSD

FreeBSD doesn't appear to validate large -o size values like
NetBSD does

PR: 212862

r307205:

Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected

PR: 212861
Suggested by: jmmv

313513 10-Feb-2017 ngie

MFC r306784:
r306784 (by emaste):

Add test for a musl libc memmem bug

With a short needle (aka little) musl's memmem could read past the end
of the haystack (aka big). This was fixed in musl commit c718f9f.

313512 10-Feb-2017 ngie

MFC r306038:

Port vnd_test to FreeBSD

Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD.

TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3"
(in both the FreeBSD and NetBSD cases).

313511 10-Feb-2017 ngie

MFC r303840:
r303840 (by jhb):

Add timer_settime tests using SIGEV_THREAD.

Note that these tests should work fine on NetBSD and other systems as
SIGEV_THREAD is POSIX.

313510 10-Feb-2017 ngie

MFC r301753:

Fix up r274061

Detect /usr/share/dict/words the "right way" by using require.files instead of
the hacked up attempt in the dict(..) function, which didn't work properly on
systems where MK_DICT == no.

313509 10-Feb-2017 ngie

MFC r288444:

This change has no functional impact on ^/stable/10 because arm64 isn't
supported on 10.x, but it is being done to ease additional backports in
this test

r288444 (by andrew):

Pass 8 arguments to makecontext on arm64 as this is all we support.

Obtained from: EuroBSDCon Devsummit

313508 10-Feb-2017 ngie

MFC r305468:

Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...

proc2_test must be skipped because the invariant tested
(`ke.fflags & NOTE_TRACKERR`) doesn't pass.

313500 10-Feb-2017 ngie

Expect :raw to fail with a SIGSEGV on ^/stable/10

I haven't fully dug into why this happens, but it happens
deterministically on ^/stable/10, but not on ^/stable/11 or
^/head

PR: 216954
Sponsored by: Dell EMC Isilon

313498 10-Feb-2017 ngie

MFC r305358,r305449,r305451,r306367,r306397,r309474:

This also contains a merge of ^/projects/netbsd-tests-update-12@r304035 .
This change never hit ^/head because bin/cat's behavior was changed (on ^/head)
to match NetBSD.

PR: 210607

r305358:

Update contrib/netbsd-tests with new content from NetBSD

This updates the snapshot from 09/30/2014 to 08/11/2016

This brings in a number of new testcases from upstream, most
notably:

- bin/cat
- lib/libc
- lib/msun
- lib/libthr
- usr.bin/sort

lib/libc/tests/stdio/open_memstream_test.c was moved to
lib/libc/tests/stdio/open_memstream2_test.c to accomodate
the new open_memstream test from NetBSD.

Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox

r305449:

Install h_db to unbreak some of the lib/libc/db testcases after
r305358

r305451:

Fix lib/libc/rpc test assumptions added in r305358

- Require root in the tcp/udp subtests (it's needed on FreeBSD when
registering services).
- Skip the tests if service registration fails.

r306367 (by br):

Allow up to 6 arguments only on MIPS.

r306397 (by br):

Use right piece of code for FreeBSD.

r309474:

Don't build :strvis_locale if VIS_NOLOCALE is undefined

The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features
in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower
in conditionally running the test instead of backporting the newer version of
libc-vis


/freebsd-10-stable/bin/cat/tests/Makefile
bin/cat/d_align.in
bin/cat/d_align.out
bin/cat/d_se_output.in
bin/cat/d_se_output.out
bin/cat/t_cat.sh
bin/sh/dotcmd/scoped_command
bin/sh/dotcmd/t_dotcmd.sh
bin/sh/t_arith.sh
bin/sh/t_cmdsub.sh
bin/sh/t_compexit.sh
bin/sh/t_evaltested.sh
bin/sh/t_exit.sh
bin/sh/t_expand.sh
bin/sh/t_fsplit.sh
bin/sh/t_here.sh
bin/sh/t_option.sh
bin/sh/t_redir.sh
bin/sh/t_redircloexec.sh
bin/sh/t_set_e.sh
bin/sh/t_shift.sh
bin/sh/t_ulimit.sh
bin/sh/t_varquote.sh
bin/sh/t_varval.sh
bin/sh/t_wait.sh
crypto/opencrypto/t_opencrypto.sh
dev/audio/t_pad_output.bz2.uue
dev/dm/h_dm.c
dev/fss
dev/sysmon/t_swsensor.sh
dev/sysmon/t_swwdog.c
dev/usb
fs/common/fstest_lfs.c
fs/common/h_fsmacros.h
fs/nfs/nfsservice/mountd.c
fs/nfs/nfsservice/nfsd.c
fs/nfs/nfsservice/rumpnfsd.c
fs/nfs/t_rquotad.sh
fs/tmpfs/t_vnd.sh
fs/vfs/t_io.c
fs/vfs/t_renamerace.c
fs/vfs/t_unpriv.c
fs/vfs/t_vnops.c
games/t_factor.sh
h_macros.h
include/sys/t_bitops.c
include/sys/t_cdefs.c
include/sys/t_pslist.c
include/sys/t_socket.c
include/t_paths.c
ipf/expected/n14
ipf/expected/n14_6
ipf/t_filter_parse.sh
ipf/t_nat_exec.sh
kernel/kqueue/t_ioctl.c
kernel/kqueue/t_proc1.c
kernel/kqueue/t_proc2.c
kernel/kqueue/t_proc3.c
kernel/kqueue/t_vnode.c
kernel/t_rnd.c
lib/libbpfjit/t_bpfjit.c
lib/libc/arch/ia64/return_one.S
lib/libc/arch/powerpc/return_one.S
lib/libc/arch/riscv/return_one.S
lib/libc/db/h_lfsr.c
lib/libc/db/t_db.sh
lib/libc/db/t_db_hash_seq.c
lib/libc/gen/execve/t_execve.c
lib/libc/gen/isqemu.h
lib/libc/gen/posix_spawn/t_spawn.c
lib/libc/gen/t_fnmatch.c
lib/libc/gen/t_fpsetmask.c
lib/libc/gen/t_nice.c
lib/libc/gen/t_randomid.c
lib/libc/gen/t_siginfo.c
lib/libc/gen/t_sleep.c
lib/libc/gen/t_time.c
lib/libc/gen/t_vis.c
lib/libc/inet/t_inet_addr.c
lib/libc/inet/t_inet_network.c
lib/libc/net/t_servent.sh
lib/libc/rpc/t_rpc.c
lib/libc/stdio/t_open_memstream.c
lib/libc/stdlib/t_getenv.c
lib/libc/stdlib/t_posix_memalign.c
lib/libc/stdlib/t_strtod.c
lib/libc/stdlib/t_strtoi.c
lib/libc/stdlib/t_strtol.c
lib/libc/string/t_memset.c
lib/libc/sync/cpp_atomic_ops_linkable.cc
lib/libc/sys/t_bind.c
lib/libc/sys/t_connect.c
lib/libc/sys/t_getcontext.c
lib/libc/sys/t_getrusage.c
lib/libc/sys/t_getsockname.c
lib/libc/sys/t_kevent.c
lib/libc/sys/t_mlock.c
lib/libc/sys/t_mmap.c
lib/libc/sys/t_mprotect.c
lib/libc/sys/t_posix_fallocate.c
lib/libc/sys/t_setrlimit.c
lib/libc/sys/t_sigqueue.c
lib/libc/sys/t_wait.c
lib/libc/time/t_strptime.c
lib/libcurses/director/testlang_parse.y
lib/libm/t_exp.c
lib/libm/t_fenv.c
lib/libm/t_fmod.c
lib/libm/t_hypot.c
lib/libm/t_log.c
lib/libm/t_pow.c
lib/libpthread/t_cond.c
lib/libpthread/t_mutex.c
lib/libpthread/t_rwlock.c
lib/librumpclient/t_exec.sh
lib/librumpclient/t_fd.c
lib/librumphijack/t_tcpip.sh
lib/libusbhid
lib/libutil/t_parsedate.c
net/arp
net/bpfilter/t_bpfilter.c
net/bpfjit/t_bpfjit.c
net/icmp/t_forward.c
net/icmp/t_icmp6_redirect.sh
net/icmp/t_icmp_redirect.sh
net/icmp/t_ping.c
net/icmp/t_ping2.sh
net/if/ifconf.c
net/if/t_ifconf.sh
net/if/t_ifconfig.sh
net/if_bridge/t_bridge.sh
net/if_gif
net/if_pppoe
net/if_tap
net/in_cksum
net/mcast
net/mpls/t_ldp_regen.sh
net/mpls/t_mpls_fw.sh
net/mpls/t_mpls_fw6.sh
net/mpls/t_mpls_fw64.sh
net/mpls/t_rfc4182.sh
net/ndp
net/net/t_forwarding.sh
net/net/t_ipaddress.sh
net/net/t_ipv6_lifetime.sh
net/net/t_ipv6address.sh
net/net/t_tcp.c
net/route/t_change.sh
net/route/t_flags.sh
net/route/t_flags6.sh
net/route/t_route.sh
rump/modautoload/t_modautoload.c
rump/rumpkern/h_server/h_simpleserver.c
rump/rumpkern/t_lwproc.c
rump/rumpkern/t_sp.sh
rump/rumpnet/t_shmif.sh
rump/rumpvfs/t_p2kifs.c
sbin/gpt
sbin/resize_ffs/common.sh
sbin/resize_ffs/t_check.sh
sbin/resize_ffs/t_grow.sh
sbin/resize_ffs/t_grow_swapped.sh
sbin/resize_ffs/t_shrink.sh
sbin/resize_ffs/t_shrink_swapped.sh
sbin/sysctl/t_perm.sh
share/mk/t_lib.sh
share/mk/t_prog.sh
share/mk/t_test.sh
sys/net
sys/netatalk
sys/netinet
sys/netinet6
usr.bin/cc/t_hello.sh
usr.bin/config/d_min
usr.bin/config/support/conf/files
usr.bin/config/t_config.sh
usr.bin/gdb
usr.bin/ld
usr.bin/make/t_make.sh
usr.bin/netpgpverify/Testspec
usr.bin/netpgpverify/t_netpgpverify.sh
usr.bin/sed/t_sed.sh
usr.bin/sort/d_any_char_dflag_out.txt
usr.bin/sort/d_any_char_fflag_out.txt
usr.bin/sort/d_any_char_iflag_out.txt
usr.bin/xlint/lint1/d_c99_anon_struct.c
usr.bin/xlint/lint1/d_c99_compound_literal_comma.c
usr.bin/xlint/lint1/d_c99_flex_array_packed.c
usr.bin/xlint/lint1/d_c99_nested_struct.c
usr.bin/xlint/lint1/d_c99_union_init4.c
usr.bin/xlint/lint1/d_cast_fun_array_param.c
usr.bin/xlint/lint1/d_type_question_colon.c
usr.bin/xlint/lint1/d_typefun.c
usr.sbin/traceroute/t_traceroute.sh
/freebsd-10-stable/lib/libc/tests/db/Makefile
/freebsd-10-stable/lib/libc/tests/hash/Makefile
/freebsd-10-stable/lib/libc/tests/inet/Makefile
/freebsd-10-stable/lib/libc/tests/stdio/Makefile
/freebsd-10-stable/lib/libc/tests/stdio/open_memstream2_test.c
/freebsd-10-stable/lib/libc/tests/stdio/open_memstream_test.c
/freebsd-10-stable/lib/libc/tests/stdlib/Makefile
/freebsd-10-stable/lib/libc/tests/sys/Makefile
/freebsd-10-stable/lib/msun/tests/Makefile
313489 09-Feb-2017 ngie

MFC r296586:
r296586 (by bdrewery):

Fix and connect setjmp test.

313482 09-Feb-2017 ngie

MFC r276527:

Don't install h_raw if dealing with clang 3.5.0+ to unbreak the tests2 Jenkins
job

The h_raw application doesn't do proper bounds checking without the option
being supplied via the build, which means that it doesn't throw signals and
fail as expected

PR: 196430

313481 09-Feb-2017 ngie

MFC r277648:
r277648 (by jilles):

Enable utimensat tests from NetBSD.

As with other tests from c063, a required #include <sys/stat.h> was missing.

313480 09-Feb-2017 ngie

MFC r283584:

Relnotes: yes

r283584 (by emaste):

memmem(3): empty little string matches the beginning of the big string

This function originated in glibc, and this matches their behaviour
(and NetBSD, OpenBSD, and musl).

An empty big string (arg "l") is handled by the existing
l_len < s_len test.

313479 09-Feb-2017 ngie

MFC r279154,r279397:

r279154 (by jilles):

nice(): Correct return value and [EPERM] error.

PR: 189821
Obtained from: NetBSD
Relnotes: yes

r279397 (by jilles):

nice(): Put back old return value, keeping [EPERM] error.

Commit r279154 changed the API and ABI significantly, and {NZERO} is still
wrong.

Also, preserve errno on success instead of setting it to 0.

PR: 189821
Relnotes: yes

313478 09-Feb-2017 ngie

MFC r305483,r306030,r306031,r306033,r306036:

r305483:

Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)

Pointyhat to: ngie

r306030:

Port vnode_leak_test:main to FreeBSD

Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`

The awk filtering method employed in NetBSD doesn't work on FreeBSD

r306031:

Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD

Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs

r306033:

Port sizes_test and statvfs_test to FreeBSD

Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD

r306036:

Port to mknod_test and readdir_test to FreeBSD

The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).

312324 17-Jan-2017 ngie

MFC r312122:

Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind

This should have been pruned in r305358

312096 14-Jan-2017 ngie

MFC r311236,r311919:

r311236:

unlink_fifo: don't leak the file descriptors opened with mkfifo and open

MFC fater: 3 days
CID: 978316, 978317

r311919:

Partially revert r311236

There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.

The mkfifo case does make sense to keep though.

312095 14-Jan-2017 ngie

MFC r311924:

Fix whitespace in comment

312092 14-Jan-2017 ngie

MFC r311926:

Consolidate __NetBSD__ #ifdef

312091 14-Jan-2017 ngie

MFC r311227,r311917:

r311227:

seekdir_basic: fix various Coverity issues

Address..
- .. resource leaks of file descriptors and memory
- .. unchecked return values from creat(2), mkdir(2), and telldir(3)
- .. potential NULL derefs after calling readdir(3)

CID: 975255, 975256, 976989, 978989, 978990

r311917:

Fix up r311227

Check for creat returning a value != -1, not a non-zero value

Pointyhat to: ngie
CID: 1368366

312039 13-Jan-2017 ngie

MFC r311268:

Clarify lifetime of child(..) function

Ensure child exits when complete as it's always run in a forked
process.

Add a missing break statement in :pselect_sigmask when calling
child(..) for clarity and to avoid weird domino effects if the
child process somehow does something it's not supposed to do
with the logfiles, file descriptors, etc

CID: 1223369, 1223370, 1300301

312038 13-Jan-2017 ngie

MFC r311265,r311274:

r311265:

fpu: ensure calls to pthread_create succeed and test sched_yield to make
sure it returns 0

sched_yield tests for values returning 0 of type int and sched_yield is
of type long, so the test is a mismatch

CID: 1254953, 1254954, 1254965, 1254966

r311274:

run: ensure pthread_condattr_{init,setclock} is successful

CID: 1268631, 1268633

312030 13-Jan-2017 ngie

MFC r311870:

Merge the grammar fix for lib/libc/gen/raise_test:raise_stress

312028 13-Jan-2017 ngie

MFC r311871:

Merge ^/vendor/NetBSD/tests/dist@r311868

This is the vendor accepted version of ^/head@r311245

311635 07-Jan-2017 ngie

MFC r311245:

tty: don't leak s after opening it with openpty

CID: 978321

311632 07-Jan-2017 ngie

MFC r311247:

mkfifoat_fd: close dfd after use to avoid leaking it

CID: 978286

311631 07-Jan-2017 ngie

MFC r311248:

mknodat_fd: close dfd after use to avoid leaking it

CID: 978287

311628 07-Jan-2017 ngie

MFC r311235:

ttyname_err: close fd if it was opened successfully

CID: 978292

311627 07-Jan-2017 ngie

MFC r311240:

kqueue_desc_passing: initialize m.msg_flags to 0

This mutes an uninitialized scalar warning from Coverity

CID: 979620

311625 07-Jan-2017 ngie

MFC r311273:

setrlimit_basic: don't leak buf; free it on completion

CID: 978311

311620 07-Jan-2017 ngie

MFC r311228:

ftok_link: don't leak fd

CID: 978291

311619 07-Jan-2017 ngie

MFC r311250:

mincore_resid: free buf after use

CID: 978304

311616 07-Jan-2017 ngie

MFC r311271:

stat_symlink: don't leak fd; close the file descriptor when done

CID: 978314

311613 07-Jan-2017 ngie

MFC r311269:

swapcontext1: test for getcontext(3) and swapcontext(3) success properly

The beforementioned libcalls both succeed if the return codes aren't -1

CID: 976790, 976791

311611 07-Jan-2017 ngie

MFC r311249:

{strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use

CID: 978299, 978300

311610 07-Jan-2017 ngie

MFC r311272:

revoke_perm: don't leak fd at the end of the test; close it

This code is unused on FreeBSD, but it mutes a valid Coverity warning
which would be true on NetBSD

CID: 978311

311608 07-Jan-2017 ngie

MFC r311246:

fexecve: don't leak fd on fexecve(2) failure; close before calling err

CID: 978285

311606 07-Jan-2017 ngie

MFC r311270:

pipe_restart: free f on function exit to quell complaint from Coverity

CID: 978307

311589 07-Jan-2017 ngie

MFC r311242:

listen_low_port: check for errors from socket(2) before continuing

CID: 976778

311587 07-Jan-2017 ngie

MFC r311239:

umask_open: don't leak fd on success

CID: 978315

310507 24-Dec-2016 ngie

MFstable/11 r310506:

MFC r309837:

Change the process limits for RLIMIT_MEMLOCK to RLIM_INFINITY when
executing :mincore_resid

The default process limits in FreeBSD is 64kB for unprivileged users,
which empirically is too low to run the :mincore_resid testcase.

Process limits are inherited, so even though the default limit for
root users is RLIM_INFINITY, the inherited limit with "sudo" with the
default login.conf will be 64kB.

Use setrlimit to set rlim_max for RLIMIT_MEMLOCK to RLIM_INFINITY to
avoid ENOMEM issues when calling mlock to wire the mmap'ed address
space.

setrlimit requires root access to increase rlim_max, so require root
privileges when running the test

Discovered when executing the tests with sudo, e.g.
"sudo kyua test -k /usr/tests/lib/libc/sys/Kyuafile mincore_test"

305190 01-Sep-2016 ngie

MFC r301752:

Update `goodResult` after recent changes made to the PRNG in libc

The PRNG was changed in r300953/r300956, and subsequently, the numbers
generated have changed. This is expected ABI breakage per ache

Tested with: amd64, i386

302447 08-Jul-2016 ngie

MFC r301749:

Add debug output to aid in determining why `goodResult` != `result`

PR: 210619 (for diagnosis)

299378 10-May-2016 asomers

MFC 294923

Fix grep_test:recurse with ZFS and TMPFS tmpdirs

contrib/netbsd-tests/usr.bin/grep/t_grep.sh
Fix grep_test:recurse when /tmp is either zfs or tmpfs. The test was
relying on an implicit ordering of directory recursion which happens to
be true when using UFS. grep's specification requires no such ordering.
The solution is to ignore the order of grep's results.

299059 04-May-2016 ngie

MFC r298366:

Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c

- Ensure socket(2) calls succeed
- Don't leak slist allocated by earlier socket(2) call

CID: 976773, 1251405

299020 04-May-2016 ngie

MFC r298368,r298660:

r298368:

Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c

Ensure opening /dev/zero succeeds. Abort the test if it doesn't.

Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero"

CID: 1251410

r298660:

Fix up r298368

Remove the semicolon accidentally added after the new conditional that tests
that /dev/zero is opened successfully.

CID: 1354980

298019 15-Apr-2016 ngie

MFC r297637:

Disable the NetBSD-specific EFAULT requirements test in gettimeofday_err

FreeBSD doesn't specifically list this as a supported error, and in some
configurations/versions of FreeBSD, this test will segfault as the memory
address might be evaluated in userspace, instead of in kernel space like
in NetBSD.

296760 12-Mar-2016 ngie

MFC r294899:

Add debug output via ATF_REQUIRE_MSG when the first call to
mlock(2) fails

This helps identify the problem with running this test on my VM
hosts (ENOMEM)

296750 12-Mar-2016 ngie

MFC r294894:

Adjust vm.max_wired in order to avoid hitting EAGAIN artificially

Set vm.max_wired to INT_MAX in :mlock_err, :mlock_mmap, and :mlock_nested to
avoid hitting EAGAIN artificially on the system when running the tests

Require root privileges in order to set the sysctl

Add allow_sysctl_side_effects to require.config as this test is now adjusting
sysctls that can affect the global system state

Unlike the version submitted by cem in OneFS, this version uses a scratch file
to save/restore the previous value of the sysctl. I _really_, _really_ wish
there were better hooks in atf/kyua for per test suite setup/teardown -- using
a file is kludgy, but it's the best I can do to avoid situations where (for
instance), sysctl(3) may fail and drop a core outside the kyua sandbox.

Based on a patch submitted by cem, but modified to take business logic out of
ATF_TP_ADD_TCS(3).

292853 29-Dec-2015 ngie

MFC r292581:

Use stable output to a test file instead of depending on the OS name being
grep'able in /bin/sh

This fixes the situation where the OS has been rebranded to something other
than `FreeBSD`

Obtained from: Isilon OneFS (^/onefs/head@r511419)
Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
Sponsored by: EMC / Isilon Storage Division

292852 29-Dec-2015 ngie

MFC r292578:

Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test

The default `sysctl kern.corefile` value is compatible with `kyua test` (FreeBSD
will dump to the current directory). If it's set to an absolute path however,
`kyua test` will not be able to clean up the corefiles after the fact

The corefiles have little value when testing the behavior of feature behavior,
so just disable corefile generation

Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division

291873 05-Dec-2015 ngie

MFC r290908,r291615:

r290908:

Integrate contrib/netbsd-tests/lib/libcrypt/t_crypt.c in to the FreeBSD
test suite as lib/libcrypt/crypt_test

Sponsored by: EMC / Isilon Storage Division

r291615 (by rodrigc):

Hack test so that it works on FreeBSD.

291870 05-Dec-2015 ngie

MFC r283801,r290846,r290851,r290856,r290860:

r283801 (by araujo):

Fix warning of implicit declaration of function 'mkdir'.

Differential Revision: D2662
Reviewed by: rodrigc, ngie

r290846:

Bump WARNS to 2

Sponsored by: EMC / Isilon Storage Division

r290851:

Change WARNS to 2 across the board with all the libc testcases

This effectively "reverts" r290846

Sponsored by: EMC / Isilon Storage Division

r290856 (by bapt):

also skip the definition of ':fopen_regular' to avoid the build to fail due to
unused variables defined by ATF macros

r290860 (by bapt):

Remove unused variables to fix building world

291764 04-Dec-2015 ngie

MFC r290913,r291181:

r290913:

Port contrib/netbsd-tests/kernel/t_mqueue.c to FreeBSD

- Add missing headers
- Ensure mqueuefs is loaded
- Make sure the mqueuefs path is absolute and relative to /
- Cast the result of mq_open returning -1 to (mqd_t) to mute a compiler
warning

Sponsored by: EMC / Isilon Storage Division

r291181:

Integrate contrib/netbsd-tests/kernel/t_mqueue into the FreeBSD test
suite as tests/sys/kern/mqueue_test

291191 23-Nov-2015 ngie

MFC r290856:
r290856 (by bap):

also skip the definition of ':fopen_regular' to avoid the build to fail due to
unused variables defined by ATF macros

291179 23-Nov-2015 ngie

MFC r290911,r290912:

r290911:

Ignore EINTR from usleep(3) in try_locks(..)

NetBSD's usleep(3) only returns -1/sets errno=EINVAL when `microseconds`
is one million or more

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r290912:

Integrate contrib/netbsd-tests/kernel/t_lockf.c into the FreeBSD test suite as
tests/sys/kern/lockf_test

Sponsored by: EMC / Isilon Storage Division

291177 23-Nov-2015 ngie

MFC r290850:

Cast xdr_void to xdrproc_t to mute -Wincompatible-pointer-types warnings from
clang

This pattern is used in other areas of lib/libc/rpc

Sponsored by: EMC / Isilon Storage Division

291176 23-Nov-2015 ngie

MFC r290869:

Redo r290847: use #ifdef __NetBSD__ on all the non-public APIs to
mute -Wunused-but-set-variable warnings with gcc dealing with the
function calls

Reported by: gcc
Sponsored by: EMC / Isilon Storage Division

291174 23-Nov-2015 ngie

MFC r290907:

Expect all testcases dealing with invalid salts to fail on FreeBSD

Sponsored by: EMC / Isilon Storage Division

291044 19-Nov-2015 ngie

MFC r290847:

Fix -Wunused warnings with variables used unlit code by adding appropriate #ifdef
guards around the variables

Sponsored by: EMC / Isilon Storage Division

290578 09-Nov-2015 ngie

MFC r290184:

Fix a set but not used variable warning flagged by gcc 4.9 with
lib/libc/ssp/h_readlink

Sponsored by: EMC / Isilon Storage Division

290574 09-Nov-2015 ngie

MFC r289487:

Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as
bin/dd/tests

Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used
in validating the characters read from /dev/zero

Sponsored by: EMC / Isilon Storage Division

287568 08-Sep-2015 rodrigc

Merge r286649:

Fix and re-enable UTF-8 tests.

X-Merge with: r287393

287551 08-Sep-2015 kib

MFC r287360:
Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.

283311 23-May-2015 rodrigc

Merge: r277829

Revert r277357 as expr has been enhanced to better detect overflow conditions,
and now the tests pass

PR: 196867
X-MFC with: r277798
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

282849 13-May-2015 ngie

MFC r281966:

Add #include sys/types.h for register_t for mips

282836 13-May-2015 ngie

MFC r282056:

The fmodl compat shims on arm/mips/powerpc aren't complete

Disable the test code for now on those architectures

PR: 199422

278413 08-Feb-2015 jilles

MFC r278038: ttyname_r(): Return actual error, not always [ENOTTY].

Adjust the test that used to fail because of this bug.

PR: 191936

277664 25-Jan-2015 ngie

MFC r277278:

r277278 (by ngie):

Fix lib/libthr/tests/detach_test

- Eliminate race with liberal use of sleep(3) [1]
- Fix NetBSD-specific implementation way of testing result from pthread_cancel
by testing with `td` instead of `NULL` [2]

PR: 196738 [1]
PR: 191906 [2]

Sponsored by: EMC / Isilon Storage Division

277549 23-Jan-2015 ngie

MFC r276671,r277357:

r276671 (by ngie):

Expect :arithmetic_ops_body to fail with syntax errors on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r277357 (by ngie):

Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
overflow checks like NetBSD's expr does

PR: 196867

277443 20-Jan-2015 ngie

MFC r276590:

r276590 (by jilles):

Link lib/libc/c063 tests to the build.

Some files lack required #include <sys/stat.h>. The #ifdef is per ngie's
request; the includes are clearly necessary for struct stat.

The faccessat test fails because it tries to use AT_SYMLINK_NOFOLLOW with
faccessat(), which is not specified by POSIX.1-2008.

Differential Revision: https://reviews.freebsd.org/D1411
Reviewed by: ngie

276672 05-Jan-2015 ngie

MFC r274618,r276521:

MFC Note: text corrected for r274618

r274618:

Add reachover Makefiles for contrib/netbsd-tests/lib/msun

A variant of this code has been tested on amd64/i386 for some time by
EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
code will remain off until it's proven it works on virtual hardware or real
hardware on other architectures

Sponsored by: EMC / Isilon Storage Division

r276521:

Reset errno in :scalbnf_val and :scalbnl_val before running the tests so the
tested errno isn't stale

This was needed in order for the test to pass on amd64 with stable/10

276478 31-Dec-2014 ngie

MFC r272343,r272458,r272890,r272891,r272901,r272902,r272903,r272905,r272908,r272909,r272910,r272914,r272915,r272979,r272980,r273010,r273011,r273012,r273015,r273017,r273019,r273020,r273021,r273022,r273023,r273024,r273025,r273389,r273390,r273391,r273393,r273395,r273396,r273397,r273410,r273516,r273517,r273520,r273521,r273522,r273523,r273524,r273525,r273526,r273527,r273528,r273529,r273530,r273533,r273534,r273535,r273536,r273537,r273538,r273539,r273540,r273572,r273574,r273578,r273579,r273591,r273592,r273928,r273933,r273935,r273936,r273937,r273938,r273942,r273943,r273945,r273946,r273947,r273948,r273949,r273950,r273951,r273952,r274061,r274062,r274066,r274067,r274072,r274074,r274079,r274090,r274142,r274143,r274571,r274572,r274573,r274574,r274575,r274576,r274577,r274579,r274597,r274598,r274599,r274600,r274601,r274626,r275033,r276046,r276430:

r272343:
r272458:

Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles

Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade

MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division

r272890:

Only build/run hsearch_basic and hsearch_r_basic on NetBSD

hdestroy1 is not present on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r272891:

Expect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic

See bin/189805 for more details

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r272901:

Disable tests that don't pass on FreeBSD due to missing support in
humanize_number(3). Bringing in additional revisions from NetBSD's
humanize_number(3) will fix the tests

Account for the fact that util.h on NetBSD is libutil.h on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r272902:

Add missing #include <sys/time.h> for gettimeofday

Sponsored by: EMC / Isilon Storage Division

r272903:

FreeBSD returns ENOTTY instead of EBADF in ttyname_r; mark it as an expected
failure

PR: 191936

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r272905:

FreeBSD doesn't support strings greater than MAXHOSTNAMELEN-1 in
{get,set}{domain,host}name. Adjust the tests to not exceed that
value when testing out the code

Add a positive and negative test for MAXHOSTNAMELEN-1 and
MAXHOSTNAMELEN, respectively

PR: 181127
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r272908:

Disable the invalid pointer test on FreeBSD

FreeBSD segfaults on invalid pointers passed to getcwd because it throbs the
address passed in in libc, whereas NetBSD just passes the information off to
the syscall, which allows the kernel to return EFAULT on bad pointers.

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r272909:

Handle getting/setting niceness/priority correctly on FreeBSD vs NetBSD

This might be fallout from PR: 189821

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r272910:

SIGPWR does not exist on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r272914:

Skip over t_spawn_open_nonexistent_diag because it requires NetBSD specific
additions to posix_spawn

Sponsored by: EMC / Isilon Storage Division

r272915:

Port the testcase to FreeBSD

- Make #include path to h_macros.h a non-relative path
- __gl_stat_t is synonymous with struct stat on FreeBSD
- FreeBSD doesn't have _DIRENT_RECLEN
- Skip over glob_star on FreeBSD (testcase doesn't pass)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r272979:

Only #include <sys/tls.h> on NetBSD

Sponsored by: EMC / Isilon Storage Division

r272980:

#include libutil.h for fparseln on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273010:

Implement 64MB memory limit for test to ensure that it fails reliably in
600 seconds; it would previously fail inconsistently when run in some virtual
machine configurations

This patch might need to be reverted or revisited later (see the attached PR
for more details)

PR: 169302

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273011:

Fix compilation errors with missing wide-type headers and fix compilation
warnings with -Wformat

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273012:

- Add libutil #include for fparseln
- Change ATF_REQUIRE_EQ_MSG to ATF_CHECK_EQ_MSG to gather all failing results
possible (currently 12 with leftassoc)
- Mark leftassoc "atf_tc_expect_fail" on FreeBSD (PR coming soon after further
analysis is done on the code)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273015:

Expect nice_err to fail on FreeBSD with unprivileged users

PR: 189821
Sponsored by: EMC / Isilon Storage Division

r273017:

Add #include <stdio.h> for printf

Sponsored by: EMC / Isilon Storage Division

r273019:

Do initial port of contrib/netbsd-tests/lib/libc/locale

t_io:
- Expect failures potentially related to implementation-specific knowledge of
the zh_TW.Big5 locale [*]

t_mbrtowc:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)
- Expect failure with mbrtowc_internal dealing with Japanese locales
(potentially related to implementation detail knowledge of the ja_* locales) [*].

t_mbstowcs, t_mbtowc, t_wctomb:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)

t_wcstod:
- Treat FreeBSD like NetBSD and Linux in the XXX: FIXME section

[*] More investigation is required to determine the root cause of the failures

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273020:

memmem with NUL length "needle" (aka small) strings on FreeBSD/OSX returns
NULL instead of the "haystack" value (aka big)

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273021:

Use 1 as a random seed, as recommended in srandom(3). Adjust the random values
accordingly

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273022:

Add #include <stdio.h> to get sys_nerr definition

Sponsored by: EMC / Isilon Storage Division

r273023:

__isnanl is automatically picked according to data type in <math.h>. There
isn't a need for the explicit __isnanl test

Sponsored by: EMC / Isilon Storage Division

r273024:

Only test the return value in mktime_negyear

Testing for the errno is an optional requirement according to POSIX, and
FreeBSD doesn't document that errno would be set on failure with mktime

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273025:

Change ATF_REQUIRE_MSG calls to ATF_CHECK_MSG to get as many errors as possible

t_strptime:common..
- Expect the testcase body as a whole to fail. Multiple PRs will be filed to
track the issues (there are 18 check failures)

t_strptime:day..
- %EA and %OA seem to be case insensitive on FreeBSD

r273389:

Port lib/libc/gen/t_siginfo to FreeBSD

- mcontext_t on FreeBSD doesn't have a __gregs field (it's split out on FreeBSD
into separate fields). In order to avoid muddying the test code with MD code,
the debugging trace info has not been implemented
- FreeBSD does not implement the si_stime and si_utime fields in siginfo_t, so
omit the debugging code that dumps the values
- sys/inttypes.h doesn't exist on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273390:

libutil.h is required for fparseln on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273391:

Add missing #include for sys/stat.h for fchmod

Sponsored by: EMC / Isilon Storage Division

r273393:

Port t_write to FreeBSD

- Mark the signo variable for the signal handle __unused
- Use limits.h instead of sys/syslimits.h (the latter does not
exist on FreeBSD)

Sponsored by: EMC / Isilon Storage Division

r273395:

Mark osi __unused so this compiles cleanly on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273396:

unlink("/") fails with EISDIR instead of EBUSY on FreeBSD; test for that
instead

Sponsored by: EMC / Isilon Storage Division

r273397:

Port t_chroot to FreeBSD

- Add missing #include sys/stat.h for mkdir(2)
- Omit the fchroot(2) tests because the support is not present on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273410:

Add sys/socket.h #include for bind(2), et al

Sponsored by: EMC / Isilon Storage Division

r273516:

Add netinet/in.h for struct sockaddr_in

Sponsored by: EMC / Isilon Storage Division

r273517:

Expect getgroups_err to fail on FreeBSD

PR: 189941
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273520:

Port t_pipe2.c to FreeBSD

- Omit the pipe2_nosigpipe testcase on FreeBSD (FreeBSD doesn't have
O_NOSIGPIPE).
- Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)".
- Save and restore the resource limit on the number of files (RLIMIT_NOFILE).

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273521:

Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273522:

- Mark unused parameters __unused in handler
- Call sigqueue with getpid() instead of 0 -- the latter idiom appears to only
be valid on NetBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273523:

Add limits.h #include for LINE_MAX

Sponsored by: EMC / Isilon Storage Division

r273524:

Add sys/socket.h #include for struct sockaddr_in

Sponsored by: EMC / Isilon Storage Division

r273525:

Port t_mmap.c to FreeBSD

- Add needed headers for the testcases
- Omit mmap_block on non-NetBSD OSes
- Use "security.bsd.map_at_zero" instead of "vm.user_va0_disable"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273526:

Omit the pollts testcases on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273527:

Omit all of the testcases as revoke(2) is only implemented on devfs(5)

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273528:

Mark signo __unused in handler(..)

Sponsored by: EMC / Isilon Storage Division

r273529:

- Omit the poll testcases on FreeBSD (they require pollts)
- Add necessary headers for the testcases

Sponsored by: EMC / Isilon Storage Division

r273530:

Add limits.h #include for INT_MAX

Sponsored by: EMC / Isilon Storage Division

r273533:

Use <atf_srcdir>/truncate_test.root_owned instead of /usr/bin/fpr as fpr does
not exist on FreeBSD

truncate_test.root_owned will be generated at build time and owned by root

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273534:

- Mark sig/signo __unused
- Do not provide a relative path via #include "h_macros.h"

Sponsored by: EMC / Isilon Storage Division

r273535:

- Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al)
- Expect overflow with rlim_max at INT64_MAX, not UINT64_MAX (rlim_t is int64_t
on FreeBSD)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273536:

Add limits.h #include for SSIZE_MAX

Sponsored by: EMC / Isilon Storage Division

r273537:

Add limits.h #include for SSIZE_MAX

Sponsored by: EMC / Isilon Storage Division

r273538:

Fix a typo (__FreeBSD__ -> __NetBSD__ when omitting setrlimit_nthr)

r273539:

Mark signum __unused

Sponsored by: EMC / Isilon Storage Division

r273540:

Omit the mprotect_exec testcase on FreeBSD

Sponsored by: EMC / Isilon Storage Division

r273572:

- Ignore EINVAL check with mknod(path, S_IFCHR, -1) as the testcase is always
executed on a non-devfs filesystem
- Expect mknod(path, S_IFREG, 0) to fail on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273574:

- Test for EINVAL requirement when passing an invalid flag in to msync(2)
- Expect ENOMEM instead of EFAULT when msync'ing a previously munmap'ed region
on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

r273578:

- Add inttypes.h and stdint.h in lieu of int_limits.h from NetBSD
- Use #include "h_macros.h" instead of relative path analog

Sponsored by: EMC / Isilon Storage Division

r273579:

- Mark signo __unused in the signal handler function
- Effectively #if 0 out some code that does not fail on FreeBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273591:

Correct my previous commit:

- getrusage_utime_back succeeds reliably on FreeBSD
- getrusage_utime_zero passes/fails in a seemingly non-deterministic manner.
Skip it for now (and fix it later)

In the initial port of this testcase to FreeBSD, the results failed reliably
in the same manner as it does on NetBSD

Sponsored by: EMC / Isilon Storage Division

r273592:

- Add sys/types.h for the APIs in sys/sysctl.h
- Poke at VM_MIN_ADDRESS in machine/vmparam.h because FreeBSD doesn't have a
vm.minaddress sysctl analog
- Expect ENOMEM instead of EAGAIN in mlock_limits
- Provide mlock an mmap'ed page twice to simulate MAP_WIRED on NetBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

r273928:

Put mtree test files into a subdirectory.

Kyua 0.11 points TMPDIR to the test's work directory, and atf_check creates
auxiliary files in TMPDIR. This confuses a couple of mtree tests that were
using the work directory's root to validate the contents of the directory.

Fix the two affected tests by creating an auxiliary directory to use for
the mtree tests. (Kyua should probably do this on its own; filed bug #133
upstream to take a look at this.)

r273933:

Don't prune duplicate services in the expected output from /etc/services on
FreeBSD

Submitted by: pho

r273935:

Port tests to FreeBSD/Linux

Some of the testcases don't work outside of NetBSD, and the behavior of
ether_aton_r differs between FreeBSD, Linux, and NetBSD, and the calls to the
API need to be massaged for FreeBSD and Linux.

Submitted by: pho

r273936:

Port lib/libc/net/h_dns_server to FreeBSD

Submitted by: pho

r273937:

Port lib/libc/sys/t_dup to FreeBSD/Linux

- The requirements differ between FreeBSD/Linux when dealing with oldd/newd
being equal (both fail with EINVAL, not EBADF)
- Add an EBADF testcase
- Fix compilation issues on clang

In collaboration with: pho

r273938:

getitimer on FreeBSD returns the last set time instead of the remaining time;
test for that instead

Submitted by: pho

r273942:

Skip :sethostname_basic because it messes up the test host's hostname

Convert code from #if defined(__FreeBSD__) to #ifdef __FreeBSD__

r273943:

Port t_kevent to FreeBSD

Submitted by: pho

r273945:

Port t_mincore to FreeBSD

Mark :mincore_resid as atf_tc_expect_fail on FreeBSD because of new bug
discovered in running the tests (it succeeded from earlier on in the year to
September/October on FreeBSD, at least)

Submitted by: pho

r273946:

Port h_atexit to FreeBSD

__cxa_atexit varies between FreeBSD and NetBSD, and thus we must use pointers
instead of static fields in the BSS. More extensive discussion is included in
the source code

In collaboration with: kib
Submitted by: pho

r273947:

Expect :snprintf_posarg_error to blow up with a SIGSEGV on !NetBSD OSes

r273948:

Disable testcases 12 and 15-22 on FreeBSD

Submitted by: pho

r273949:

Add new atf_tc_expect_fail to fflush_err; this is a new (within the past couple months) bug

r273950:

Skip :fopen_regular on !NetBSD because it's a NetBSD specific test

Submitted by: pho

r273951:

Expect :sscanf_whitespace to fail on !NetBSD OSes

Submitted by: pho

r273952:

Port h_hash and t_sha2 to FreeBSD

t_sha2 contains dirty copy-paste hacks that need to be fixed with the openssh
OpenBSD compat layer

Submitted by: pho

r274061:

Port t_db.sh to FreeBSD

- The blocksize on FreeBSD is 32kB, not 64kB
- Add some detection for MK_DICT == no; /nonexistent is echoed along with
atf_skip to ensure that the test will fail if dict(..) is called in the
non-final stage of the pipeline

Submitted by: pho

r274062:

inet_network on FreeBSD returns NULL when provided "0x" to inet_network

Submitted by: pho

r274066:

Port lib/libc/ssp to FreeBSD

In most cases, the buffers and data were resized, but when dealing with the
helpers, some of the code was adjusted to fail more reliably

Submitted by: pho

r274067:

rpc_control on FreeBSD is a public-ish API (not prefixed with __), not private
like NetBSD

Submitted by: pho

r274072:

Finish off lib/libc/stdlib/t_strtod.c port by checking for "y" twice on
FreeBSD, and always assume long long double exists on FreeBSD

Submitted by: pho

r274074:

Add Makefile snippet to ease porting NetBSD testcases to FreeBSD from
contrib/netbsd-tests

This Makefile snippet handles polluting testcases with -lnetbsd, specific
headers for ATF version differences, and does necessary rewriting for the
testcases to match the format discussed on the TestSuite wiki page
(t_<foo> -> <foo>_test)

One must define SRCTOP (inspired by projects/bmake), OBJTOP, and TESTSRC
(e.g. contrib/netbsd-tests/lib/libc/gen) to use the Makefile snippet

Test programs are specific either via NETBSD_ATF_TESTS_C or NETBSD_ATF_TESTS_SH

C++ analogs aren't currently implemented.

The imported testcases will be cleaned up to use this Makefile snippet pseudo
"API".

r274079:

Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after atf-c/config.h
was removed from the build

Pointyhat to: me (again, for not running make delete-old after running test builds)

r274090:

Fix the Jenkins test run by skipping the negative testcases earlier

The problem is that lib.libc.locale.t_io:bad_big5_wprintf was printing out
illegal Unicode characters, which causes XML parsers to bail immediately, e.g.

% kyua report-junit > ~/report.junit
% python2 -c 'import xml.dom.minidom as md; md.parse("/home/ngie/report.junit")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 27137, column 13

r274142:

Remove expected failure from lib.libc.sys.t_mincore:mincore_resid

The failure was added based on observation seen on 11.0-CURRENT @ r273153, not
based on internal testing at EMC/Isilon

PR: 194829
Tested with the following configuration:
- amd64/i386
- 11.0-CURRENT @ r273153
- 100 times in a tight loop as root with the following commands...
-- kyua test lib/libc
-- kyua test lib/libc/sys
-- kyua test lib/libc/sys/mincore_test

r274143:

Expect lib.libc.sys.getcontext_test.setcontext_link to fail on amd64; add
additional debugging to make the underlying problem more visible

Calling setcontext(2) on amd64 as shown in the test program is failing on
amd64, not i386, with a return code of -1 and an errno of EINVAL

Further investigation is being done in the PR to determine the root cause for
the failure

PR: 194828
Tested with the following configuration:
- amd64/i386
- 11.0-CURRENT @ r273153
- 100 times in a tight loop as root with the following commands...
-- kyua test lib/libc
-- kyua test lib/libc/sys
-- kyua test lib/libc/sys/getcontext_test

r274571:

Use _exit instead of exit so the file descriptors aren't flushed twice in the
child processes

Submitted by: pho

r274572:

Only expect timeouts on powerpc with NetBSD

Submitted by: pho

r274573:

Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSD

PR: 191906
In collaboration with: pho

r274574:

Add pthread_np.h #include and initialize the pthread attribute on FreeBSD

Submitted by: pho

r274575:

#ifdef out a printf on !NetBSD that causes the testcase to fail when comparing
the output from the helper program

Submitted by: pho

r274576:

Port helper program to FreeBSD, similar to ../../lib/libc/stdlib/h_atexit.c

Submitted by: pho
In collaboration with: kib

r274577:

Add missing sys/time.h #include for timespecsub macro in lib/libnetbsd/sys/time.h

r274579:

Call sem_unlink on semaphores before attempting to create them

Due to the lack of uniqueness in the semaphore name, and the fact that the
tests don't have cleanup routines, an interrupted test can leave a semaphore
"laying around", causing all subsequent attempts to run the test to fail

I will file a NetBSD PR for this issue soon

r274597:

Skip the long-double epsilon checks on FreeBSD/i386

Sponsored by: EMC / Isilon Storage Division

r274598:

Reset errno to 0 before running scalbn to be sure that the tested errno is
valid

Sponsored by: EMC / Isilon Storage Division

r274599:

Alias isinff to isinf on FreeBSD

isinf on FreeBSD automatically picks the appropriate type per math.h

Sponsored by: EMC / Isilon Storage Division

r274600:

- Expect exp2_powers to fail on FreeBSD/i386
- Expect exp2_values to fail on FreeBSD due to the small epsilon

Sponsored by: EMC / Isilon Storage Division

r274601:

- Skip over the testcases that call cbrtl on platforms where LDBL_PREC == 53
(arm, mips, powerpc). This fixes the build on these platforms, based on some
ad hoc tinderbox runs I did a while ago
- Skip cast the arguments to powl as long double so powl properly interprets
those arugments at compile-time when picking the type

Sponsored by: EMC / Isilon Storage Division

r274626:

Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) with
their #ifdef equivalents for everything changed in contrib/netbsd-tests. There
are some items from the vendor tree that use #if defined(__FreeBSD__) or
#if defined(__NetBSD__) which are being left alone

Requested by: bde, rpaulo
Sponsored by: EMC / Isilon Storage Division

r275033:

Only pass 6 arguments to the 'run' function on amd64. amd64's
makecontext on FreeBSD only supports a maximum of 6 arguments. This
fixes the setcontext_link test on amd64.

PR: 194828

r276046:

Add __FreeBSD_version guards around hsearch_r to ease MFCing the code to
stable/10

It was added when __FreeBSD_version was ~1100027

r276430:

Expect access_test:access_inval to fail before __FreeBSD_version == 1100033

This will allow me to MFC the test, as jilles@ requested that I don't MFC the
access(2) KBI change to 10-STABLE in r271655


/freebsd-10-stable/contrib/netbsd-tests
include/t_paths.c
lib/libc/db/t_db.sh
lib/libc/gen/posix_spawn/t_fileactions.c
lib/libc/gen/t_floatunditf.c
lib/libc/gen/t_fpsetmask.c
lib/libc/gen/t_getcwd.c
lib/libc/gen/t_glob.c
lib/libc/gen/t_humanize_number.c
lib/libc/gen/t_isnan.c
lib/libc/gen/t_nice.c
lib/libc/gen/t_raise.c
lib/libc/gen/t_setdomainname.c
lib/libc/gen/t_sethostname.c
lib/libc/gen/t_siginfo.c
lib/libc/gen/t_sleep.c
lib/libc/gen/t_time.c
lib/libc/gen/t_ttyname.c
lib/libc/hash/h_hash.c
lib/libc/hash/t_sha2.c
lib/libc/inet/t_inet_network.c
lib/libc/locale/t_io.c
lib/libc/locale/t_mbrtowc.c
lib/libc/locale/t_mbstowcs.c
lib/libc/locale/t_mbtowc.c
lib/libc/locale/t_wcstod.c
lib/libc/locale/t_wctomb.c
lib/libc/net/h_dns_server.c
lib/libc/net/t_ether_aton.c
lib/libc/net/t_servent.sh
lib/libc/regex/debug.c
lib/libc/regex/t_exhaust.c
lib/libc/regex/t_regex_att.c
lib/libc/rpc/t_rpc.c
lib/libc/ssp/h_memset.c
lib/libc/ssp/h_read.c
lib/libc/ssp/h_readlink.c
lib/libc/ssp/h_snprintf.c
lib/libc/ssp/t_ssp.sh
lib/libc/stdio/t_fflush.c
lib/libc/stdio/t_fmemopen.c
lib/libc/stdio/t_fopen.c
lib/libc/stdio/t_printf.c
lib/libc/stdio/t_scanf.c
lib/libc/stdlib/h_atexit.c
lib/libc/stdlib/h_getopt.c
lib/libc/stdlib/h_getopt_long.c
lib/libc/stdlib/t_getenv.c
lib/libc/stdlib/t_hsearch.c
lib/libc/stdlib/t_strtod.c
lib/libc/string/t_memcpy.c
lib/libc/string/t_memmem.c
lib/libc/string/t_strerror.c
lib/libc/sys/t_access.c
lib/libc/sys/t_chroot.c
lib/libc/sys/t_clock_gettime.c
lib/libc/sys/t_connect.c
lib/libc/sys/t_dup.c
lib/libc/sys/t_getcontext.c
lib/libc/sys/t_getgroups.c
lib/libc/sys/t_getitimer.c
lib/libc/sys/t_getrusage.c
lib/libc/sys/t_kevent.c
lib/libc/sys/t_link.c
lib/libc/sys/t_listen.c
lib/libc/sys/t_mincore.c
lib/libc/sys/t_mknod.c
lib/libc/sys/t_mlock.c
lib/libc/sys/t_mmap.c
lib/libc/sys/t_mprotect.c
lib/libc/sys/t_msgctl.c
lib/libc/sys/t_msgrcv.c
lib/libc/sys/t_msgsnd.c
lib/libc/sys/t_msync.c
lib/libc/sys/t_nanosleep.c
lib/libc/sys/t_pipe2.c
lib/libc/sys/t_poll.c
lib/libc/sys/t_revoke.c
lib/libc/sys/t_select.c
lib/libc/sys/t_setrlimit.c
lib/libc/sys/t_sigaction.c
lib/libc/sys/t_sigqueue.c
lib/libc/sys/t_socketpair.c
lib/libc/sys/t_stat.c
lib/libc/sys/t_timer_create.c
lib/libc/sys/t_truncate.c
lib/libc/sys/t_unlink.c
lib/libc/sys/t_write.c
lib/libc/time/t_strptime.c
lib/libc/tls/dso/h_tls_dlopen.c
lib/libc/tls/t_tls_dlopen.c
lib/libc/tls/t_tls_dynamic.c
lib/libc/tls/t_tls_static.c
lib/libc/tls/t_tls_static_helper.c
lib/libc/tls_dso/h_tls_dynamic.c
lib/libexecinfo/t_backtrace.c
lib/libm/t_cbrt.c
lib/libm/t_exp.c
lib/libm/t_ldexp.c
lib/libm/t_log.c
lib/libm/t_pow.c
lib/libm/t_precision.c
lib/libm/t_scalbn.c
lib/libpthread/h_atexit.c
lib/libpthread/h_cancel.c
lib/libpthread/t_condwait.c
lib/libpthread/t_detach.c
lib/libpthread/t_fork.c
lib/libpthread/t_join.c
lib/libpthread/t_mutex.c
lib/libpthread/t_once.c
lib/libpthread/t_sem.c
lib/librt/t_sem.c
usr.sbin/mtree/t_mtree.sh
/freebsd-10-stable/share/mk/bsd.progs.mk
/freebsd-10-stable/share/mk/netbsd-tests.test.mk
272458 02-Oct-2014 ngie

Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles

Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade

MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division


272345 01-Oct-2014 ngie

Tag ^/base/vendor/NetBSD/tests/09.30.2014_20.45 from
^/base/vendor/NetBSD/tests/dist

Sponsored by: EMC / Isilon Storage Division


272343 01-Oct-2014 ngie

Check in first src/tests snapshot from NetBSD anoncvs

Sources were obtained like so:

% export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"
% cvs -z9 co -D "09/30/2014 20:45" -P src/tests
% mv src/tests/* tests/dist/.

'*CVS*' has been added to svn:ignore to ease updating periodically from
upstream

Some line ending issues had to be resolved with test outputs and scripts
via dos2unix and by deleting the eol-style property set in usr.bin/sort

Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division