selftests: complete kselftest include centralization

This follow-up patch completes centralization of kselftest.h and
ksefltest_harness.h includes in remaining seltests files, replacing all
relative paths with a non-relative paths using shared -I include path in
lib.mk

Tested with gcc-13.3 and clang-18.1, and cross-compiled successfully on
riscv, arm64, x86_64 and powerpc arch.

[reddybalavignesh9979@gmail.com: add selftests include path for kselftest.h]
  Link: https://lkml.kernel.org/r/20251017090201.317521-1-reddybalavignesh9979@gmail.com
Link: https://lkml.kernel.org/r/20251016104409.68985-1-reddybalavignesh9979@gmail.com
Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/lkml/20250820143954.33d95635e504e94df01930d0@linux-foundation.org/
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Günther Noack <gnoack@google.com>
Cc: Jakub Kacinski <kuba@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mickael Salaun <mic@digikod.net>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Simon Horman <horms@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Bala-Vignesh-Reddy 2025-10-16 16:14:09 +05:30 committed by Andrew Morton
parent 262ef8e55b
commit e6fbd1759c
307 changed files with 311 additions and 307 deletions

View File

@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
userprogs-always-y += test-fsmount test-statx mountinfo test-list-all-mounts userprogs-always-y += test-fsmount test-statx mountinfo test-list-all-mounts
userccflags += -I $(srctree)/tools/testing/selftests/
userccflags += -I usr/include userccflags += -I usr/include

View File

