summaryrefslogtreecommitdiff
path: root/contrib/netbsd-tests
Commit message (Collapse)AuthorAgeFilesLines
* libc: regex: partial revert of r368358Kyle Evans2020-12-053-2/+6
| | | | | | | | | | | | | | Part of the libregex functionality leaked into the tests it shares with the standard regex(3). Introduce a P flag to set the REG_POSIX cflag to indicate that libc regex should effectively do nothing while libregex should specifically run it in non-extended mode. This unbreaks the libc/regex test run. Reported by: Jenkins Notes: svn path=/head/; revision=368371
* libregex: implement \b and \B (word boundary, not word boundary)Kyle Evans2020-12-051-1/+1
| | | | | | | | | | This is the last of the needed GNU expressions before we can unleash bsdgrep by default. \b is effectively an agnostic equivalent of \< and \>, while \B will match every space that isn't making a transition from nonchar -> char or char -> nonchar. Notes: svn path=/head/; revision=368358
* Significantly speed up libthr/mutex_test and make more reliableAlex Richardson2020-11-261-15/+100
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using a simple global++ as the data race, with this change we perform the increment by loading the global, delaying for a bit and then storing back the incremented value. If I move the increment outside of the mutex protected range, I can now see the data race with only 100 iterations on amd64 in almost all cases. Before this change such a racy test almost always passed with < 100,000 iterations and only reliably failed with the current limit of 10 million. I noticed this poorly written test because the mutex:mutex{2,3} and timedmutex:mutex{2,3} tests were always timing out on our CheriBSD Jenkins. Writing good concurrency tests is hard so I won't attempt to do so, but this change should make the test more likely to fail if pthread_mutex_lock is not implemented correctly while also significantly reducing the time it takes to run these four tests. It will also reduce the time it takes for QEMU RISC-V testsuite runs by almost 40 minutes (out of currently 7 hours). Reviewed By: brooks, ngie Differential Revision: https://reviews.freebsd.org/D26473 Notes: svn path=/head/; revision=368055
* [tests] Fix itimer test warning-errors on gcc-6.4Adrian Chadd2020-10-151-2/+2
| | | | | | | | | | | This fixes a "suggested parens" compile warning-into-error that shows up on gcc-6.4. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D26789 Notes: svn path=/head/; revision=366727
* tmpfs tests: check for built-in tmpfs moduleMitchell Horne2020-10-021-1/+1
| | | | | | | | | | | | | | | | As of r363471, tmpfs is included in all GENERIC kernel configs. This results in a warning being emitted for each call to kldload(8): module_register: cannot register tmpfs from tmpfs.ko; already loaded from kernel Check for the presence of the module via kldstat first to quiet this warning. Reviewed by: asomers, arichardson Differential Revision: https://reviews.freebsd.org/D26632 Notes: svn path=/head/; revision=366351
* fix setitimer test for returned it_valueEric van Gyzen2020-10-011-2/+4
| | | | | | | | | | | | An old it_value of {4,3} is valid. Allow it. Reviewed by: bdrewery MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26445 Notes: svn path=/head/; revision=366346
* zgrep: fix exit status with multiple filesEric van Gyzen2020-10-011-0/+19
| | | | | | | | | | | | | | zgrep should exit with success when given multiple files and the pattern is found in at least one file. Prior to this change, it would exit with success only if the pattern was found in _every_ file. Reviewed by: dab ngie MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26616 Notes: svn path=/head/; revision=366345
* Revert r249362, atime update in tmpfs is fixed in r365810Li-Wen Hsu2020-09-171-8/+0
| | | | | | | | PR: 249362 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365831
* Temporarily skip sys.fs.tmpfs.times_test.{empty,non_empty} in CILi-Wen Hsu2020-09-161-0/+8
| | | | | | | | PR: 249362 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365793
* librt: tests: fix minor issues with higher WARNSKyle Evans2020-09-101-2/+1
| | | | | | | | | | | | | | | | | got_sigalrm is a global with external linkage and must therefore have a previous extern declaration. There's no reason to maintain the status quo there, so just make it static. The result var is unused. This part of the test has not been upstreamed, presumably because it exists solely for sem_clockwait_np. We should perhaps consider moving it into its own test file outside of ^/contrib/netbsd-tests, but this can happen later. MFC after: 1 week Notes: svn path=/head/; revision=365602
* MFV r365599: import fix for a libexecinfo warning at higher WARNSKyle Evans2020-09-101-3/+3
| | | | | | | | | | | v1.17 of this file included a fix that I just submitted upstream to fix a warning about prevent_inline with external linkage not having been previously declared. MFC after: 1 week Notes: svn path=/head/; revision=365600
* regex(3): Interpret many escaped ordinary characters as EESCAPEKyle Evans2020-07-292-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for any character to be escaped, but "ORD_CHAR preceded by an unescaped <backslash> character [gives undefined results]". Historically, we've interpreted an escaped ordinary character as the ordinary character itself. This becomes problematic when some extensions give special meanings to an otherwise ordinary character (e.g. GNU's \b, \s, \w), meaning we may have two different valid interpretations of the same sequence. To make this easier to deal with and given that the standard calls this undefined, we should throw an error (EESCAPE) if we run into this scenario to ease transition into a state where some escaped ordinaries are blessed with a special meaning -- it will either error out or have extended behavior, rather than have two entirely different versions of undefined behavior that leave the consumer of regex(3) guessing as to what behavior will be used or leaving them with false impressions. This change bumps the symbol version of regcomp to FBSD_1.6 and provides the old escape semantics for legacy applications, just in case one has an older application that would immediately turn into a pumpkin because of an extraneous escape that's embedded or otherwise critical to its operation. This is the final piece needed before enhancing libregex with GNU extensions and flipping the switch on bsdgrep. [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ PR: 229925 (exp-run, courtesy of antoine) Differential Revision: https://reviews.freebsd.org/D10510 Notes: svn path=/head/; revision=363679
* Fix some regressions with the zgrep(1) wrapper.Craig Leres2020-07-201-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Handle whitespace with long flags that take arguments: echo 'foo bar' > test zgrep --regexp='foo bar' test - Do not hang reading from stdin with patterns in a file: echo foobar > test echo foo > pattern zgrep -f pattern test zgrep --file=pattern test - Handle any flags after -e: echo foobar > test zgrep -e foo --ignore-case < test These two are still outstanding problems: - Does not handle flags that take an argument if there is no whitespace: zgrep -enfs /etc/rpc - When more than one -e pattern used matching should occur for all patterns (similar to multiple patterns supplied with -f file). Instead only the last pattern is used for matching: zgrep -e rex -e nfs /etc/rpc (This problem is masked in the unpatched version by the "any flags after -e" problem.) Add tests for the above problems. Update the mange and add references to gzip(1) and zstd(1) and also document the remaining known problems. PR: 247126 Approved by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25613 Notes: svn path=/head/; revision=363381
* Temporarily skip flakey sys.kern.sysv_test.msg in CILi-Wen Hsu2020-06-261-0/+3
| | | | | | | PR: 233649 Notes: svn path=/head/; revision=362656
* Temporarily disable failing case in CI of amd64:Li-Wen Hsu2020-05-181-0/+5
| | | | | | | | | | - lib.libexecinfo.backtrace_test.backtrace_fmt_basic PR: 246537 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=361210
* MFV r357687: Import NFS fix for O_SEARCH testsKyle Evans2020-02-091-21/+12
| | | | | | | | | | The version that ended upstream was ultimately slightly different than the version committed here; notably, statvfs() is used but it's redefined appropriately to statfs() on FreeBSD since we don't provide the fstypename for the former interface. Notes: svn path=/head/; revision=357688
* O_SEARCH test: mark revokex an expected fail on NFSKyle Evans2020-02-071-0/+22
| | | | | | | | | | | | | | | | | | The revokex test does not work when the scratch directory is created on NFS. Given the nature of NFS, it likely can never work without looking like a security hole since O_SEARCH would rely on the server knowing that the directory did have +x at the time of open and that it's OK for it to have been revoked based on POSIX specification for O_SEARCH. This does mean that O_SEARCH is only partially functional on NFS in general, but I suspect the execute bit getting revoked in the process is likely not common. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23573 Notes: svn path=/head/; revision=357671
* MFV r357635: imnport v1.9 of the O_SEARCH testsKyle Evans2020-02-061-2/+2
| | | | | | | | | The RCSID data was wrong, so this is effectively a record-only merge with correction of said data. No further changes should be needed in this area, as we've now upstreamed our local changes to this specific test. Notes: svn path=/head/; revision=357636
* O_SEARCH test: drop O_SEARCH|O_RDWR local diffKyle Evans2020-02-051-4/+0
| | | | | | | | | | | | In FreeBSD's O_SEARCH implementation, O_SEARCH in conjunction with O_RDWR or O_WRONLY is explicitly rejected. In this case, O_RDWR was not necessary anyways as the file will get created with or without it. This was submitted upstream as misc/54940 and committed in rev 1.8 of the file. Notes: svn path=/head/; revision=357580
* O_SEARCH tests: plug trivial fd leakKyle Evans2020-02-051-0/+1
| | | | | | | | | | | | Coverity correctly reports this as a resource leak. It's an admittedly minor one, but plug it anyways. This has been submitted upstream as misc/54939. CID: 978288 Notes: svn path=/head/; revision=357556
* Provide O_SEARCHKyle Evans2020-02-021-2/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | O_SEARCH is defined by POSIX [0] to open a directory for searching, skipping permissions checks on the directory itself after the initial open(). This is close to the semantics we've historically applied for O_EXEC on a directory, which is UB according to POSIX. Conveniently, O_SEARCH on a file is also explicitly undefined behavior according to POSIX, so O_EXEC would be a fine choice. The spec goes on to state that O_SEARCH and O_EXEC need not be distinct values, but they're not defined to be the same value. This was pointed out as an incompatibility with other systems that had made its way into libarchive, which had assumed that O_EXEC was an alias for O_SEARCH. This defines compatibility O_SEARCH/FSEARCH (equivalent to O_EXEC and FEXEC respectively) and expands our UB for O_EXEC on a directory. O_EXEC on a directory is checked in vn_open_vnode already, so for completeness we add a NOEXECCHECK when O_SEARCH has been specified on the top-level fd and do not re-check that when descending in namei. [0] https://pubs.opengroup.org/onlinepubs/9699919799/ Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23247 Notes: svn path=/head/; revision=357412
* netbsd-tests: libc: use correct modes in O_SEARCH testsKyle Evans2020-01-281-10/+10
| | | | | | | | | | | | | | | | The current code clearly intended for these to be octal based on the values used, but the octal prefix was forgotten. Add it now for correctness, but note that we don't currently execute these tests. This has been submitted upstream as misc/54902, so I've omitted the standard FreeBSD markers that we tend to put into netbsd-tests for upstream-candidate identification. Reviewed by: ngie MFC after: 3 days Notes: svn path=/head/; revision=357195
* Re-apply fixed r354847Conrad Meyer2019-11-201-3/+0
| | | | | | | | | | | | | | | | | unifdef(1): Improve worst-case bound on symbol resolution Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N) and O(N^2). While here, remove arbitrarily limit on number of macros understood. Reverts r354877 and r354878, which disabled the (correct) test. PR: 242095 Reported by: lwhsu Notes: svn path=/head/; revision=354912
* Only skip failing test case in CI.Li-Wen Hsu2019-11-201-1/+3
| | | | | | | | PR: 242095 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354878
* Temporarily skip the failing test case usr.bin.unifdef.basic_test.basicLi-Wen Hsu2019-11-201-0/+1
| | | | | | | | PR: 242095 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354877
* Link in NetBSD's unifdef(1) testsConrad Meyer2019-11-181-0/+4
| | | | | | | Skip one, is it currently fails. Notes: svn path=/head/; revision=354801
* Revert r354238 as the issue has been fixed in r354418Li-Wen Hsu2019-11-071-5/+0
| | | | | | | | PR: 241562 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354428
* Temporarily skip lib.libexecinfo.backtrace_test.backtrace_fmt_basic on i386Li-Wen Hsu2019-11-011-0/+5
| | | | | | | | PR: 241562 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354238
* libexecinfo test: Don't strip installed testConrad Meyer2019-10-291-3/+0
| | | | | | | | | | | | | | | | It turns out that a test of backtrace symbol resolution and formatting requires symbols. Another option mightt be building with -rdynamic instead, but this works for now. Re-enabled skipped CI test, as it should now pass. PR: 241562 Submitted by: lwhsu Reported by: lwhsu X-MFC-With: r354126, r354135, r354144 Notes: svn path=/head/; revision=354151
* Temporarily disable failing case in CI:Li-Wen Hsu2019-10-291-0/+3
| | | | | | | | | | - lib.libexecinfo.backtrace_test.backtrace_fmt_basic PR: 241562 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354144
* Remove bogus requirement from libexecinfo testConrad Meyer2019-10-281-1/+0
| | | | | | | | | | | | The bogus requirement was causing CI infrastructure (which does not mount procfs) to skip the test. Procfs has not been needed by libexecinfo on FreeBSD (nor NetBSD) for years. Both now use a sysctl to obtain the path to the current process image. X-MFC-With: r354126 Notes: svn path=/head/; revision=354135
* Adjust tests after page fault changes in r352807Jilles Tjoelker2019-09-291-4/+0
| | | | | | | | | | Commit r352807 fixed various signal numbers and codes from page faults; adjust the tests so they expect the fixes to be present. PR: 211924 Notes: svn path=/head/; revision=352869
* bsdgrep(1): various fixes of empty pattern/exit code/-c behaviorKyle Evans2019-09-251-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When an empty pattern is encountered in the pattern list, I had previously broken bsdgrep to count that as a "match all" and ignore any other patterns in the list. This commit rectifies that mistake, among others: - The -v flag semantics were not quite right; lines matched should have been counted differently based on whether the -v flag was set or not. procline now definitively returns whether it's matched or not, and interpreting that result has been kicked up a level. - Empty patterns with the -x flag was broken similarly to empty patterns with the -w flag. The former is a whole-line match and should be more strict, only matching blank lines. No -x and no -w will will match the empty string at the beginning of each line. - The exit code with -L was broken, w.r.t. modern grep. Modern grap will exit(0) if any file that didn't match was output, so our interpretation was simply backwards. The new interpretation makes sense to me. Tests updated and added to try and catch some of this. This misbehavior was found by autoconf while fixing ports found in PR 229925 expecting either a more sane or a more GNU-like sed. MFC after: 1 week Notes: svn path=/head/; revision=352691
* Temporarily skip flakey test case lib.libc.sys.stat_test.stat_socketLi-Wen Hsu2019-09-171-0/+3
| | | | | | | | PR: 240621 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=352448
* mtree: Fix -f -f not considering type changes.Bryan Drewery2019-09-121-0/+36
| | | | | | | | | | | | | | This only lists the changed type and not other attributes so that it matches the behavior of -C as done in r66747 for fmtree. The NetBSD -ff implementation was copied from fmtree. Reviewed by: imp MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D21623 Notes: svn path=/head/; revision=352261
* Only skip problematic test in CI env.Li-Wen Hsu2019-09-111-1/+2
| | | | | | | | PR: 237450 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=352227
* libc: remove getsEd Maste2019-09-011-0/+18
| | | | | | | | | | | | | | | | | | | | gets is unsafe and shouldn't be used (for many years now). Leave it in the existing symbol version so anything that previously linked aginst it still runs, but do not allow new software to link against it. (The compatability/legacy implementation must not be static so that the symbol and in particular the compat sym gets@FBSD_1.0 make it into libc.) PR: 222796 (exp-run) Reported by: Paul Vixie Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier) Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12298 Notes: svn path=/head/; revision=351659
* Update pthread_cond_timedwait() test to current NetBSDEric van Gyzen2019-08-161-20/+18
| | | | | | | | | | | | | NetBSD adapted and committed our r350620. Update to their version 1.8. Reviewed by: ngie Obtained from: NetBSD MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21279 Notes: svn path=/head/; revision=351118
* Relax time constraint in pthread_cond_timedwait unit testEric van Gyzen2019-08-051-0/+11
| | | | | | | | | | | | | | | | pthread_cond_timedwait() should wait _at least_ until the timeout, but it might appear to wait longer due to system activity and scheduling. The test ignored fractional seconds when comparing the actual and expected timeouts, so it allowed anywhere between zero and one extra second of wait time. Zero is a bit unreasonable. Compare fractional seconds so we always allow up to one extra second. Reviewed by: ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=350620
* Temporarily skip lib.libc.regex.exhaust_test.regcomp_too_big andLi-Wen Hsu2019-07-221-0/+4
| | | | | | | | | | lib.libregex.exhaust_test.regcomp_too_big on i386 as they are flakey on it PR: 237450 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350219
* Add missing mode in open(2) calls with O_CREAT.Brooks Davis2019-07-166-14/+14
| | | | | | | | | | | | | | | | | When O_CREAT is specified, the third, variadic argument is required as the permission. If on is not passed, then depending on the ABI, either the contents of the third argument register or some arbitrary stuff on the stack will be used as the permission. This has been merged to NetBSD. Reviewed by: asomers, ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20972 Notes: svn path=/head/; revision=350067
* Provide separate accounting for user-wired pages.Mark Johnston2019-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we have not distinguished between kernel wirings and user wirings for accounting purposes. User wirings (via mlock(2)) were subject to a global limit on the number of wired pages, so if large swaths of physical memory were wired by the kernel, as happens with the ZFS ARC among other things, the limit could be exceeded, causing user wirings to fail. The change adds a new counter, v_user_wire_count, which counts the number of virtual pages wired by user processes via mlock(2) and mlockall(2). Only user-wired pages are subject to the system-wide limit which helps provide some safety against deadlocks. In particular, while sources of kernel wirings typically support some backpressure mechanism, there is no way to reclaim user-wired pages shorting of killing the wiring process. The limit is exported as vm.max_user_wired, renamed from vm.max_wired, and changed from u_int to u_long. The choice to count virtual user-wired pages rather than physical pages was done for simplicity. There are mechanisms that can cause user-wired mappings to be destroyed while maintaining a wiring of the backing physical page; these make it difficult to accurately track user wirings at the physical page layer. The change also closes some holes which allowed user wirings to succeed even when they would cause the system limit to be exceeded. For instance, mmap() may now fail with ENOMEM in a process that has called mlockall(MCL_FUTURE) if the new mapping would cause the user wiring limit to be exceeded. Note that bhyve -S is subject to the user wiring limit, which defaults to 1/3 of physical RAM. Users that wish to exceed the limit must tune vm.max_user_wired. Reviewed by: kib, ngie (mlock() test changes) Tested by: pho (earlier version) MFC after: 45 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19908 Notes: svn path=/head/; revision=347532
* MFV r345515: netbsd-tests: import memory bump for libc/regex/t_exhaustKyle Evans2019-03-261-5/+6
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=345516
* Have pthread_cond_destroy() return EBUSY if the condvar has waiters.Mark Johnston2019-03-081-0/+92
| | | | | | | | | | | | | | | | This is not required of a compliant implementation, but it's easy to check for and helps improve compatibility with other common implementations. Moreover, it's consistent with our pthread_mutex_destroy(). PR: 234805 Reviewed by: jhb, kib, ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19496 Notes: svn path=/head/; revision=344935
* Amend r343442, by only expecting the lib.msun.cbrt_test.cbrtl_powl andDimitry Andric2019-02-081-1/+2
| | | | | | | | | | | | | trig_test.reduction test cases to fail, if the fixes from r343916 have not yet been applied to the base compiler. Reported by: lwhsu PR: 234040 Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=40206 MFC after: 1 week Notes: svn path=/head/; revision=343917
* Temporarily mark lib.msun.{cbrt_test.cbrtl_powl,trig_test.reduction}Li-Wen Hsu2019-01-251-0/+4
| | | | | | | | | | | | | expected failure after clang700-import merge PR: 234040 Reviewed by: ngie, markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18938 Notes: svn path=/head/; revision=343442
* Implement shmat(2) flag SHM_REMAP.Konstantin Belousov2019-01-161-5/+55
| | | | | | | | | | | | Based on the description in Linux man page. Reviewed by: markj, ngie (previous version) Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18837 Notes: svn path=/head/; revision=343082
* Trim spaces at the end of lines.Konstantin Belousov2019-01-161-3/+3
| | | | | | | | | | Reviewed by: markj, ngie Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18837 Notes: svn path=/head/; revision=343081
* Make mbstowcs_basic test pass, now that we have more ctype definitions.Yuri Pankov2018-11-171-1/+1
| | | | | | | | Reported by: jenkins Approved by: kib (mentor, implicit) Notes: svn path=/head/; revision=340492
* Reset persistent mbstates when rune locale encoding changes.Yuri Pankov2018-11-091-3/+0
| | | | | | | | | | | | | | | | | | | This was shown to be a problem by side effect of now-enabled test case, which was going through C, en_US.UTF-8, ja_JP.SJIS, and ja_JP.eucJP, and failing eventually as data in mbrtowc's mbstate, that was perfectly correct for en_US.UTF-8 was treated as incorrect for ja_JP.SJIS, failing the entire test case. This makes the persistent mbstates to be per ctype-component, and not per-locale so we could easily reset the mbstates when only LC_CTYPE is changed. Reviewed by: bapt, pfg Approved by: kib (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17796 Notes: svn path=/head/; revision=340276