aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* libsandbox: handle open(O_NOFOLLOW)Mike Frysinger2012-12-242-0/+11
| | | | | | | | | We don't check for O_NOFOLLOW in the open wrappers, so we end up returning the wrong error when operating on broken symlinks. URL: https://bugs.gentoo.org/413441 Reported-by: Marien Zwart <marienz@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: expand usage stringsMike Frysinger2012-12-2429-36/+70
| | | | | | | Makes it easier to quickly figure out how to run a helper test without having to resort to existing usage or the code itself. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: disable tostop on controlling terminalMike Frysinger2012-11-261-0/+3
| | | | | | | If this flag is set, then the tests get all hung up. Clear it in case someone has it active on their terminal. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: add x32 ABI supportv2.6Mike Frysinger2012-07-031-2/+2
| | | | | | | | | | | We can trace x32 when the host is x86_64 or x32, but x32 cannot trace x86_64 due to limitations in the kernel interface -- all pointers get truncated to 32bits. We'll have to add external ptrace helpers in the future to make this work, but for now, we'll just let x86_64 code run unchecked :(. URL: https://bugs.gentoo.org/394179 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* precompile headers.h to speed up build slightlyMike Frysinger2012-07-031-1/+1
| | | | | | | Since all system headers are included by way of headers.h, we can pre-compile this to speed up the build up a bit. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sb_printf: expand feature set slightly and fix testingMike Frysinger2012-07-023-2/+16
| | | | | | | | | | This adds support for signed ll, unsigned z, l, and ll, hex l, and ll, ignores the # for hex output since this is what we do implicitly already. As for testing, looks like during the autogeneration of testsuite.list.at, the sb_printf test was lost. Restore it so it gets run again. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: enable color/parallel by defaultMike Frysinger2012-06-242-0/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* significantly overhaul output helpersMike Frysinger2012-06-231-0/+4
| | | | | | | | | | | | | | | | | | | | There are a few major points we want to hit here: - have all output from libsandbox go through portage helpers when we are in the portage environment so that output is properly logged - convert SB_E{info,warn,error} to sb_e{info,warn,error} to match style of other functions and cut down on confusion - move all abort/output helpers to libsbutil so it can be used in all source trees and not just by libsandbox - migrate all abort points to the centralized sb_ebort helper Unfortunately, it's not terribly easy to untangle these into separate patches, but hopefully this shouldn't be too messy as much of it is mechanical: move funcs between files, and change the name of funcs that get called. URL: http://bugs.gentoo.org/278761 Reported-by: Mounir Lamouri <volkmar@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: always bubble up exit code regardless of log existenceMike Frysinger2012-06-2318-38/+18
| | | | | | | | | | | | To simplify testing, do not mung exit(0) to exit(1) just because the log file exists. In many of our tests, we will be doing things to generate a log file, but we explicitly test for exit values ourselves. This is also needed to make log file handling more resilient where we get the name at startup, but don't allow live env changes after that. The changing of the log name to sb.log on the fly no longer works. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: move disabling of sandbox verbose to common initMike Frysinger2012-06-235-4/+2
| | | | | | | | Since none of our tests care about the verbose output, move the disable to a common location so we don't have to do it on a more fine grained basis. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: drop beep supportMike Frysinger2012-06-231-1/+0
| | | | | | | | Almost no one has beep support turned on anymore, and ebeep in the main tree has been deprecated (meaning it wasn't found useful while building packages). So punt support for it from sandbox too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add static unlink testsMike Frysinger2012-03-064-0/+13
| | | | | | | | | Make sure that when we trace static apps, their bad syscalls don't get a chance to actually complete. URL: http://bugs.gentoo.org/406543 Reported-by: Marijn Schouten <hkbst@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: note that testsuite.list.at is generatedMike Frysinger2012-03-051-1/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: make `./testsuite #` workMike Frysinger2012-03-051-0/+4
| | | | | | | Without this, the test will fail because it can't find sandbox.sh which lives in the src dir. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: disable non-POSIX EBADFDMike Frysinger2011-07-081-1/+1
| | | | | | | POSIX doesn't specify EBADFD, and EBADF should cover us, and we don't really need it, so disable for now. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: catch mktemp related funcsMike Frysinger2011-07-0429-1/+240
| | | | | | URL: http://bugs.gentoo.org/374059 Reported-by: Nick Bowler <nbowler@draconx.ca> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: autogenerate testsuite.atMike Frysinger2011-07-042-37/+6
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: fix flags parsing in open64Mike Frysinger2011-07-041-2/+1
| | | | | | The open test got this fix a while ago, but open64 was missed. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: use %#x instead of 0x%xMike Frysinger2011-07-043-3/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: start futimesat tests based on utimensat onesMike Frysinger2011-01-015-0/+26
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: make defaults for fds sanerMike Frysinger2011-01-011-3/+16
| | | | | | | | | Let the default mode for files be 0777 rather than 0 so that the default creation of files actually works. Also make the flags part of a dirfd filename actually optional. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add a bunch more feasible errno valuesMike Frysinger2011-01-011-0/+23
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: unify duplicated name/value lookup codeMike Frysinger2010-11-262-18/+22
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: fix utimensat regression with NULL filenameMike Frysinger2010-11-262-0/+7
| | | | | | | | | | | The previous commit (libsandbox: handle dirfd in mkdir/open/unlink *at prechecks) unified some path checks while unifying the dirfd code, but prevented valid NULL paths from also being handled. Make sure we still handle that behavior, and add a test for it to prevent future regressions. URL: http://bugs.gentoo.org/346815 Reported-by: Jake Todd <jaketodd422@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: allow dirfds to specify mode tooMike Frysinger2010-11-261-17/+24
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add another unlinkat test for long pathsMike Frysinger2010-11-232-0/+11
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add debug output to sigsuspend-zsh_tstMike Frysinger2010-11-222-3/+15
| | | | | | | | If sigsuspend-zsh_tst fails, it isn't quite clear as to why. So make the output a bit more clear as to what's going on. URL: http://bugs.gentoo.org/339022 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add mkdirat/unlinkat precheck dirfd testsMike Frysinger2010-11-156-0/+38
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: generalize flag parsing to handle AT_* flags betterMike Frysinger2010-11-151-26/+35
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: fix swapped arg parsing with at dirfdMike Frysinger2010-11-151-3/+3
| | | | | | | The arg is supposed to be "<path>:<flags>", but we were parsing it as "<flags>:<path>". So unswap the logic. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: handle O_DIRECTORY file flagsMike Frysinger2010-11-151-0/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: check rmdir functionalityMike Frysinger2010-08-165-0/+26
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: re-order set -x in SB_RUNMike Frysinger2010-08-161-2/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: addpredict / by default to match portageMike Frysinger2010-08-152-2/+5
| | | | | | | | | Portage by default will do `addpredict /` which can causes tests that expect certain behavior to fail, but only when testing under portage. So tweak the default environment to include this so that we are forced to tweak the tests so that they pass in and out of the portage env. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: fix dist target for out-of-tree buildsMike Frysinger2010-08-151-2/+2
| | | | | | | | Building out-of-tree and then running `make dist` would miss a lot of important test files. Make sure globs are relative to the source tree and not the build tree. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: force a saner default envMike Frysinger2010-08-153-1/+14
| | | | | | | | | | Rather than having tests rely on implicit behavior (current dir is not listed anywhere thus it is denied), force tests to declare explicit deny paths when desired. This way `make check` works even when it is run under a path that is granted write access by default (such as the tempdirs). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: don't swallow SIGCHLD notificationsMike Frysinger2010-08-155-2/+58
| | | | | | | | | | | | When tracing static processes, the original implementation included code that would always swallow SIGCHLD. Much has changed since then, and it doesn't seem to be needed anymore, and it is certainly breaking a few packages. So drop it, add some tests, and if it causes a regression in the future, we can look at it then (with an actual test case). URL: http://bugs.gentoo.org/289963 Reported-by: Joeri Capens <joeri@capens.net> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: catch calls to remove()Mike Frysinger2009-12-207-0/+31
| | | | | | | | People rarely use this, but all it takes is one lame package. URL: http://bugs.gentoo.org/297684 Reported-by: Pacho Ramos <pacho@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: make signal code a bit more flexibleMike Frysinger2009-10-281-2/+23
| | | | | | This lets us easily set default signal handlers and execute code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add simple dlfcn utilv2.2Mike Frysinger2009-10-261-0/+109
| | | | | | Simple command line front end to dlopen and friends to quickly test things. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add reverse lookup funcsMike Frysinger2009-10-252-45/+54
| | | | | | This way we can include the C names in the default output. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: fix ptrace decode of utimensatMike Frysinger2009-10-2515-0/+80
| | | | | | | | | The ptrace code skipped one too many arguments when decoding the utimensat syscall which caused random utils to fail with garbage paths. URL: http://bugs.gentoo.org/288227 Reported-by: RB <aoz.syn@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: handle fd's w/out files in proc fd/Mike Frysinger2009-10-252-0/+6
| | | | | | | | | | | | | | When attempting to access anonymous pipes/sockets/etc..., we should let the access go through rather than rejecting the patch because we aren't able to access it. There is no backing file after all which means there is nothing for sandbox to check against. While this was noticed with an anonymous pipe, the logic applies to any anonymous fd such as sockets or whatever the kernel throws at us. URL: http://bugs.gentoo.org/288863 Reported-by: Marcin Mirosław <bug@mejor.pl> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: fix vfork-1 failurev2.1Mike Frysinger2009-08-255-6/+12
| | | | | | | The vfork-1 test was a little broken and didn't test the results quite right. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add -Wall to automake runs and fix falloutMike Frysinger2009-08-251-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: extend vfork-0 to run programs with argsMike Frysinger2009-06-041-4/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: extend file/dirfd parsingMike Frysinger2009-06-0425-45/+62
| | | | | | | Add support for file keywords (like "NULL") and for opening paths for dirfd arguments. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: allow numeric specifications of signalsMike Frysinger2009-06-041-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: use AUTOTEST_PATH rather than setting PATH manuallyMike Frysinger2009-04-132-5/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: run test scripts with shell tracingMike Frysinger2009-04-132-2/+2
| | | | | | This should make tracking down of errors when things fail much easier. Signed-off-by: Mike Frysinger <vapier@gentoo.org>