@ -9,7 +9,7 @@
#include <string.h> #include <string.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
int main(void) int main(void)
{ {

View File

@ -14,7 +14,7 @@
#include <regex.h> #include <regex.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "../kselftest.h" #include "kselftest.h"
#include "alsa-local.h" #include "alsa-local.h"
#define SYSFS_ROOT "/sys" #define SYSFS_ROOT "/sys"

View File

@ -25,7 +25,7 @@
#include <poll.h> #include <poll.h>
#include <stdint.h> #include <stdint.h>
#include "../kselftest.h" #include "kselftest.h"
#include "alsa-local.h" #include "alsa-local.h"
#define TESTS_PER_CONTROL 7 #define TESTS_PER_CONTROL 7

View File

@ -17,7 +17,7 @@
#include <assert.h> #include <assert.h>
#include <pthread.h> #include <pthread.h>
#include "../kselftest.h" #include "kselftest.h"
#include "alsa-local.h" #include "alsa-local.h"
typedef struct timespec timestamp_t; typedef struct timespec timestamp_t;

View File

@ -7,7 +7,7 @@
*/ */
#include <string.h> #include <string.h>
#include <alsa/asoundlib.h> #include <alsa/asoundlib.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#define CH_NUM 4 #define CH_NUM 4

View File

@ -6,7 +6,7 @@
* *
* Author: Ivan Orlov <ivan.orlov0322@gmail.com> * Author: Ivan Orlov <ivan.orlov0322@gmail.com>
*/ */
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include <sound/asound.h> #include <sound/asound.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -19,7 +19,7 @@
#include <linux/auxvec.h> #include <linux/auxvec.h>
#include "../../kselftest.h" #include "kselftest.h"
#define TESTS_PER_HWCAP 3 #define TESTS_PER_HWCAP 3

View File

@ -18,7 +18,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include "../../kselftest.h" #include "kselftest.h"
#define EXPECTED_TESTS 11 #define EXPECTED_TESTS 11

View File

@ -16,7 +16,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include "../../kselftest.h" #include "kselftest.h"
#include "syscall-abi.h" #include "syscall-abi.h"

View File

@ -27,7 +27,7 @@
#include <asm/sve_context.h> #include <asm/sve_context.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include "../../kselftest.h" #include "kselftest.h"
#include "fp-ptrace.h" #include "fp-ptrace.h"

View File

@ -24,7 +24,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <asm/hwcap.h> #include <asm/hwcap.h>
#include "../../kselftest.h" #include "kselftest.h"
#define MAX_VLS 16 #define MAX_VLS 16

View File

@ -12,7 +12,7 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include "../../kselftest.h" #include "kselftest.h"
#include "rdvl.h" #include "rdvl.h"
int main(int argc, char **argv) int main(int argc, char **argv)

View File

@ -19,7 +19,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include "../../kselftest.h" #include "kselftest.h"
/* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */ /* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */
#ifndef NT_ARM_SVE #ifndef NT_ARM_SVE

View File

@ -19,7 +19,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include <asm/hwcap.h> #include <asm/hwcap.h>
#include "../../kselftest.h" #include "kselftest.h"
#include "rdvl.h" #include "rdvl.h"
#define ARCH_MIN_VL SVE_VL_MIN #define ARCH_MIN_VL SVE_VL_MIN

View File

@ -18,7 +18,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include "../../kselftest.h" #include "kselftest.h"
/* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */ /* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */
#ifndef NT_ARM_ZA #ifndef NT_ARM_ZA

View File

@ -18,7 +18,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include "../../kselftest.h" #include "kselftest.h"
/* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */ /* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */
#ifndef NT_ARM_ZA #ifndef NT_ARM_ZA

View File

@ -24,7 +24,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <asm/hwcap.h> #include <asm/hwcap.h>
#include "../../kselftest.h" #include "kselftest.h"
struct child_data { struct child_data {
char *name, *output; char *name, *output;

View File

@ -10,7 +10,7 @@
#include <setjmp.h> #include <setjmp.h>
#include <sched.h> #include <sched.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#include "helper.h" #include "helper.h"
#define PAC_COLLISION_ATTEMPTS 1000 #define PAC_COLLISION_ATTEMPTS 1000

View File

@ -6,7 +6,7 @@
#include <stdint.h> #include <stdint.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include "../../kselftest.h" #include "kselftest.h"
#define SHIFT_TAG(tag) ((uint64_t)(tag) << 56) #define SHIFT_TAG(tag) ((uint64_t)(tag) << 56)
#define SET_TAG(ptr, tag) (((uint64_t)(ptr) & ~SHIFT_TAG(0xff)) | \ #define SET_TAG(ptr, tag) (((uint64_t)(ptr) & ~SHIFT_TAG(0xff)) | \

View File

@ -104,7 +104,7 @@
#include "xskxceiver.h" #include "xskxceiver.h"
#include <bpf/bpf.h> #include <bpf/bpf.h>
#include <linux/filter.h> #include <linux/filter.h>
#include "../kselftest.h" #include "kselftest.h"
#include "xsk_xdp_common.h" #include "xsk_xdp_common.h"
#include <network_helpers.h> #include <network_helpers.h>

View File

@ -18,7 +18,7 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include "../kselftest.h" #include "kselftest.h"
#define COUNT_ISN_BPS 4 #define COUNT_ISN_BPS 4
#define COUNT_WPS 4 #define COUNT_WPS 4

View File

@ -26,7 +26,7 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include "../kselftest.h" #include "kselftest.h"
static volatile uint8_t var[96] __attribute__((__aligned__(32))); static volatile uint8_t var[96] __attribute__((__aligned__(32)));

View File

@ -19,7 +19,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
void child(int cpu) void child(int cpu)
{ {

View File

@ -16,7 +16,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include "../kselftest.h" #include "kselftest.h"
#define NR_TESTS 9 #define NR_TESTS 9

View File

@ -18,7 +18,7 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "../kselftest.h" #include "kselftest.h"
static int nerrs; static int nerrs;
static pid_t mpid; /* main() pid is used to avoid duplicate test counts */ static pid_t mpid; /* main() pid is used to avoid duplicate test counts */

View File

@ -7,7 +7,7 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/auxv.h> #include <sys/auxv.h>
#include "../kselftest.h" #include "kselftest.h"
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19)
# define HAVE_GETAUXVAL # define HAVE_GETAUXVAL

View File

@ -17,7 +17,7 @@
#include <string.h> #include <string.h>
#include <pthread.h> #include <pthread.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
static bool nsdelegate; static bool nsdelegate;

View File

@ -11,7 +11,7 @@
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
enum hog_clock_type { enum hog_clock_type {

View File

@ -3,7 +3,7 @@
#include <linux/limits.h> #include <linux/limits.h>
#include <signal.h> #include <signal.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
static int idle_process_fn(const char *cgroup, void *arg) static int idle_process_fn(const char *cgroup, void *arg)

View File

@ -11,7 +11,7 @@
#include <string.h> #include <string.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
#define DEBUG #define DEBUG

View File

@ -7,7 +7,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
#define ADDR ((void *)(0x0UL)) #define ADDR ((void *)(0x0UL))

View File

@ -9,7 +9,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
#include "../pidfd/pidfd.h" #include "../pidfd/pidfd.h"
#include "cgroup_util.h" #include "cgroup_util.h"

View File

@ -14,7 +14,7 @@
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <pthread.h> #include <pthread.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"

View File

@ -18,7 +18,7 @@
#include <errno.h> #include <errno.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
static bool has_localevents; static bool has_localevents;

View File

@ -9,7 +9,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
static int run_success(const char *cgroup, void *arg) static int run_success(const char *cgroup, void *arg)

View File

@ -10,7 +10,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "../kselftest.h" #include "kselftest.h"
#include "cgroup_util.h" #include "cgroup_util.h"
static int read_int(const char *path, size_t *value) static int read_int(const char *path, size_t *value)

View File

@ -18,7 +18,7 @@
#include <unistd.h> #include <unistd.h>
#include <sched.h> #include <sched.h>
#include "../kselftest.h" #include "kselftest.h"
#include "clone3_selftests.h" #include "clone3_selftests.h"
enum test_mode { enum test_mode {

View File

@ -24,7 +24,7 @@
#include <unistd.h> #include <unistd.h>
#include <sched.h> #include <sched.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "clone3_selftests.h" #include "clone3_selftests.h"
static void child_exit(int ret) static void child_exit(int ret)

View File

@ -13,7 +13,7 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
#include "clone3_selftests.h" #include "clone3_selftests.h"
static void nop_handler(int signo) static void nop_handler(int signo)

View File

@ -11,7 +11,7 @@
#include <syscall.h> #include <syscall.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
#define ptr_to_u64(ptr) ((__u64)((uintptr_t)(ptr))) #define ptr_to_u64(ptr) ((__u64)((uintptr_t)(ptr)))

View File

@ -20,7 +20,7 @@
#include <unistd.h> #include <unistd.h>
#include <sched.h> #include <sched.h>
#include "../kselftest.h" #include "kselftest.h"
#include "clone3_selftests.h" #include "clone3_selftests.h"
#define MAX_PID_NS_LEVEL 32 #define MAX_PID_NS_LEVEL 32

View File

@ -16,7 +16,7 @@
#include <signal.h> #include <signal.h>
#include <string.h> #include <string.h>
#include "../kselftest.h" #include "kselftest.h"
#define NL_MESSAGE_SIZE (sizeof(struct nlmsghdr) + sizeof(struct cn_msg) + \ #define NL_MESSAGE_SIZE (sizeof(struct nlmsghdr) + sizeof(struct cn_msg) + \
sizeof(struct proc_input)) sizeof(struct proc_input))

View File

@ -14,7 +14,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <linux/close_range.h> #include <linux/close_range.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "../clone3/clone3_selftests.h" #include "../clone3/clone3_selftests.h"

View File

@ -14,7 +14,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <linux/close_range.h> #include <linux/close_range.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "../clone3/clone3_selftests.h" #include "../clone3/clone3_selftests.h"
TEST(unshare_EMFILE) TEST(unshare_EMFILE)

View File

@ -19,7 +19,7 @@
#include <sys/un.h> #include <sys/un.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "../filesystems/wrappers.h" #include "../filesystems/wrappers.h"
#include "../pidfd/pidfd.h" #include "../pidfd/pidfd.h"

View File

@ -15,7 +15,7 @@
#include <linux/dma-buf.h> #include <linux/dma-buf.h>
#include <linux/dma-heap.h> #include <linux/dma-heap.h>
#include <drm/drm.h> #include <drm/drm.h>
#include "../kselftest.h" #include "kselftest.h"
#define DEVPATH "/dev/dma_heap" #define DEVPATH "/dev/dma_heap"

View File

@ -16,7 +16,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <linux/memfd.h> #include <linux/memfd.h>
#include <linux/udmabuf.h> #include <linux/udmabuf.h>
#include "../../kselftest.h" #include "kselftest.h"
#define TEST_PREFIX "drivers/dma-buf/udmabuf" #define TEST_PREFIX "drivers/dma-buf/udmabuf"
#define NUM_PAGES 4 #define NUM_PAGES 4

View File

@ -12,7 +12,7 @@
#include <time.h> #include <time.h>
#include <pthread.h> #include <pthread.h>
#include <linux/ntsync.h> #include <linux/ntsync.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
static int read_sem_state(int sem, __u32 *count, __u32 *max) static int read_sem_state(int sem, __u32 *count, __u32 *max)
{ {

View File

@ -14,7 +14,7 @@
#include <asm/uvdevice.h> #include <asm/uvdevice.h>
#include "../../../kselftest_harness.h" #include "kselftest_harness.h"
#define UV_PATH "/dev/uv" #define UV_PATH "/dev/uv"
#define BUFFER_SIZE 0x200 #define BUFFER_SIZE 0x200

View File

@ -30,7 +30,7 @@
#define _ASM_GENERIC_FCNTL_H #define _ASM_GENERIC_FCNTL_H
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
static int sys_execveat(int dirfd, const char *pathname, char *const argv[], static int sys_execveat(int dirfd, const char *pathname, char *const argv[],
char *const envp[], int flags) char *const envp[], int flags)

View File

@ -21,7 +21,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
#define TESTS_EXPECTED 54 #define TESTS_EXPECTED 54
#define TEST_NAME_LEN (PATH_MAX * 4) #define TEST_NAME_LEN (PATH_MAX * 4)

View File

@ -6,7 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include "../kselftest.h" #include "kselftest.h"
struct Statistics { struct Statistics {
unsigned long long load_address; unsigned long long load_address;

View File

@ -9,7 +9,7 @@
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
/* Remove a file, ignoring the result if it didn't exist. */ /* Remove a file, ignoring the result if it didn't exist. */
void rm(struct __test_metadata *_metadata, const char *pathname, void rm(struct __test_metadata *_metadata, const char *pathname,

View File

@ -5,7 +5,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
#define FORK(exec) \ #define FORK(exec) \
do { \ do { \

View File

@ -23,7 +23,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
int main(void) int main(void)
{ {

View File

@ -7,7 +7,7 @@
#include <syscall.h> #include <syscall.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
int sys_fchmodat2(int dfd, const char *filename, mode_t mode, int flags) int sys_fchmodat2(int dfd, const char *filename, mode_t mode, int flags)
{ {

View File

@ -6,7 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include "../kselftest.h" #include "kselftest.h"
static int lock_set(int fd, struct flock *fl) static int lock_set(int fd, struct flock *fl)
{ {

View File

@ -6,7 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "wrappers.h" #include "wrappers.h"
TEST(anon_inode_no_chown) TEST(anon_inode_no_chown)

View File

@ -21,7 +21,7 @@
#include <linux/android/binder.h> #include <linux/android/binder.h>
#include <linux/android/binderfs.h> #include <linux/android/binderfs.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define DEFAULT_THREADS 4 #define DEFAULT_THREADS 4

View File

@ -11,7 +11,7 @@
#include <asm/ioctls.h> #include <asm/ioctls.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "../kselftest.h" #include "kselftest.h"
static bool terminal_dup2(int duplicate, int original) static bool terminal_dup2(int duplicate, int original)
{ {

View File

@ -11,7 +11,7 @@
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
struct epoll_mtcontext struct epoll_mtcontext
{ {

View File

@ -11,7 +11,7 @@
#include <pthread.h> #include <pthread.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define EVENTFD_TEST_ITERATIONS 100000UL #define EVENTFD_TEST_ITERATIONS 100000UL

View File

@ -13,7 +13,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/mount.h> #include <sys/mount.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#define ASSERT_ERRNO(expected, _t, seen) \ #define ASSERT_ERRNO(expected, _t, seen) \
__EXPECT(expected, #expected, \ __EXPECT(expected, #expected, \

View File

@ -12,7 +12,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include <linux/types.h> #include <linux/types.h>
#include <linux/mount.h> #include <linux/mount.h>

View File

@ -17,7 +17,7 @@
#include <sched.h> #include <sched.h>
#include <linux/limits.h> #include <linux/limits.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define FUSECTL_MOUNTPOINT "/sys/fs/fuse/connections" #define FUSECTL_MOUNTPOINT "/sys/fs/fuse/connections"
#define FUSE_MOUNTPOINT "/tmp/fuse_mnt_XXXXXX" #define FUSE_MOUNTPOINT "/tmp/fuse_mnt_XXXXXX"

View File

@ -7,7 +7,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/xattr.h> #include <sys/xattr.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "wrappers.h" #include "wrappers.h"
TEST(kernfs_listxattr) TEST(kernfs_listxattr)

View File

@ -19,7 +19,7 @@ typedef struct {
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/fanotify.h> #include <sys/fanotify.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#include "../statmount/statmount.h" #include "../statmount/statmount.h"
#include "../utils.h" #include "../utils.h"

View File

@ -19,7 +19,7 @@ typedef struct {
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/fanotify.h> #include <sys/fanotify.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#include "../statmount/statmount.h" #include "../statmount/statmount.h"
#include "../utils.h" #include "../utils.h"

View File

@ -12,7 +12,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#include <unistd.h> #include <unistd.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define MNT_NS_COUNT 11 #define MNT_NS_COUNT 11
#define MNT_NS_LAST_INDEX 10 #define MNT_NS_LAST_INDEX 10

View File

@ -15,7 +15,7 @@
#include <sched.h> #include <sched.h>
#include <fcntl.h> #include <fcntl.h>
#include "../../kselftest.h" #include "kselftest.h"
#include "log.h" #include "log.h"
#include "../wrappers.h" #include "../wrappers.h"

View File

@ -12,7 +12,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#include <unistd.h> #include <unistd.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#include "../../pidfd/pidfd.h" #include "../../pidfd/pidfd.h"
#include "log.h" #include "log.h"
#include "../utils.h" #include "../utils.h"

View File

@ -11,7 +11,7 @@
#include <unistd.h> #include <unistd.h>
#include "statmount.h" #include "statmount.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#ifndef LISTMOUNT_REVERSE #ifndef LISTMOUNT_REVERSE
#define LISTMOUNT_REVERSE (1 << 0) /* List later mounts first */ #define LISTMOUNT_REVERSE (1 << 0) /* List later mounts first */

View File

@ -13,7 +13,7 @@
#include <linux/stat.h> #include <linux/stat.h>
#include "statmount.h" #include "statmount.h"
#include "../../kselftest.h" #include "kselftest.h"
static const char *const known_fs[] = { static const char *const known_fs[] = {
"9p", "adfs", "affs", "afs", "aio", "anon_inodefs", "apparmorfs", "9p", "adfs", "affs", "afs", "aio", "anon_inodefs", "apparmorfs",

View File

@ -15,7 +15,7 @@
#include "statmount.h" #include "statmount.h"
#include "../utils.h" #include "../utils.h"
#include "../../kselftest.h" #include "kselftest.h"
#define NSID_PASS 0 #define NSID_PASS 0
#define NSID_FAIL 1 #define NSID_FAIL 1

View File

@ -20,7 +20,7 @@
#include <sys/xattr.h> #include <sys/xattr.h>
#include <sys/mount.h> #include <sys/mount.h>
#include "../kselftest.h" #include "kselftest.h"
#include "wrappers.h" #include "wrappers.h"
#include "utils.h" #include "utils.h"

View File

@ -18,7 +18,7 @@
#include "futextest.h" #include "futextest.h"
#include "futex2test.h" #include "futex2test.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define MAX_THREADS 64 #define MAX_THREADS 64

View File

@ -14,7 +14,7 @@
#include <linux/prctl.h> #include <linux/prctl.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define MAX_THREADS 64 #define MAX_THREADS 64

View File

@ -9,7 +9,7 @@
#include <limits.h> #include <limits.h>
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define timeout_ns 30000000 #define timeout_ns 30000000
#define WAKE_WAIT_US 10000 #define WAKE_WAIT_US 10000

View File

@ -29,7 +29,7 @@
#include "atomic.h" #include "atomic.h"
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define MAX_WAKE_ITERS 1000 #define MAX_WAKE_ITERS 1000
#define THREAD_MAX 10 #define THREAD_MAX 10

View File

@ -25,7 +25,7 @@
#include <time.h> #include <time.h>
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
futex_t f1 = FUTEX_INITIALIZER; futex_t f1 = FUTEX_INITIALIZER;
futex_t f2 = FUTEX_INITIALIZER; futex_t f2 = FUTEX_INITIALIZER;

View File

@ -27,7 +27,7 @@
#include "atomic.h" #include "atomic.h"
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define DELAY_US 100 #define DELAY_US 100

View File

@ -11,7 +11,7 @@
#include <fcntl.h> #include <fcntl.h>
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define timeout_ns 30000000 #define timeout_ns 30000000
#define WAKE_WAIT_US 10000 #define WAKE_WAIT_US 10000

View File

@ -28,7 +28,7 @@
#include <signal.h> #include <signal.h>
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define PAGE_SZ 4096 #define PAGE_SZ 4096

View File

@ -19,7 +19,7 @@
#include "futextest.h" #include "futextest.h"
#include "futex2test.h" #include "futex2test.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
static long timeout_ns = 100000; /* 100us default timeout */ static long timeout_ns = 100000; /* 100us default timeout */
static futex_t futex_pi; static futex_t futex_pi;

View File

@ -30,7 +30,7 @@
#include <libgen.h> #include <libgen.h>
#include "futextest.h" #include "futextest.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define WAIT_US 5000000 #define WAIT_US 5000000

View File

@ -24,7 +24,7 @@
#include "futextest.h" #include "futextest.h"
#include "futex2test.h" #include "futex2test.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define timeout_ns 100000 #define timeout_ns 100000

View File

@ -18,7 +18,7 @@
#include "futextest.h" #include "futextest.h"
#include "futex2test.h" #include "futex2test.h"
#include "../../kselftest_harness.h" #include "kselftest_harness.h"
#define WAKE_WAIT_US 10000 #define WAKE_WAIT_US 10000
#define NR_FUTEXES 30 #define NR_FUTEXES 30

View File

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2022-2024 Red Hat */ /* Copyright (c) 2022-2024 Red Hat */
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include <fcntl.h> #include <fcntl.h>
#include <fnmatch.h> #include <fnmatch.h>

View File

@ -11,7 +11,7 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include "../kselftest.h" #include "kselftest.h"
#define MSEC_PER_SEC 1000L #define MSEC_PER_SEC 1000L
#define NSEC_PER_MSEC 1000000L #define NSEC_PER_MSEC 1000000L

View File

@ -11,7 +11,7 @@
#include <assert.h> #include <assert.h>
#include <poll.h> #include <poll.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "../../../../drivers/iommu/iommufd/iommufd_test.h" #include "../../../../drivers/iommu/iommufd/iommufd_test.h"
/* Hack to make assertions more readable */ /* Hack to make assertions more readable */

View File

@ -7,7 +7,7 @@
#include <sys/msg.h> #include <sys/msg.h>
#include <fcntl.h> #include <fcntl.h>
#include "../kselftest.h" #include "kselftest.h"
#define MAX_MSG_SIZE 32 #define MAX_MSG_SIZE 32

View File

@ -23,7 +23,7 @@
#include <dirent.h> #include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include "../kselftest.h" #include "kselftest.h"
#define TEST_SCANCODES 10 #define TEST_SCANCODES 10
#define SYSFS_PATH_MAX 256 #define SYSFS_PATH_MAX 256

View File

@ -18,7 +18,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include "../kselftest.h" #include "kselftest.h"
static long sys_kcmp(int pid1, int pid2, int type, unsigned long fd1, unsigned long fd2) static long sys_kcmp(int pid1, int pid2, int type, unsigned long fd1, unsigned long fd2)
{ {

View File

@ -14,7 +14,7 @@
* *
* .. code-block:: c * .. code-block:: c
* *
* #include "../kselftest_harness.h" * #include "kselftest_harness.h"
* *
* TEST(standalone_test) { * TEST(standalone_test) {
* do_some_stuff; * do_some_stuff;

View File

@ -8,7 +8,7 @@
/* Avoid any inconsistencies */ /* Avoid any inconsistencies */
#define TH_LOG_STREAM stdout #define TH_LOG_STREAM stdout
#include "../kselftest_harness.h" #include "kselftest_harness.h"
static void test_helper(struct __test_metadata *_metadata) static void test_helper(struct __test_metadata *_metadata)
{ {

View File

@ -20,7 +20,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest.h" #include "kselftest.h"
#ifndef ARRAY_SIZE #ifndef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

View File

@ -17,7 +17,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "wrappers.h" #include "wrappers.h"
#define TMP_DIR "tmp" #define TMP_DIR "tmp"

View File

@ -199,6 +199,9 @@ clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir)
# Build with _GNU_SOURCE by default # Build with _GNU_SOURCE by default
CFLAGS += -D_GNU_SOURCE= CFLAGS += -D_GNU_SOURCE=
# Additional include paths needed by kselftest.h and local headers
CFLAGS += -I${top_srcdir}/tools/testing/selftests
# Enables to extend CFLAGS and LDFLAGS from command line, e.g. # Enables to extend CFLAGS and LDFLAGS from command line, e.g.
# make USERCFLAGS=-Werror USERLDFLAGS=-static # make USERCFLAGS=-Werror USERLDFLAGS=-static
CFLAGS += $(USERCFLAGS) CFLAGS += $(USERCFLAGS)

View File

@ -13,7 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include "../kselftest_harness.h" #include "kselftest_harness.h"
#include "common.h" #include "common.h"
static struct lsm_ctx *next_ctx(struct lsm_ctx *ctxp) static struct lsm_ctx *next_ctx(struct lsm_ctx *ctxp)

Some files were not shown because too many files have changed in this diff Show More