summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-11-17Regression test for scudo crash in resizeTaggedChunk.Evgenii Stepanov
This is a copy of the upstream scudo test for CTS: https://reviews.llvm.org/rG913d78c40c37c9c3428285d868ce454b058e40f3 Bug: 206701345 Test: CtsBionicTestCases Merged-In: I76b6b33c0665d7ad3bdd8c07d39a39d0d24d94df Change-Id: I76b6b33c0665d7ad3bdd8c07d39a39d0d24d94df (cherry picked from commit f0d7a34e257494c7a0248e399849bb714bb9fcc4)
2021-07-13Make MTE tests pass with all values of MEMTAG_OPTIONS.Evgenii Stepanov
Do not assume that tests start with Sync MTE; check the initial setting and change test logic as appropriate. Bug: 192480262 Test: bionic-unit-tests with MEMTAG_OPTIONS=(off|sync|async) Merged-In: Id80301e6426af16f89bd80a7a7ab127b6fd60425 Change-Id: Id80301e6426af16f89bd80a7a7ab127b6fd60425 (cherry picked from commit 53df1f3772ad4843461e78540111b21e9061c051)
2021-06-09Merge "Disable return PAC in __pthread_start." into sc-devTreeHugger Robot
2021-06-08Disable return PAC in __pthread_start.Peter Collingbourne
This function doesn't return, but it does appear in stack traces. Avoid using return PAC in this function because we may end up resetting IA, which may confuse unwinders due to mismatching keys. Bug: 189808795 Change-Id: I953da9078acd1d43eb7a47fb11f75caa0099fa12 Merged-In: I953da9078acd1d43eb7a47fb11f75caa0099fa12
2021-06-08Merge "Use ro.build.type instead of ro.debuggable" into sc-devTreeHugger Robot
2021-06-08Use ro.build.type instead of ro.debuggableRyan Prichard
The LD_CONFIG_FILE test needs to match how Bionic was compiled, and Bionic only enables LD_CONFIG_FILE for debug builds (i.e. ro.build.type is "user"). ro.debuggable can be forced on without recompiling Bionic. Bug: http://b/140324381 Bug: http://b/189422994 Test: bionic unit tests Change-Id: I139059a7f94d15a5447dab292927606a6bcc48ef (cherry picked from commit 546723b2b804d8e12c2774c7338073184cf90075)
2021-04-12Make the tests that call readelf(1) less sensitive to whitespace.Elliott Hughes
Bug: http://b/185168726 Test: treehugger Change-Id: I13dbbf57c7366966d51b8ea771ec9edd52505e72
2021-04-12Merge "Switch to libbase SilentDeathTest."Elliott Hughes
2021-04-12Switch to libbase SilentDeathTest.Elliott Hughes
Bug: http://b/184955378 Test: treehugger Change-Id: Ie0849224074da92203340a741a86a24a4a3702c2
2021-04-12Merge "Add tests for inet_nsap_addr()/inet_nsap_ntoa()."Elliott Hughes
2021-04-09Add tests for inet_nsap_addr()/inet_nsap_ntoa().Elliott Hughes
Turns out that "NSAP" is yet another ISO standard that no-one actually uses: https://en.wikipedia.org/wiki/NSAP_address Test: treehugger Change-Id: I73b4d924a8f4d34e3e2f2da00d0d5529db8e97d1
2021-04-09Merge "Add tests for the untested <wchar.h> functions."Treehugger Robot
2021-04-09Add tests for the untested <wchar.h> functions.Elliott Hughes
Test: treehugger Change-Id: Id3d8852fd195a7238d1fdc70cb1a92b921372717
2021-04-09Merge "Use GTEST_SKIP() rather than GTEST_LOG_() when skipping."Elliott Hughes
2021-04-09Merge "Improve tgamma(3) coverage."Treehugger Robot
2021-04-09Merge "Deflake time.clock_gettime test"Giuliano Procida
2021-04-08Use GTEST_SKIP() rather than GTEST_LOG_() when skipping.Elliott Hughes
Test: treehugger Change-Id: I74dca1882c002a51c9758fe7282b10c4413ecb03
2021-04-08Improve tgamma(3) coverage.Elliott Hughes
Test: treehugger Change-Id: I645288d51f8238433335b42befd6a6e8b625a673
2021-04-09Merge "Disable fdtrack post-fork."Josh Gao
2021-04-08Deflake time.clock_gettime testGiuliano Procida
The test aims to check that the time obtained the VDSO is the "same" as that obtained via the system call. Unfortunately, time progresses. Any check involving some fixed tolerance will have some non-zero probability of failure. We can instead check that a VDSO time value lies between two system call times. Bug: 184819133 Change-Id: Idb9c17b9f612613f6e18a56ee0f256971ddbdf1f Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-04-07Disable fdtrack post-fork.Josh Gao
Also delete some fdsan code that attempts to check for the post-fork state, but never will, because we update the cached pid upon fork. Bug: http://b/174542867 Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests Test: treehugger Change-Id: I9b748dac9de9b4c741897d93e64d31737e52bf8e
2021-04-07Use mean CPU time in an attempt to reduce test flakinessGiuliano Procida
The sleep(3) / clock(3) test is sensitive to outliers in the distribution of CPU consumed by the sleep system call. This changes the measured quantity to be the mean over 5 samples and sets the threshold to 10ms. Bug: 184727758 Change-Id: I20df3b620a5fbf4e58a3ca67306370351ac01d0c Test: treehugger Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-04-05setjmp/longjmp: avoid invalid values in the stack pointer.Elliott Hughes
arm64 was already being careful, but x86/x86-64 and 32-bit ARM could be caught by a signal in a state where the stack pointer was mangled. For 32-bit ARM I've taken care with the link register too, to avoid potential issues with unwinding. Bug: http://b/152210274 Test: treehugger Change-Id: I1ce285b017a633c732dbe04743368f4cae27af85
2021-03-11Merge "Improve fchmod() coverage."Treehugger Robot
2021-03-09Merge "Improve system() coverage."Elliott Hughes
2021-03-09Merge "Add some slack at the end of large allocations when target SDK level ↵Peter Collingbourne
< S."
2021-03-08Improve fchmod() coverage.Elliott Hughes
Test: treehugger Change-Id: I8ebccce7ab3c0a77cd84d0830f75e9d68c64bd52
2021-03-08Improve <sys/xattr.h> coverage.Elliott Hughes
Also fix a comment copy & paste mistake and some formatting. Test: treehugger Change-Id: I0af3ab2eb4f180f86b0ab7d2af260f0f30692fdd
2021-03-08Improve system() coverage.Elliott Hughes
There's a weird POSIX special case that we implement but don't test. Found from looking through the coverage data. Test: treehugger Change-Id: I74f5f57c4d8062034a3f6e986f9e57091bfc7f7c
2021-03-05Add some slack at the end of large allocations when target SDK level < S.Peter Collingbourne
This works around buggy applications that read a few bytes past the end of their allocation, which would otherwise cause a segfault with the concurrent Scudo change that aligns large allocations to the right. Because the implementation of android_set_application_target_sdk_version() lives in the linker, we need to introduce a hook so that libc is notified when the target SDK version changes. Bug: 181344545 Change-Id: Id4be6645b94fad3f64ae48afd16c0154f1de448f
2021-02-25Add wrappers for pidfd_{open,getfd,send_signal}.Josh Gao
Bug: http://b/172518739 Test: `/data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter="*pidfd*"` on blueline Change-Id: Ibae32bbedbcf26535a80a5cbfb55ce180906b610
2021-02-21Merge "Add LOCAL_LICENSE_KINDS to bionic"Bob Badour
2021-02-20Merge "Fix fdsan death tests."Elliott Hughes
2021-02-19Fix fdsan death tests.Elliott Hughes
Disable debuggerd for these expected failures. Also use the usual naming pattern. Bug: http://b/180605583 Test: check logs Change-Id: I0254cb658d8a68e963ef59264106de4775e3fedd
2021-02-19Merge "Don't dump backtraces while running fdtrack tests."Elliott Hughes
2021-02-19Add LOCAL_LICENSE_KINDS to bionicBob Badour
Added SPDX-license-identifier-Apache-2.0 to: apex/Android.bp libdl/Android.bp tools/Android.bp tools/versioner/Android.bp tools/versioner/src/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: benchmarks/Android.bp benchmarks/linker_relocation/gen/Android.bp libc/malloc_debug/Android.bp libc/system_properties/Android.bp tests/Android.bp tests/libs/Android.bp tests/libs/Android.build.dlext_testzip.mk tests/make_fortify_compile_test.mk Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-ISC SPDX-license-identifier-MIT legacy_notice legacy_unencumbered to: libc/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_unencumbered to: libm/Android.bp Added SPDX-license-identifier-Apache-2.0 legacy_unencumbered to: libc/tools/Android.bp Added SPDX-license-identifier-BSD to: benchmarks/linker_relocation/Android.bp benchmarks/spawn/Android.bp libc/async_safe/Android.bp libc/malloc_hooks/Android.bp libfdtrack/Android.bp linker/Android.bp tests/headers/Android.bp tests/headers/posix/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ib05bcaa276b3aa71a7654ccbe8e67e1f16aec9f3
2021-02-19Merge "Fix some bionic death tests."Elliott Hughes
2021-02-19Merge "Use death tests correctly."Elliott Hughes
2021-02-19Merge "Switch BionicDeathTest to `#pragma once`."Treehugger Robot
2021-02-19Merge "Use BionicDeathTest for an assert(3) test."Elliott Hughes
2021-02-19Merge "iconv(3): ignore src_bytes_left if src_bytes is null."Treehugger Robot
2021-02-19Merge "Increase leniancy in an inherently flaky test."Treehugger Robot
2021-02-18Don't dump backtraces while running fdtrack tests.Elliott Hughes
I'm assuming this was useful while debugging, but isn't needed now. Bug: http://b/180605583 Test: check logs Change-Id: I9d5bb8db60e7709a9a52e29469f7fd1d5a9cb085
2021-02-18Don't involve debuggerd in a SIGFPE test.Elliott Hughes
We just want to check that SIGFPE is raised, not try to "debug" this expected behavior. Bug: http://b/180605583 Test: check logs Change-Id: I11571e02c4608570e0d406adeabc36186c5bb107
2021-02-18Fix some bionic death tests.Elliott Hughes
These were creating tombstones and spewing to the log. You need TEST_F() rather than TEST(), and the modern style is apparently to use `using` rather than an empty subclass. Bug: http://b/180605583 Test: run tests, check logcat Change-Id: I1e639d34854aeff6f042c24643b769a6bcfab877
2021-02-18Use death tests correctly.Elliott Hughes
The existing attempt at a death test wrapper wasn't functional (because the tests were TEST rather than TEST_F), and the code in that class doesn't work anyway. Since I don't understand the intent behind the failing dup2() calls, I've just removed this and replaced it with BionicDeathTest which we do need to suppress all the debuggerd work which caused this bug to be filed. Bug: http://b/180605583 Test: treehugger Change-Id: I7717f7ae2620452656cf07db299774dadef55766
2021-02-18Use BionicDeathTest for an assert(3) test.Elliott Hughes
Bug: http://b/180605583 Test: check logs Change-Id: I5eebef156ea1185c605060fb7e9457ccaaadaf5d
2021-02-18Switch BionicDeathTest to `#pragma once`.Elliott Hughes
Test: treehugger Change-Id: I3daded12812fb579e8b7d7abeb885ee7f17032e3
2021-02-18Increase leniancy in an inherently flaky test.Elliott Hughes
The example in the bug was 16ms instead of 10ms. Try 20ms? Bug: http://b/180581857 Test: treehugger Change-Id: I58302ad576ab5a031124244edef9df733d796c7e
2021-02-18iconv(3): ignore src_bytes_left if src_bytes is null.Elliott Hughes
This is undefined behavior, but glibc and macOS are both lenient, and someone hit this in the wild, so we may as well be lenient too. (The only cost is that it's now slightly easier to write code that works on everything except old versions of Android.) Bug: https://issuetracker.google.com/180598400 Test: treehugger Change-Id: Ia217169ea6283cc53f4fbf71e5abfa08356c2049