aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/memfd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-11-03selftests: Make scripts executableBen Hutchings1-0/+0
Fixes: 87b2d44026e0 ("selftests: add memfd/sealing page-pinning tests") Fixes: 2bf9e0ab08c6 ("locking/static_keys: Provide a selftest") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-11-03selftests: memfd: Stop unnecessary rebuildsBen Hutchings1-6/+6
Instead of explicitly running the compiler, add dependencies and take advantage of implicit rules to build only as necessary. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-11-03selftests: Add missing #include directivesBen Hutchings1-0/+1
Several C programs fail to include the headers declaring all the functions they call, resulting in warnings or errors. After this, memfd_test.c is still missing some function declarations but can't easily get them because of a conflict between <linux/fcntl.h> and <sys/fcntl.h>. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-10-15selftests: memfd_test: Revised STACK_SIZE to make it 16-byte alignedChunyan Zhang1-1/+1
There is a mandate of 16-byte aligned stack on AArch64 [1], so the STACK_SIZE here should also be 16-byte aligned, otherwise we would get an error when calling clone(). [1] http://lxr.free-electrons.com/source/arch/arm64/kernel/process.c#L265 Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-04-02selftest/memfd: include default header install pathTyler Baker1-0/+1
Include the default path for INSTALL_HDR_PATH to make it less intrusive when cross building. Signed-off-by: Tyler Baker <tyler.baker@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-04-02selftest/memfd: enable cross compilationTyler Baker1-3/+4
Use the CC variable instead of hard coding gcc. Also clean up the compiler options by creating a CFLAGS variable. Signed-off-by: Tyler Baker <tyler.baker@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-13selftests: Introduce minimal shared logic for running testsMichael Ellerman1-3/+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>
2014-09-17selftests/memfd: Run test on all architecturesPranith Kumar1-21/+0
Remove the dependence on x86 to run the memfd test. Verfied on 32-bit powerpc. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2014-09-04memfd_test: Add missing argument to printf()Pranith Kumar1-1/+1
Add a missing path argument buf to printf() Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2014-09-04memfd_test: Make it work on 32-bit systemsPranith Kumar1-18/+16
This test currently fails on 32-bit systems since we use u64 type to pass the flags to fcntl. This commit changes this to use 'unsigned int' type for flags to fcntl making it work on 32-bit systems. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2014-08-29tools: selftests: fix build issue with make kselftests targetPhong Tran1-5/+5
Fix the typo of ARCH when running 'make kselftests'. Change the 'X86' to 'x86'. Test by compilation. Signed-off-by: Phong Tran <tranmanphong@gmail.com> Cc: David Herrmann <dh.herrmann@gmail.com> Cc: Hugh Dickins <hughd@google.com> Cc: Shuah Khan <shuah.kh@samsung.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-08selftests: add memfd/sealing page-pinning testsDavid Herrmann5-1/+450
Setting SEAL_WRITE is not possible if there're pending GUP users. This commit adds selftests for memfd+sealing that use FUSE to create pending page-references. FUSE is very helpful here in that it allows us to delay direct-IO operations for an arbitrary amount of time. This way, we can force the kernel to pin pages and then run our normal selftests. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Ryan Lortie <desrt@desrt.ca> Cc: Lennart Poettering <lennart@poettering.net> Cc: Daniel Mack <zonque@gmail.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-08selftests: add memfd_create() + sealing testsDavid Herrmann3-0/+944
Some basic tests to verify sealing on memfds works as expected and guarantees the advertised semantics. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Ryan Lortie <desrt@desrt.ca> Cc: Lennart Poettering <lennart@poettering.net> Cc: Daniel Mack <zonque@gmail.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>