aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/file
Commit message (Collapse)AuthorAgeFilesLines
* close_range/closefrom: fix regression from close_range introductionKyle Evans2020-04-131-1/+17
| | | | | | | | | | | | | | | | close_range will clamp the range between [0, fdp->fd_lastfile], but failed to take into account that fdp->fd_lastfile can become -1 if all fds are closed. =-( In this scenario, just return because there's nothing further we can do at the moment. Add a test case for this, fork() and simply closefrom(0) twice in the child; on the second invocation, fdp->fd_lastfile == -1 and will trigger a panic before this change. X-MFC-With: r359836 Notes: svn path=/head/; revision=359891
* Implement a close_range(2) syscallKyle Evans2020-04-121-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | close_range(min, max, flags) allows for a range of descriptors to be closed. The Python folk have indicated that they would much prefer this interface to closefrom(2), as the case may be that they/someone have special fds dup'd to higher in the range and they can't necessarily closefrom(min) because they don't want to hit the upper range, but relocating them to lower isn't necessarily feasible. sys_closefrom has been rewritten to use kern_close_range() using ~0U to indicate closing to the end of the range. This was chosen rather than requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the call to kern_close_range for simplicity. The flags argument of close_range(2) is currently unused, so any flags set is currently EINVAL. It was added to the interface in Linux so that future flags could be added for, e.g., "halt on first error" and things of this nature. This patch is based on a syscall of the same design that is expected to be merged into Linux. Reviewed by: kib, markj, vangyzen (all slightly earlier revisions) Differential Revision: https://reviews.freebsd.org/D21627 Notes: svn path=/head/; revision=359836
* Revert r337929Alan Somers2018-08-162-3/+0
| | | | | | | | | | FreeBSD's mkstemp sets the temporary file's permissions to 600, and has ever since mkstemp was added in 1987. Coverity's warning is still relevant for portable programs since OpenGroup does not require that behavior, and POSIX didn't until 2008. But none of these programs are portable. Notes: svn path=/head/; revision=337930
* Fix Coverity warnings about mkstemp in testsAlan Somers2018-08-162-0/+3
| | | | | | | | | | | | | umask(2) should always be used prior to mkstemp(3) so the temporary file won't be created with insecure permissions. Reported by: Coverity CID: 1331605 1347173 1375366 1339800 1331604 1296056 1296060 CID: 1296057 1296062 MFC after: 2 weeks Notes: svn path=/head/; revision=337929
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Make test scripts under tests/... non-executableEnji Cooper2017-08-081-0/+0
| | | | | | | | | | Executable bits should be set at install time instead of in the repo. Setting executable bits on files triggers false positives with Phabricator. MFC after: 2 months Notes: svn path=/head/; revision=322214
* Allow changing the test PORT at compile-time.Bryan Drewery2017-07-311-0/+2
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=321824
* Tweak r319058 slightlyEnji Cooper2017-05-281-2/+2
| | | | | | | | | | | | | - Specify an explicit mode when using O_CREAT per open(2). - Fix the error message (add missing enclosing parentheses). Submitted by: jilles MFC after: 3 days MFC with: r319058 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319078
* Don't leak accept_fd on thread completionEnji Cooper2017-05-281-0/+1
| | | | | | | | | | MFC after: 3 days Reported by: Coverity CID: 1296068 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319061
* Use main(void) instead of main(argc __unused, argv __unused)Enji Cooper2017-05-281-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319060
* Use an exit code of 1 instead of -1 for reasons noted in r319056Enji Cooper2017-05-281-10/+10
| | | | | | | | MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319059
* Create a deterministic file in the kyua sandbox, instead of aEnji Cooper2017-05-281-5/+4
| | | | | | | | | | | | | temporary file outside the kyua sandbox This helps ensure that the file is removed at test exit, and as a side effect, cures a warning about umasks with Coverity. MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319058
* tests/sys/file/ftruncate_test: use an exit code of 1 insteadEnji Cooper2017-05-281-16/+16
| | | | | | | | | | | | | of -1 with err*(3). An exit code of -1 is implementation defined -- it's best to stick with something well-defined (1). MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=319056
* Remove unused vars to fix -Wunused issuesEnji Cooper2017-01-141-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312111
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* Minor cosmetic cleanupEnji Cooper2016-04-181-2/+2
| | | | | | | | | | | | - Remove spurious trailing whitespace in licensing header - Remove unnecessary semi-colon after comment [*] MFC after: 3 days Submitted by: pfg [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298196
* MFHGlen Barber2016-04-161-1/+1
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=298092
| * Set test_argv to NULL, not 0, if not executing a specific testEnji Cooper2016-04-151-1/+1
| | | | | | | | | | | | | | | | | | MFC after: 1 week Submitted by: pfg Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298024
* | MFHGlen Barber2016-03-101-0/+20
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+20
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | More 'tests' package fixes.Glen Barber2016-02-031-0/+3
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295179
* Dump out the output from flock_helper on failure so failures with theEnji Cooper2015-12-221-2/+3
| | | | | | | | | | | test app can be debugged MFC after: 1 week Obtained from: Isilon OneFS (^/onefs/head@r511419) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=292582
* Fix LDADD/DPADD that should be LIBADD.Bryan Drewery2015-12-041-6/+3
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291738
* The bug caught by flock's test 16 was fixed by r268384.Mark Johnston2015-07-051-5/+0
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=285184
* Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifoEnji Cooper2015-04-278-0/+2749
and tools/regression/file into the FreeBSD test suite as tests/sys/file MFC after: 1 week Notes: svn path=/head/; revision=282067