summaryrefslogtreecommitdiff
path: root/tests/lib/libc
AgeCommit message (Collapse)Author
2022-04-05In the mmap_err test case, mmap the address, not the address of the address.gson
Should fix PR kern/56780.
2022-04-05When the t_mmap:mmap_err test fails due to errno not having the expectedgson
value of EINVAL, print the actual value.
2022-04-04fix various typos, mainly in comments.andvar
2022-03-26Add sparc* to the list of architectures that need an explicit addressmartin
with PT_CONTINUE in this test.
2022-03-18getrandom(2): Fix return value checks in automatic tests.riastradh
The syscall only guarantees up to 256 bytes in a single go -- if interrupted, it might return short, but if the caller requested at least 256 bytes it will definitely return 256 bytes.
2022-02-20Validate basic fcntl(2) behavior for eventfd and timerfd.thorpej
2022-01-16tests/libc/inet: remove stray semicolonsrillig
No binary change.
2021-12-15When running the tests under "qemu -accel kvm" on a Linux host,gson
isQEMU_TCG() should return false. Fixes multiple test cases that were failing with "Test case was expecting a failure but none were raised" on that platform.
2021-12-10s/occured/occurred/ in comments, log messages and man pages.andvar
2021-11-22undef a couple more.christos
2021-11-20Merge common code for the chdir cases (Piyush Sachdeva)christos
I also deduplicated some more code
2021-11-15Add missing testchristos
2021-11-07Fix linking for multi-source file tests, the second part of the tuplemartin
needs to be the C source file (not the base name)
2021-11-07new tests for posix_spawn_chdir from Piyush Sachdevachristos
2021-11-01Test lib/libc/sys/t_timerfd often fails when run on QEMU becausehannken
QEMU misses clock interrupts. Always check values against [ lower, upper ] bounds and use "4 * upper" when run under QEMU. Now becomes part of PR kern/43997 "Kernel timer discrepancies".
2021-10-31Skip the test when there is insufficient disk space. Fixes PR misc/56324.gson
2021-10-21Skip the lib/libc/sys/t_ptrace_waitid:syscall_signal_on_sce test casegson
with a reference to PR lib/55087. Marking it as an expected failure would be more appropriate, but that doesn't work for test cases that fail by timing out.
2021-10-14Remove trailing whitespacegson
2021-10-02- Strenghen the poll(2) fifo_inout test to ensure that once the readerthorpej
has read enough that exactly PIPE_BUF space is available that the FIFO becomes writable again. - When creating a FIFO, ensure that the receive low water mark is 1 (a FIFO must be readable when at least 1 byte is available); this was already the case implicitly, but this makes it explicit. - Similarly, set the send low water mark to PIPE_BUF to ensure that the pipe is writable when at least PIPE_BUF bytes of space are available in the send buffer. Without this change, the strengthened test case above does not pass (the default send low water mark is larger than PIPE_BUF; see soreserve()). - Make the same low water mark changes to the PIPE_SOCKETPAIR case.
2021-10-02Add a fifo_inout test case that validates the expected POLLIN / POLLOUTthorpej
behavior for FIFOs: - A FIFO is readable so long as at least 1 byte is available. - A FIFO is writable so long as at least PIPE_BUF (obtained with _PC_PIPE_BUF) space is avaiable. This will be cloned for a forthcoming kevent test case.
2021-10-02In the fifo_hup1 test, also ensure that POLLHUP is de-asserted when athorpej
new writer appears.
2021-10-02- fifo_poll(): If the last writer has disappeared, detect this and returnthorpej
POLLHUP, per POSIX. - fifo_close(): Use the new fifo_socantrcvmore(), which is like the garden-variety socantrcvmore(), except it specifies POLL_HUP rather than POLL_IN (so the correct code for SIGIO is sent). - sowakeup(): Allow POLL_HUP as a code (notifies poll'ers with POLLHUP). - Add test cases for correct POLLHUP behavior with FIFOs. Fixes PR kern/56429.
2021-09-19Add native implementations of eventfd(2) and timerfd(2), compatible withthorpej
the Linux interfaces of the same name.
2021-09-11tests/stdio: normalize whitespacerillig
2021-09-09tests/stdio: disable flappy test for EINTR with _IOFBF for nowrillig
This case is currently not handled correctly by fwrite/fflush, which makes the test fail sometimes. The tests for _IONBF and _IOLBF are pretty stable though.
2021-09-05tests/stdio: use standard ATF tools for verifying the test outputrillig
In case of a test failure, this outputs a diff between the actual and expected files. Even with the smaller buffer size LMAX, the fully buffered test fails. It does so after printing numbers up to 12773, which together take 65532 bytes. The next number, 12774, would cross the 65536 boundary, but instead of that number, 12710730 was written.
2021-09-05tests/stdio: wrap test command with atf_checkrillig
Previously, the test output was: FAILED: Test case body returned a non-ok exit code, but this is not allowed In many cases, the test now succeeds, but in some cases it fails: h_testnumbers: bad line "1287185 ", expected 12774 h_testnumbers: bad line "6186889 ", expected 6154889
2021-09-05tests/stdio: on test failure, print more detailsrillig
On amd64, the test stdio_intr_iofbf fails: stdout: numbers.in...iw.ir.ir. OK stderr: h_testnumbers: bad line 3914889 This information is not enough to get a complete picture of the situation, so provide more details.
2021-09-03s/existant/existent/ in comments and messages, plus few more similar fixes.andvar
2021-08-22s/priviledge/privilege/ in comments/log messages and fix one typo in descriptor.andvar
2021-08-21fix mainly same typos as in my previous commit but outside sys/dev/dm.andvar
2021-08-02s/diferent/different/andvar
2021-07-24For sh3, increment PC when PT_CONTINUE from trigger_trap(), as alreadyrin
done for aarch64, arm, and powerpc. Otherwise, child is trapped to the PTRACE_BREAKPOINT_ASM (== trapa) instruction indefinitely. Fix tests/lib/libc/sys/t_ptrace_wait*:core_dump_procinfo.
2021-07-17PR 56313: fix eroneous = that was meant to be ==martin
2021-07-10Use intmax_t to printf an off_tmartin
2021-07-10add more info to ease future debugging.christos
2021-07-10space before starchristos
2021-07-09Make opts.cmd const char * rather than char * -- nothing ever modifieskre
the string it points to, it is never passed to a function not taking a const char * arg, and this allows "" (or other literal strings if ever needed) to be assigned to it - which should fix the build.
2021-07-09fixes from RVPchristos
2021-07-08fix printf format stringschristos
2021-07-08need to set BINDIRchristos
2021-07-08Add interrupted I/O tests (from RVP)christos
2021-06-09remove the kill in the trace code.christos
2021-06-09remove not required include fileschristos
2021-06-091. Preallocate the patterns so that out of memory conditions don't happenchristos
during their allocation, which the test cannot handle properly. 2. Enable building the test without atf so that we can easily debug with atf memory allocations interfering 3. Add memory tracing (disabled)
2021-06-07Add more information for the malloc failure.christos
2021-05-24On mips, avoid deliberately executing an illegal instruction for nowgson
because it causes GXemul to exit rather than generating a trap. A bug report has been sent to the GXemul author.
2021-05-02Add test for POSIX_SPAWN_RESETIDS flagmartin
2021-03-28yield so we can lose packetschristos
2021-03-21use a pipe instead of sched_yield()christos