summaryrefslogtreecommitdiff
path: root/tests/lib/libc/gen
AgeCommit message (Collapse)Author
2023-05-07RISC-V support that works on QEMU with a single hart.skrll
Thanks for Simon Burge for plic(4).
2022-05-31libc: Reintroduce getentropy.riastradh
This was introduced two years ago when the getrandom/getentropy API question was still open, and removed because the discussion was ongoing. Now getentropy is more widely adopted and soon to be in POSIX. So reintroduce the symbol into libc since we'll be keeping it anyway. Discussion of details of the semantics, as interpreted by NetBSD, is ongoing, but the symbol needs to get in before the netbsd-10 branch. The draft POSIX text is (https://www.opengroup.org/austin/docs/austin_1110.pdf): SYNOPSIS #include <unistd.h> int getentropy(void *buffer, size_t length); DESCRIPTION The getentropy() function shall write length bytes of data starting at the location pointed to by buffer. The output shall be unpredictable high quality random data, generated by a cryptographically secure pseudo-random number generator. The maximum permitted value for the length argument is given by the {GETENTROPY_MAX} symbolic constant defined in <limits.h>. RETURN VALUES Upon successful completion, getentropy() shall return 0; otherwise, -1 shall be retunred and errno set to indicate the error. ERRORS The getentropy() function shall fail if: [EINVAL] The value of length is greater than {GETENTROPY_MAX}. The getentropy() function may fail if: [ENOSYS] The system does not provide the necessary source of entropy. RATIONALE The getentropy() function is not a cancellation point. Minor changes from the previous introduction of getentropy into libc: - Return EINVAL, not EIO, on buflen > 256. - Define GETENTROPY_MAX in limits.h. The declaration of getentropy in unistd.h and definition of GETENTROPY_MAX in limits.h are currently conditional on _NETBSD_SOURCE. When the next revision of POSIX is finalized, we can expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this can be done as a pullup without breaking existing compiled programs.
2022-05-31s/disbale/disable/ and s/enbale/enable/ in comments. also one more typo fix.andvar
2022-05-23s/controll/control/ in comments.andvar
2022-05-07Skip sigfpe_int also for sh3; integer division by zero is not trapped.rin
2022-04-12s/sould/should/ and s/shoud/should/andvar
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-09-03s/existant/existent/ in comments and messages, plus few more similar fixes.andvar
2021-08-21fix mainly same typos as in my previous commit but outside sys/dev/dm.andvar
2021-05-02Add test for POSIX_SPAWN_RESETIDS flagmartin
2021-01-13skip sigbus_adraln on MIPSskrll
2021-01-11PR/55715: pmax testbed panics with "assertion "asid == ↵skrll
curcpu()->ci_pmap_asid_cur" failed" It's GXemul that has the bug! Unfortunately, there's no way (currently) to detect if we're running under GXemul emulation, so disable for all mips for now. Hopefully, GXemul will get fixed soon.
2021-01-10PR/55715: pmax testbed panics with "assertion "asid == ↵skrll
curcpu()->ci_pmap_asid_cur" failed" disable the sigbus_adraln test on qemu for now
2020-10-13For aarch64eb, no SIGBUS signal for unaligned accesses.rin
Convert to preprocessor directives.
2020-08-24Expect a failure to trap unaligned acesses only when running undergson
qemu's TCG CPU emulation, not when running under hardware virtualization such as qemu -accel nvmm.
2020-08-23Expect failure only when running under qemu's TCG CPU emulation, notgson
when running under hardware virtualization such as qemu -accel nvmm.
2020-08-23Provide separate functions to check for running under qemu in generalgson
and for running under qemu's built-in TCG CPU emulation (as opposed to hardware virtualization via NVMM or KVM).
2020-07-03Verify that PR lib/55041 is no longer an issue.jruoho
2020-06-20Skip sigbus_adraln for powerpc.rin
SIGBUS for unaligned accesses is not mandatory for powerpc; most processors (not all, e.g., 403) can deal with that.
2020-03-13t_glob.c: clean up test coderillig
In struct vfs_file, using an int as a boolean is an anachronism and has been replaced with a single-character file type, like in ls(1). Some other redundant test code has been removed as well since it was either unreachable or existed only for performance reasons.
2020-03-13t_glob.c: add test cases for hidden directory and filerillig
The existing test code was geared towards every little bit of performance. It even duplicated the file definitions in vfs_stat in order to avoid a few strcmp calls. This made the test code fragile. Therefore, vfs_stat has been rewritten completely to not duplicate any information from the vfs. In vfs_stat, the returned st_mode is now more realistic. It had been 0 before. The file mode is only logged when it makes sense. In the ENOENT case it is not logged anymore. The debug logging for opendir/closedir now logs the same pointer, so that the corresponding calls can be matched easily. Failed vfs_opendir calls are logged as well, to get a more complete picture of which callbacks are called.
2020-03-13t_glob.c: use distinct names for test structuresrillig
Before, the structures and functions defined by the test used the same prefix as the code to be tested. This made it difficult to draw a line between these parts.
2020-03-13t_glob.c: move expected globbing result directly into the test casesrillig
This makes the tests more self-contained. The example directory tree that is common to all the tests is still defined elsewhere, but in the same file. Setting up the example directory structure in each test would make the tests even more independent and read.
2020-02-22Update t_siginfo.c build ruleskamil
Add logic for MKSANITIZER/MKLIBCSANITIZER checks.
2020-02-22Disable the t_siginfo test under MKSANITIZER / MKLIBCSANITIZERkamil
Signal crash events are incompatible with sanitizers.
2020-02-21Mark division by 0 as expected in sigfpe_intkamil
Disable ubsan instrumentation on the operation.
2020-02-11aarch64 doesn't trap integer division by zero either.riastradh
2019-07-16PR misc/54382: whenever open(2) is called with O_CREAT, make sure tomartin
pass an open mode argument.
2019-04-26-frounding-math is gcc specific, help clang buildsmaya
2019-04-25Fix typo in 'exceptions'kamil
2019-04-24PR/54000: Andreag Gustafsson: Compile the rounding test withchristos
-fround-math since with gcc-7, the default mode ignores fenv settings (the same effect can be achieved with -O0 :-) https://gcc.gnu.org/wiki/FloatingPointMath
2019-03-11Explicitly test for PR lib/54053kre
A suitable test was actually there already - but the results were not verified. So just add a test that the result string is what is expected. (Previously for len==128 and bytes==10000 it would have returned "0E" now it returns 10000 as it should.)
2019-01-30Clean up terminology: modern arm CPUs do properly implement IEEE 754martin
floating point exceptions - but some (actually all currently know ones) do not implement sending traps when these exceptions are raised. Pointed out by Peter Maydell.
2019-01-26aarch64 does not trap on unaligned accesmartin
2019-01-23There are aarch64 Cortex cpus that do not trap on some floating pointmartin
exceptions - so apply the arm handling for aarch64 as well.
2018-12-16port-macppc/46319 is marked as resolved now.sevan
Test on 8.99.26 build of NetBSD/macppc
2018-06-19No semicolon after macro do ... while (0) wrapper.gson
2018-01-17Improve portability of headers and sort them.maya
From Ngie Cooper in PR bin/51833
2017-12-21Fix broken test: we can't assume that the current schedule priority rangechristos
will overlap with the requested scheduler range, so get the new scheduler range, and then try to find a different priority. If that fails (to find a different scheduling range), give up here.
2017-12-18Don't use SCHED_OTHER.christos
2017-12-13Revert rev 1.4: fmtcheck(3) neglect unused trailing arguments as before.rin
"%d" is a valid format string with default format string "%d %s", etc.
2017-12-07Correct a couple of broken test cases:kre
"%d" does not take the same args as "%d %s" "%%" does not take the same args as "%llx" How did these ever survive any kind of even basic sanity check?
2017-04-26- add range testschristos
- be more descriptive about errors
2017-03-05reenable sigfpe_flt on powerpc now that FPU exceptions work.chs