aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-11-16Regression 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 Change-Id: I76b6b33c0665d7ad3bdd8c07d39a39d0d24d94df
2021-11-04Add the missing '--' to shell invocations.Elliott Hughes
This came up with POSIX recently. Doesn't seem like it matters since everyone's had this wrong for 40 years, but "meh" --- it's a trivial fix, and it's strictly correct even if nobody needs this, so let's just do it... (Geoff Clare pointed out that my app compat concern "what if someone's relying on this bug to pass flags to the shell?" isn't relevant because while you can indeed do that, you then can't pass a command!) Bug: https://austingroupbugs.net/view.php?id=1440 Test: treehugger Change-Id: I64f6440da55e2dc29d0136ee62007197d2f00d46
2021-11-02Update to v5.15 kernel headers.Christopher Ferris
Kernel headers coming from: Git: https://android.googlesource.com/kernel/common/ Branch: android-mainline Tag: android-mainline-5.15 Test: Builds, and ran bionic unit tests on flame. Change-Id: I86901ea6d89fb0f7384b90a47bef35d194083c24
2021-10-23Merge "Workaround Clang cannot build ifunc with LTO"android-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-2android-s-v2-preview-1Yi Kong
2021-10-21Workaround Clang cannot build ifunc with LTOYi Kong
This is a KI: https://bugs.llvm.org/show_bug.cgi?id=46488 Bug: 203737712 Test: m GLOBAL_THINLTO=true bionic-unit-tests-static Change-Id: I950a85f9676136299fc994a800d32e20bf12a8dd
2021-10-20Add execinfo functionality.Christopher Ferris
Bug: 27877410 Test: Add new unit tests. Change-Id: Id5d7eb27a23f50e99a04f5ee1ab64047ba269bab
2021-10-18Add preadv2/pwritev2 wrappers.Elliott Hughes
They're in glibc, though not in musl. Also add basic doc comments to the whole of <sys/uio.h>. Bug: http://b/203002492 Test: treehugger Change-Id: Ic607f7f349e5b7c9bf66c25b7bd68f827da530d6
2021-10-11Add/allow clang-14 warnings.Chih-Hung Hsieh
* -Wstatic-in-inline found in libm/upstream-freebsd/lib/msun/src/s_lround.c Test: mm in bionic/tests Bug: 201432564 Bug: 202752322 Change-Id: I4d506fa539ab0de939d85924a5fd9a61644e4fb0
2021-10-01Merge "Move ExecTestHelper to using a regex."Elliott Hughes
2021-10-01Merge "Add more tests to TEST_MAPPING"Colin Cross
2021-10-01Move ExecTestHelper to using a regex.Elliott Hughes
Test: treehugger Change-Id: I1aa6bc174e000cb57481c51109d98b8c2c5acb8e
2021-10-01Merge "Convert bionic dlext test zips to Android.bp"Colin Cross
2021-10-01Add more tests to TEST_MAPPINGColin Cross
Test: treehugger Change-Id: I1d7dd32fd7f90a20d61de4701293527f83dc4ec4
2021-09-30Convert bionic dlext test zips to Android.bpColin Cross
Use cc_genrules to create the dlext test zips needed by the bionic tests. The genrules aren't visible to Make, and so don't work with the `required` property. Move all of the dependencies to `data_bins`, `data_libs` or `data` for helper binaries, shared libraries or genrule zip files respectively. The `data*` properties copy the files into the same directory as a test, respecting the `bionic-loader-test-libs` relative path specified by each, but does not put each helper binary in its own subdirectory, so update the paths in each of the tests. Bug: 200872604 Test: atest CtsBionicTestCases Test: atest bionic-unit-tests Test: cts-tradefed run commandAndExit cts -m CtsBionicTestCases Test: adb push $OUT/data/nativetest/bionic-unit-tests /data/nativetest/ && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests Change-Id: Ic4257cb4104ff558326df2363730acd20464b051
2021-09-24Merge "Random HWASan cleanups."Evgenii Stepanov
2021-09-24Random HWASan cleanups.Evgenii Stepanov
Makes CtsBionicTestCases pass under HWASan. Bug: 193568145 Test: CtsBionicTestCases Change-Id: I38ee8a8508827c0ffee61ce33bb8c6a3f40388c9
2021-09-21Update allocator alignment tests.Christopher Ferris
clang was configured to force 16 byte alignments on allocations > 8 for 64 bit. Unfortunately, we never updated our alignment test to verify this behavior. So this finally adds these new restrictions. In addition, when GWP-ASan is enabled, it will take over allocations from the native allocator. In order to make sure that GWP-ASan also obeys these alignment checks, add a test that forces GWP-ASan on and runs the alignment check test. Test: Ran unit tests on a flame using scudo (both 32 bit and 64 bit). Test: Ran unit tests on a flame using jemalloc (both 32 bit and 64 bit). Change-Id: I87a20b9c2f32b9d207f36437d291ed44247dcbd1
2021-09-20Fix broken return code of M_INITIALIZE_GWP_ASAN.Christopher Ferris
When calling android_mallopt using M_INITIALIZE_GWP_ASAN, nothing was being returned. Fix this, add a test, and also refactor the code a bit so dynamic and static share the same code. Test: Unit tests pass in dynamic and static versions. Test: Passed using both jemalloc and scudo. Change-Id: Ibe54b6ccabdbd44d2378892e793df393978bc02b
2021-08-16Replace local MUSL define with global ANDROID_HOST_MUSLColin Cross
Bug: 190084016 Test: m USE_HOST_MUSL=true bionic-unit-tests-glibc Change-Id: I56b23576cb24912112d2ae56d8ecc2e3716982fe
2021-08-16Fix some clang-format issuesColin Cross
Fix some formatting issues that clang-format wanted to fix in the next CL. Test: builds Change-Id: I37ede84672a2ae7c262da00319d7dbc132d7f4d8
2021-08-16Fix bionic-unit-tests-glibc for 32-bit muslColin Cross
Musl doesn't define __NR_clock_gettime and __NR_gettimeofday on 32-bit architectures, #define them to __NR_clock_gettime32 and __NR_gettimeofday_time32 respectively. Bug: 190084016 Test: m USE_HOST_MUSL=true bionic-unit-tests-glibc Change-Id: Iec9ba776a94639a4b6a3ad42f18dfdb0e3580f02
2021-08-12Build bionic unit tests for muslColin Cross
Modify bionic unit tests that are built for glibc so that they also build against musl. They don't all pass though: With glibc: 2 SLOW TESTS 4 TIMEOUT TESTS 313 FAILED TESTS YOU HAVE 2 DISABLED TESTS With musl: 11 SLOW TESTS 11 TIMEOUT TESTS 363 FAILED TESTS YOU HAVE 2 DISABLED TESTS Bug: 190084016 Test: m bionic-unit-tests-glibc with musl Test: atest bionic-unit-tests-static Test: atest --host bionic-unit-tests-glibc with glibc Change-Id: I79b6eab04fed3cc4392450df5eef2579412edfe1
2021-07-30Enable posix strerror_r test in glibcColin Cross
Work around the incompatibility between libc++ and !_GNU_SOURCE by defining a wrapper function around the posix strerror_r in a file that does not include any libc++ or gtest headers. Test: bionic-unit-tests-glibc Change-Id: I6b097079777b5dcd802e295cc566964fe1c01382
2021-07-30POSIX strerror_r returns an error number, not -1Colin Cross
The posix spec says strerror_r returns a positive error number, not -1 and set errno. Test: bionic-unit-tests-static Change-Id: I6a12d50d046f9caac299bf3bff63e6c9496c1b6f
2021-07-12Make 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) Change-Id: Id80301e6426af16f89bd80a7a7ab127b6fd60425
2021-06-21Extend <sys/sysinfo.h> tests slightly.Elliott Hughes
We know game developers (and the Games SDK) look at this stuff, so make a bit more of an effort to ensure it's not completely broken. Test: treehugger Change-Id: I20b1c167faa1d9f4f39a94a723dabb848ce34269
2021-06-09Merge "Disable return PAC in __pthread_start."Peter Collingbourne
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
2021-06-08Skip the malloc_slack test on native bridge.Christopher Ferris
The allocator for the native bridge is not necessarily going to allocate the slack data. Bug: 189606147 Test: Ran on non-native bridge and verified test isn't skipped. Test: Ran on native bridge and verified test is skipped. Change-Id: Ia1555be0e9f55896af7ca81830605367133c44a1
2021-06-04Use 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
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."