aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/exec (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-19selftests: Set CC using CROSS_COMPILE once in lib.mkMichael Ellerman1-1/+0
This avoids repeating the logic in every Makefile. We mimic the top-level Makefile and use $(CROSS_COMPILE)gcc. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-13selftests: Add install targetMichael Ellerman1-0/+3
This adds make install support to selftests. The basic usage is: $ cd tools/testing/selftests $ make install That installs into tools/testing/selftests/install, which can then be copied where ever necessary. The install destination is also configurable using eg: $ INSTALL_PATH=/mnt/selftests make install The implementation uses two targets in the child makefiles. The first "install" is expected to install all files into $(INSTALL_PATH). The second, "emit_tests", is expected to emit the test instructions (ie. bash script) on stdout. Separating this from install means the child makefiles need no knowledge of the location of the test script. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-13selftests: Introduce minimal shared logic for running testsMichael Ellerman1-2/+3
This adds a Make include file which most selftests can then include to get the run_tests logic. On its own this has the advantage of some reduction in repetition, and also means the pass/fail message is defined in fewer places. However the key advantage is it will allow us to implement install very simply in a subsequent patch. The default implementation just executes each program in $(TEST_PROGS). We use a variable to hold the default implementation of $(RUN_TESTS) because that gives us a clean way to override it if necessary, ie. using override. The mount, memory-hotplug and mqueue tests use that to provide a different implementation. Tests are not run via /bin/bash, so if they are scripts they must be executable, we add a+x to several. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-01-06selftests/exec: allow shell return code of 126David Drysdale1-6/+13
When the shell fails to invoke a script because its path name is too long (ENAMETOOLONG), most shells return 127 to indicate command not found. However, some systems report 126 (which POSIX suggests should indicate a non-executable file) for this case, so allow that too. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David Drysdale <drysdale@google.com> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2014-12-22selftests/exec: Use %zu to format size_tGeert Uytterhoeven1-2/+2
On 32-bit: execveat.c: In function 'check_execveat_pathmax': execveat.c:183: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'size_t' execveat.c:187: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'size_t' Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2014-12-13syscalls: add selftest for execveat(2)David Drysdale3-0/+431
Signed-off-by: David Drysdale <drysdale@google.com> Cc: Meredydd Luff <meredydd@senatehouse.org> Cc: Shuah Khan <shuah.kh@samsung.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Kees Cook <keescook@chromium.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Rich Felker <dalias@aerifal.cx> Cc: Christoph Hellwig <hch@infradead.org> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>