summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix our ftw tests.Elliott Hughes2015-02-101-15/+42
| | | | | | | | | | | | SELinux denies access to some files in /sys, so we can't just trawl through that asserting general truths. Instead, create a small known tree. Sadly neither ftw nor nftw takes user callback data, otherwise it would be nice to assert that we visit all the expected nodes. Bug: 19252748 Change-Id: Ib5309c38aaef53e6030281191a265a8d5a619044
* Display errors instead of running infinitely.Christopher Ferris2015-02-061-17/+27
| | | | | | | | When there is an error detected, the code runs forever and then times out without any indication of what happened. Change it so that error messages are printed and the test fails. Change-Id: Id3160fc2f394984de0157356594fd8b40de66b4a
* Add path separator in bionic-unit-tests program path.Yabin Cui2015-02-051-0/+21
| | | | | Bug: 19220800 Change-Id: I4245b1270363544cd5f083fe7ea7d9b11b46cdc0
* Merge "Add signal handling in bionic gtest main."Yabin Cui2015-02-051-136/+235
|\
| * Add signal handling in bionic gtest main.Yabin Cui2015-02-041-136/+235
| | | | | | | | | | | | | | | | | | The two bugs are very closely related and code amount is very small, So I think they may be fixed in one change. Bug: 19128558 Bug: 19129994 Change-Id: I44a35398e64dfca7e9676428cb8f4026e8f6e488
* | Merge "Fix poll/ppoll fortify test to avoid hanging in failed fortify clang ↵Yabin Cui2015-02-051-2/+7
|\ \ | | | | | | | | | test."
| * | Fix poll/ppoll fortify test to avoid hanging in failed fortify clang test.Yabin Cui2015-02-041-2/+7
| |/ | | | | | | | | Bug: 19220800 Change-Id: Ie75c640183c4a41a499556fefb4f824a134a5fb1
* | Merge "Add test about pthread_mutex_t owner tid limit."Yabin Cui2015-02-031-0/+12
|\ \ | |/ |/|
| * Add test about pthread_mutex_t owner tid limit.Yabin Cui2015-02-031-0/+12
| | | | | | | | | | Bug: 19216648 Change-Id: I7b12955bdcad31c13bf8ec2740ff88ba15223ec0
* | Merge "Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support"Nick Kralevich2015-02-021-0/+124
|\ \
| * | Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH supportNick Kralevich2015-02-021-0/+124
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many libc functions have an option to not follow symbolic links. This is useful to avoid security sensitive code from inadvertantly following attacker supplied symlinks and taking inappropriate action on files it shouldn't. For example, open() has O_NOFOLLOW, chown() has lchown(), stat() has lstat(), etc. There is no such equivalent function for chmod(), such as lchmod(). To address this, POSIX introduced fchmodat(AT_SYMLINK_NOFOLLOW), which is intended to provide a way to perform a chmod operation which doesn't follow symlinks. Currently, the Linux kernel doesn't implement AT_SYMLINK_NOFOLLOW. In GLIBC, attempting to use the AT_SYMLINK_NOFOLLOW flag causes fchmodat to return ENOTSUP. Details are in "man fchmodat". Bionic currently differs from GLIBC in that AT_SYMLINK_NOFOLLOW is silently ignored and treated as if the flag wasn't present. This patch provides a userspace implementation of AT_SYMLINK_NOFOLLOW for bionic. Using open(O_PATH | O_NOFOLLOW), we can provide a way to atomically change the permissions on files without worrying about race conditions. As part of this change, we add support for fchmod on O_PATH file descriptors, because it's relatively straight forward and could be useful in the future. The basic idea behind this implementation comes from https://sourceware.org/bugzilla/show_bug.cgi?id=14578 , specifically comment #10. Change-Id: I1eba0cdb2c509d9193ceecf28f13118188a3cfa7
* | Explicitly check that the reason fortify tests abort is fortify.Elliott Hughes2015-02-021-73/+65
| | | | | | | | Change-Id: I95291e2febf7b497c1d9f37fd7fa9acdd21e86a4
* | Fortify poll and ppoll.Elliott Hughes2015-02-021-9/+13
| | | | | | | | | | | | | | And remove the test for FD_ZERO fortification, which never made much sense anyway. Change-Id: Id1009c5298d461fa4722189e8ecaf22f0c529536
* | Add the fortify tests back into the glibc tests.Elliott Hughes2015-01-311-0/+1
|/ | | | Change-Id: I4426d0c7c1bfe3b0028a674f72d1c3b9d883d6af
* Add --gtest-filter as synonym for --gtest_filter in bionic gtest main.Yabin Cui2015-01-281-0/+13
| | | | | Bug: 19130480 Change-Id: I0d3df70ee8f692581cc4b9b742c5f347259fd0d2
* Merge "Fix parse of gtest_filter in bionic gtest main."Yabin Cui2015-01-271-1/+6
|\
| * Fix parse of gtest_filter in bionic gtest main.Yabin Cui2015-01-271-1/+6
| | | | | | | | | | Bug: 19130330 Change-Id: Id6a60570a8aab6ae7259ff228b3801285b378f77
* | Merge "Add a test for float registers across setjmp/logjmp."Elliott Hughes2015-01-271-0/+51
|\ \ | |/ |/|
| * Add a test for float registers across setjmp/logjmp.Elliott Hughes2015-01-261-0/+51
| | | | | | | | Change-Id: I17cc056b185755e0b91de096b5ceefee4f4e0b3a
* | Rename "TIMEWARN" to "SLOW" in bionic gtest.Yabin Cui2015-01-261-17/+17
|/ | | | | Bug: 19109188. Change-Id: Idfe769ac652bf37642da24e4abb6061ca861d57e
* Merge "Support --gtest_ouput option in bionic gtest main."Yabin Cui2015-01-271-210/+402
|\
| * Support --gtest_ouput option in bionic gtest main.Yabin Cui2015-01-261-210/+402
| | | | | | | | | | Bug: 19109500 Change-Id: Ib18f90ad522e66ea62dd4e02e314585d9b36e15f
* | Merge "Add <error.h>."Elliott Hughes2015-01-262-0/+73
|\ \
| * | Add <error.h>.Elliott Hughes2015-01-262-0/+73
| | | | | | | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=79170 Change-Id: Id91765fac45124545e2674a5b2c814707c1a448b
* | | Remove obsolete BUILD_TINY_ANDROID.Elliott Hughes2015-01-241-3/+0
|/ / | | | | | | Change-Id: If2fc97134340fd09ec2583b666ace2f673cbdf66
* | Fix optimized fread.Elliott Hughes2015-01-241-1/+55
| | | | | | | | | | | | | | | | gcov does writes after reads on the same stream, but the bulk read optimization was clobbering the FILE _flags, causing fwrite to fail. Bug: 19129055 Change-Id: I9650cb7de4bb173a706b502406266ed0d2b654d7
* | Merge "Minimize calls to mprotect"Dmitriy Ivanov2015-01-243-0/+63
|\ \
| * | Minimize calls to mprotectDmitriy Ivanov2015-01-233-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement refcounter based data protection guard to avoid unnecessary calls to mprotect when dlopen/dlclose is called from a constructor. Bug: 19124318 Big: 7941716 Change-Id: Id221b84ce75443094f99756dc9950b0a1dc87222
* | | Allow make to set a timeout for the host tests.Dan Albert2015-01-231-0/+5
|/ / | | | | | | Change-Id: Icc2ebf64bd1da1687bf313fe7a5640155c5795d8
* | There's no such thing as LOCAL_CXXFLAGS.Elliott Hughes2015-01-221-2/+2
| | | | | | | | Change-Id: Iad70e6bd4cb7cec9e0ece500a540e4dadc83d92e
* | Fix the stdio.fread_EOF test.Elliott Hughes2015-01-221-7/+8
| | | | | | | | | | | | | | | | | | | | Another sizeof/strlen screwup caused by trying to be too clever. Use std::string instead. Also fix all the ASSERT_STREQ calls in this file that had the arguments the right^Wwrong way round. If I ever see Kent Beck... Change-Id: I47a1bdfee99cf4e7bed9b398f3158a308fbcf1e8
* | Fix fread_EOF test name.Elliott Hughes2015-01-221-1/+1
|/ | | | Change-Id: I53a7f1428fd27c0b2a5c80f2e8af4845d17f5b4b
* Implement __fsetlocking.Elliott Hughes2015-01-211-1/+4
| | | | | | | | | | | | The old __isthreaded hack was never very useful on Android because all user code runs in a VM where there are lots of threads running. But __fsetlocking lets a caller say "I'll worry about the locking for this FILE*", which is useful for the normal case where you don't share a FILE* between threads so you don't need any locking. Bug: 17154740 Bug: 18593728 Change-Id: I2a8dddc29d3edff39a3d7d793387f2253608a68d
* Merge "Optimized fread."Elliott Hughes2015-01-211-0/+22
|\
| * Optimized fread.Elliott Hughes2015-01-201-0/+22
| | | | | | | | | | | | | | | | | | This makes us competitive with glibc for fully-buffered and unbuffered reads, except in single-threaded situations where glibc avoids locking, but since we're never really single-threaded anyway, that isn't a priority. Bug: 18593728 Change-Id: Ib776bfba422ccf46209581fc0dc54f3567645b8f
* | Remove testcase time printing in bionic-unit-tests.Yabin Cui2015-01-201-16/+0
| | | | | | | | | | Bug: 19075565 Change-Id: Icccb60657a2985e96abb1703673f0ebe2199586a
* | Add target libbionic_gtest_main for cts test.Yabin Cui2015-01-201-5/+20
| | | | | | | | | | Bug: 17589740 Change-Id: I37f2d3fe72870b9dc867407fa1619c9a6fcd5cbb
* | Merge "Improve <stdio_ext.h> testing."Elliott Hughes2015-01-201-0/+6
|\ \ | |/ |/|
| * Improve <stdio_ext.h> testing.Elliott Hughes2015-01-161-0/+6
| | | | | | | | | | | | I almost fixed a non-bug. Add a test to prevent me from doing that. Change-Id: I4a1dc13e603a7a377bdaee2e78132015087f7107
* | Merge "Make sys_resource test more robust."Yabin Cui2015-01-161-44/+68
|\ \
| * | Make sys_resource test more robust.Yabin Cui2015-01-161-44/+68
| | | | | | | | | | | | | | | | | | | | | "ulimit -c xxx" command may run before bionic-unit-tests. Make sure sys_resource test fails gently in that case. Change-Id: Ic3b5ed8b20acba56df8c5ef082c88e5050e761aa
* | | Fix possible leak in pthread_detach.Yabin Cui2015-01-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | If pthread_detach() is called while the thread is in pthread_exit(), it takes the risk that no one can free the pthread_internal_t. So I add PTHREAD_ATTR_FLAG_ZOMBIE to detect this, maybe very rare, but both glibc and netbsd libpthread have similar function. Change-Id: Iaa15f651903b8ca07aaa7bd4de46ff14a2f93835
* | | Merge "Make bionic-unit-tests default run isolate mode."Yabin Cui2015-01-151-204/+222
|\ \ \
| * | | Make bionic-unit-tests default run isolate mode.Yabin Cui2015-01-081-204/+222
| |/ / | | | | | | | | | | | | | | | | | | | | | Fix bug of handling signal terminated tests. Bug: 17589740 Bug: 18951146 Change-Id: I4803382b26cd5454693090202b3ba38e3dbe66e5
* | | Test that ip6-localhost exists in etc/hosts.Yabin Cui2015-01-131-18/+65
| |/ |/| | | | | | | | | | | Addition change: make netdb_test pass on host. Bug: 18791191 Change-Id: I7a9e29aa559ff6557288b47323d8a436379201a2
* | Fix freeaddrinfo(NULL).Elliott Hughes2015-01-081-0/+5
| | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=13228 Change-Id: I5e3b126d90d750a93ac0b8872198e50ba047e603
* | Make pthread stack size match real range.Yabin Cui2015-01-081-5/+27
| | | | | | | | | | Bug: 18908062 Change-Id: I7037ac8273ebe54dd19b1561c7a376819049124c
* | Set linux 32bit personality for 32 bit processesDmitriy Ivanov2015-01-072-0/+34
|/ | | | | Bug: 18069809 Change-Id: Ie143d56b0f8f03510dc451649291067e1add1d2f
* Merge "better gtest runner for bionic"Yabin Cui2015-01-024-31/+822
|\
| * better gtest runner for bionicYabin Cui2014-12-134-31/+822
| | | | | | | | | | | | | | | | | | 1. option to run each test in a separate forked process: "--isolate". 2. warnings about slow tests: "--warnline". 3. run multiple tests at the same time: "-j N". Bug: 17589740 Change-Id: Ife5f4cafec43aa051ad7bd9c9b2b7e2e437db0de