summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
Commit message (Collapse)AuthorAgeFilesLines
* MFC r311925,r311968,r311969,r312102,r312108:ngie2017-02-0431-215/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r312122:ngie2017-01-1711-4519/+0
| | | | | | Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind This should have been pruned in r305358
* 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 r311924:ngie2017-01-142-2/+2
| | | | Fix whitespace in comment
* MFC r311926:ngie2017-01-141-2/+0
| | | | Consolidate __NetBSD__ #ifdef
* MFC r311227,r311917:ngie2017-01-141-0/+31
| | | | | | | | | | | | | | | | | | | | | | 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
* 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 r311265,r311274:ngie2017-01-132-0/+30
| | | | | | | | | | | | | | | | | | 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
* MFC r311870:ngie2017-01-131-3/+3
| | | | Merge the grammar fix for lib/libc/gen/raise_test:raise_stress
* MFC r311871:ngie2017-01-131-5/+3
| | | | | | Merge ^/vendor/NetBSD/tests/dist@r311868 This is the vendor accepted version of ^/head@r311245
* MFC r311245:ngie2017-01-071-0/+3
| | | | | | tty: don't leak s after opening it with openpty CID: 978321
* MFC r311247:ngie2017-01-071-0/+3
| | | | | | mkfifoat_fd: close dfd after use to avoid leaking it CID: 978286
* MFC r311248:ngie2017-01-071-0/+3
| | | | | | mknodat_fd: close dfd after use to avoid leaking it CID: 978287
* MFC r311235:ngie2017-01-071-0/+3
| | | | | | ttyname_err: close fd if it was opened successfully CID: 978292
* 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 r311233,r311377:ngie2017-01-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* MFC r311228:ngie2017-01-071-0/+3
| | | | | | ftok_link: don't leak fd CID: 978291
* MFC r311250:ngie2017-01-071-0/+3
| | | | | | mincore_resid: free buf after use CID: 978304
* MFC r311229:ngie2017-01-071-0/+3
| | | | | | humanize_number_basic: don't leak buf CID: 1251407
* MFC r311271:ngie2017-01-071-0/+3
| | | | | | stat_symlink: don't leak fd; close the file descriptor when done CID: 978314
* MFC r311269:ngie2017-01-071-0/+12
| | | | | | | | 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
* MFC r311249:ngie2017-01-072-1/+22
| | | | | | {strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use CID: 978299, 978300
* 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 r311246:ngie2017-01-071-0/+3
| | | | | | fexecve: don't leak fd on fexecve(2) failure; close before calling err CID: 978285
* 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 r309774,r309778,r309779,r309780:ngie2016-12-175-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MFC ↵ngie2016-12-0711-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701,r307702: 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). 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). 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 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 r307702: Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite as tests/sys/fs These testcases exercise tmpfs support
* MFC r309474:ngie2016-12-031-0/+12
| | | | | | | | | 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
* MFC r309472:ngie2016-12-031-2/+2
| | | | | | | | | | | | | | | Restore pathing for factor(1), which unnecessarily diverged in r278616 factor lives in /usr/games/, not /usr/bin, in NetBSD. The correct way to handle this is do on-the-fly manipulation of the test script via ATF_TESTS_SH_SED_<foo>, not by modify the pathing directly in the test script. This is being done to resolve an unnecessary conflict made when pulling back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10. No functional change
* MFC r305451:ngie2016-12-031-0/+25
| | | | | | | | 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.
* MFC r304797,r305467,r305468,r305483:ngie2016-12-039-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304797 (by jmmv): Make use of Kyua's work directories. Change the vnode tests to use the current directory when creating temporary files, which we can assume is a volatile work directory, and then make the kqueue_test.sh driver _not_ abandon the directory created by Kyua. This makes the various kqueue tests independent of each other, and ensures the temporary file is cleaned up on failure. Problem spotted by asomers@ when reviewing D4254. r305467: Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/... This is being done to clearly distinguish the libkqueue tests from the (soon to be imported) NetBSD tests. 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. 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
* MFC r305358:ngie2016-12-03209-13327/+33234
| | | | | | | | | | | | | | | | | | | | | 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
* MFC r306782-r306783bapt2016-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r306782: localedef: Fix ctype dump (fixed wide spread errors) This commit is from John Marino in dragonfly with the following commit log: ==== This was a CTYPE encoding error involving consecutive points of the same ctype. It was reported by myself to Illumos over a year ago but I was unsure if it was only happening on BSD. Given the cause, the bug is also present on Illumos. Basically, if consecutive points were of the exact same ctype, they would be defined as a range regardless. For example, all of these would be considered equivalent: <A> ... <C>, <H> (converts to <A> .. <H>) <A>, <B>, <H> (converts to <A> .. <H>) <A>, <J> ... <H> (converts to <A> .. <H>) So all the points that shouldn't have been defined got "bridged" by the extreme points. The effects were recently reported to FreeBSD on PR 213013. There are countless places were the ctype flags are misdefined, so this is a major fix that has to be MFC'd. ==== This reveals a bad change I did on the testsuite: while 0x07FF is a valid unicode it is not used yet (reserved for future use) PR: 213013 Submitted by: marino@ Reported by: Kurtis Rader <krader@skepticism.us> Obtained from: Dragonfly MFC after: 1 month r306783: localedef: Improve cc_list parsing original commit log: ===== I had originally suspected the parsing of ctype definition files as being the source of the ctype flag mis-definitions, but it wasn't. In the process, I simplified the cc_list parsing so I'm committing the no-impact improvement separately. It removes some parsing redundancies and won't parse partial range definitions anymore. ==== Submitted by: marino Obtained from: Dragonfly MFC after: 1 month
* Fix up r274061ngie2016-06-091-6/+26
| | | | | | | | | 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. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Update `goodResult` after recent changes made to the PRNG in libcngie2016-06-091-1/+1
| | | | | | | | | The PRNG was changed in r300953/r300956, and subsequently, the numbers generated have changed. This is expected ABI breakage per ache X-MFC with: r300953, r300956 Tested with: amd64, i386 Sponsored by: EMC / Isilon Storage Division
* Add debug output to aid in determining why `goodResult` != `result`ngie2016-06-091-0/+5
| | | | | | MFC after: 1 week PR: 210619 (for diagnosis) Sponsored by: EMC / Isilon Storage Division
* Remove legacy brk and sbrk from RISC-V.br2016-05-252-4/+6
| | | | | | Discussed with: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* Remove brk and sbrk from arm64. They were defined in The Single UNIXandrew2016-05-202-0/+8
| | | | | | | | | | | | | | | | | | | | | 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 up r298368ngie2016-04-261-1/+1
| | | | | | | | | | | | Remove the semicolon accidentally added after the new conditional that tests that /dev/zero is opened successfully. MFC after: 1 week X-MFC with: r298368 Pointhat to: ngie Reported by: Coverity CID: 1354980 Sponsored by: EMC / Isilon Storage Division
* Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.cngie2016-04-201-1/+3
| | | | | | | | | | | Ensure opening /dev/zero succeeds. Abort the test if it doesn't. Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero" MFC after: 2 weeks CID: 1251410 Reported by: Coverity Sponsored by: EMC / Isilon Storage Division"
* 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
* Fix and connect setjmp test.bdrewery2016-03-092-2/+2
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix grep_test:recurse with ZFS and TMPFS tmpdirsasomers2016-01-271-0/+8
| | | | | | | | | | | | | 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. Reviewed by: ngie MFC after: 32 days Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4925
* 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
OpenPOWER on IntegriCloud