summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
* MFC r311925,r311968,r311969,r312102,r312108:ngie2017-02-045-53/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 . 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
* MFC r311236,r311919:ngie2017-01-141-0/+7
| | | | | | | | | | | | | | | | | | 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.
* MFC r311268:ngie2017-01-131-0/+6
| | | | | | | | | | | | | | 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
* MFC r311240:ngie2017-01-071-0/+3
| | | | | | | | kqueue_desc_passing: initialize m.msg_flags to 0 This mutes an uninitialized scalar warning from Coverity CID: 979620
* MFC r311273:ngie2017-01-071-0/+3
| | | | | | setrlimit_basic: don't leak buf; free it on completion CID: 978311
* MFC r311250:ngie2017-01-071-0/+3
| | | | | | mincore_resid: free buf after use CID: 978304
* MFC r311271:ngie2017-01-071-0/+3
| | | | | | stat_symlink: don't leak fd; close the file descriptor when done CID: 978314
* MFC r311272:ngie2017-01-071-0/+3
| | | | | | | | | 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
* MFC r311270:ngie2017-01-071-0/+3
| | | | | | pipe_restart: free f on function exit to quell complaint from Coverity CID: 978307
* MFC r311242:ngie2017-01-071-0/+3
| | | | | | listen_low_port: check for errors from socket(2) before continuing CID: 976778
* MFC r311239:ngie2017-01-071-0/+3
| | | | | | umask_open: don't leak fd on success CID: 978315
* MFC r309837:ngie2016-12-241-2/+13
| | | | | | | | | | | | | | | | | | | | | | 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"
* MFC r305358:ngie2016-12-0312-31/+812
| | | | | | | | | | | | | | | | | | | | | 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
* Remove legacy brk and sbrk from RISC-V.br2016-05-251-2/+3
| | | | | | Discussed with: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* Remove brk and sbrk from arm64. They were defined in The Single UNIXandrew2016-05-201-0/+4
| | | | | | | | | | | | | | | | | | | | | Specification, Version 2, but marked as legacy, and have been removed from later specifications. After 12 years it is time to remove them from new architectures when the main use for sbrk is an invalid method to attempt to find how much memory has been allocated from malloc. There are a few places in the tree that still call sbrk, however they are not used on arm64. They will need to be fixed to cross build from arm64, but these will be fixed in a follow up commit. Old copies of binutils from ports called into sbrk, however this has been fixed around 6 weeks ago. It is advised to update binutils on arm64 before installing a world that includes this change. Reviewed by: brooks, emaste Obtained from: brooks Relnotes: yes Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6464
* Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.cngie2016-04-201-0/+8
| | | | | | | | | | - Ensure socket(2) calls succeed - Don't leak slist allocated by earlier socket(2) call MFC after: 2 weeks CID: 976773, 1251405 Reported by: Coverity Sponsored by: EMC / Isilon Storage Division
* Disable the NetBSD-specific EFAULT requirements test in gettimeofday_errngie2016-04-071-0/+2
| | | | | | | | | | 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. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Add debug output via ATF_REQUIRE_MSG when the first call tongie2016-01-271-1/+2
| | | | | | | | | | mlock(2) fails This helps identify the problem with running this test on my VM hosts (ENOMEM) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
* Adjust vm.max_wired in order to avoid hitting EAGAIN artificiallyngie2016-01-271-0/+137
| | | | | | | | | | | | | | | | | | | | | | | 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). Differential Revision: https://reviews.freebsd.org/D4779 MFC after: 1 month Sponsored by: EMC / Isilon Storage Division
* Pass 8 arguments to makecontext on arm64 as this is all we support.andrew2015-10-011-0/+6
| | | | | Obtained from: EuroBSDCon Devsummit Sponsored by: ABT Systems Ltd
* Expect access_test:access_inval to fail before __FreeBSD_version == 1100033ngie2014-12-301-0/+5
| | | | | 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
* Only pass 6 arguments to the 'run' function on amd64. amd64'sjhb2014-11-251-14/+10
| | | | | | | makecontext on FreeBSD only supports a maximum of 6 arguments. This fixes the setcontext_link test on amd64. PR: 194828
* Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) withngie2014-11-1717-31/+31
| | | | | | | | | 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
* Expect lib.libc.sys.getcontext_test.setcontext_link to fail on amd64; addngie2014-11-051-0/+14
| | | | | | | | | | | | | | | | | | | 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
* Remove expected failure from lib.libc.sys.t_mincore:mincore_residngie2014-11-051-3/+0
| | | | | | | | | | | | | | 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
* Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after ↵ngie2014-11-041-3/+2
| | | | | | | | atf-c/config.h was removed from the build Pointyhat to: me (again, for not running make delete-old after running test builds)
* Port t_mincore to FreeBSDngie2014-11-011-0/+21
| | | | | | | | 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
* Port t_kevent to FreeBSDngie2014-11-011-0/+26
| | | | Submitted by: pho
* getitimer on FreeBSD returns the last set time instead of the remaining time;ngie2014-11-011-0/+5
| | | | | | test for that instead Submitted by: pho
* Port lib/libc/sys/t_dup to FreeBSD/Linuxngie2014-11-011-0/+20
| | | | | | | | | - 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
* - Add sys/types.h for the APIs in sys/sysctl.hngie2014-10-241-0/+42
| | | | | | | | | | - 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
* Correct my previous commit:ngie2014-10-241-4/+9
| | | | | | | | | | | - 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
* - Mark signo __unused in the signal handler functionngie2014-10-241-0/+8
| | | | | | | - Effectively #if 0 out some code that does not fail on FreeBSD In collaboration with: pho Sponsored by: EMC / Isilon Storage Division
* - Add inttypes.h and stdint.h in lieu of int_limits.h from NetBSDngie2014-10-241-0/+8
| | | | | | - Use #include "h_macros.h" instead of relative path analog Sponsored by: EMC / Isilon Storage Division
* - Test for EINVAL requirement when passing an invalid flag in to msync(2)ngie2014-10-241-0/+11
| | | | | | | | - Expect ENOMEM instead of EFAULT when msync'ing a previously munmap'ed region on FreeBSD Submitted by: pho Sponsored by: EMC / Isilon Storage Division
* - Ignore EINVAL check with mknod(path, S_IFCHR, -1) as the testcase is alwaysngie2014-10-241-0/+10
| | | | | | | | 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
* Omit the mprotect_exec testcase on FreeBSDngie2014-10-231-0/+6
| | | | Sponsored by: EMC / Isilon Storage Division
* Mark signum __unusedngie2014-10-231-0/+8
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix a typo (__FreeBSD__ -> __NetBSD__ when omitting setrlimit_nthr)ngie2014-10-231-1/+1
|
* Add limits.h #include for SSIZE_MAXngie2014-10-231-0/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* Add limits.h #include for SSIZE_MAXngie2014-10-231-0/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* - Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al)ngie2014-10-231-0/+10
| | | | | | | | - 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
* - Mark sig/signo __unusedngie2014-10-231-0/+12
| | | | | | - Do not provide a relative path via #include "h_macros.h" Sponsored by: EMC / Isilon Storage Division
* Use <atf_srcdir>/truncate_test.root_owned instead of /usr/bin/fpr as fpr doesngie2014-10-231-0/+13
| | | | | | | | | 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
* Add limits.h #include for INT_MAXngie2014-10-231-0/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* Mark signo __unused in handler(..)ngie2014-10-231-0/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* Omit all of the testcases as revoke(2) is only implemented on devfs(5)ngie2014-10-231-0/+9
| | | | | Submitted by: pho Sponsored by: EMC / Isilon Storage Division
* Omit the pollts testcases on FreeBSDngie2014-10-231-0/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* Port t_mmap.c to FreeBSDngie2014-10-231-0/+19
| | | | | | | | | - 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
* Add sys/socket.h #include for struct sockaddr_inngie2014-10-231-0/+4
| | | | Sponsored by: EMC / Isilon Storage Division
OpenPOWER on IntegriCloud