aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/pid_namespace
AgeCommit message (Collapse)AuthorFilesLines
2023-02-13selftests: pid_namespace: Fix incorrect kernel headers search pathMathieu Desnoyers1-1/+1
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...). Signed-off-by: Mathieu Desnoyers <[email protected]> Cc: Shuah Khan <[email protected]> Cc: [email protected] Cc: Ingo Molnar <[email protected]> Cc: <[email protected]> # 5.18+ Signed-off-by: Shuah Khan <[email protected]>
2022-04-04selftests: fix header dependency for pid_namespace selftestsAxel Rasmussen1-3/+3
The way the test target was defined before, when building with clang we get a command line like this: clang -Wall -Werror -g -I../../../../usr/include/ \ regression_enomem.c ../pidfd/pidfd.h -o regression_enomem This yields an error, because clang thinks we want to produce both a *.o file, as well as a precompiled header: clang: error: cannot specify -o when generating multiple output files gcc, for whatever reason, doesn't exhibit the same behavior which I suspect is why the problem wasn't noticed before. This can be fixed simply by using the LOCAL_HDRS infrastructure the selftests lib.mk provides. It does the right think and marks the target as depending on the header (so if the header changes, we rebuild), but it filters the header out of the compiler command line, so we don't get the error described above. Signed-off-by: Axel Rasmussen <[email protected]> Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-07-06selftests: Remove unneeded selftest API headersKees Cook1-1/+0
Remove unused includes of the kselftest.h header. Acked-by: Christian Brauner <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-03-25selftests: add pid namespace ENOMEM regression testChristian Brauner4-0/+56
We recently regressed (cf. [1] and its corresponding fix in [2]) returning ENOMEM when trying to create a process in a pid namespace whose init process/child subreaper has already died. This has caused confusion at least once before that (cf. [3]). Let's add a simple regression test to catch this in the future. [1]: 49cb2fc42ce4 ("fork: extend clone3() to support setting a PID") [2]: b26ebfe12f34 ("pid: Fix error return value in some cases") [3]: 35f71bc0a09a ("fork: report pid reservation failure properly") Cc: Corey Minyard <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Adrian Reber <[email protected]> Cc: Dmitry Safonov <[email protected]> Cc: Andrei Vagin <[email protected]> Signed-off-by: Christian Brauner <[email protected]>