From 11d367dee58b31dae06c6383164bfa29eb643d39 Mon Sep 17 00:00:00 2001 From: Zeyad Yasser Date: Tue, 20 Apr 2021 23:46:15 +0200 Subject: [PATCH] zdtm: add pidfd store based pid reuse test This is just a symlink to the original transition/pid_reuse test with the right options passed to trigger the pidfd store based pid reuse detection code path. Pidfd store based detection is supported only in RPC mode which requires passing a unix socket fd to be used as pidfd store and the kernel should support pidfd_open and pidfd_getfd syscalls {'feature': 'pidfd_store'} for this test to work. Signed-off-by: Zeyad Yasser --- scripts/ci/run-ci-tests.sh | 3 ++- test/zdtm/transition/Makefile | 1 + test/zdtm/transition/pidfd_store_sk.c | 1 + test/zdtm/transition/pidfd_store_sk.desc | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) create mode 120000 test/zdtm/transition/pidfd_store_sk.c create mode 100644 test/zdtm/transition/pidfd_store_sk.desc diff --git a/scripts/ci/run-ci-tests.sh b/scripts/ci/run-ci-tests.sh index f1ed6bcfce..8bdd0fce10 100755 --- a/scripts/ci/run-ci-tests.sh +++ b/scripts/ci/run-ci-tests.sh @@ -251,7 +251,8 @@ make -C test/others/rpc/ run ./test/zdtm.py run -t zdtm/transition/maps007 --pre 2 --page-server ./test/zdtm.py run -t zdtm/transition/maps007 --pre 2 --page-server --dedup -./test/zdtm.py run -t zdtm/transition/pid_reuse --pre 2 +./test/zdtm.py run -t zdtm/transition/pid_reuse --pre 2 # start time based pid reuse detection +./test/zdtm.py run -t zdtm/transition/pidfd_store_sk --rpc --pre 2 # pidfd based pid reuse detection ./test/zdtm.py run -t zdtm/static/socket-tcp-local --norst diff --git a/test/zdtm/transition/Makefile b/test/zdtm/transition/Makefile index 35301ac85e..9388157e82 100644 --- a/test/zdtm/transition/Makefile +++ b/test/zdtm/transition/Makefile @@ -22,6 +22,7 @@ TST_NOFILE = \ shmem \ lazy-thp \ pid_reuse \ + pidfd_store_sk \ TST_FILE = \ diff --git a/test/zdtm/transition/pidfd_store_sk.c b/test/zdtm/transition/pidfd_store_sk.c new file mode 120000 index 0000000000..fa12194772 --- /dev/null +++ b/test/zdtm/transition/pidfd_store_sk.c @@ -0,0 +1 @@ +pid_reuse.c \ No newline at end of file diff --git a/test/zdtm/transition/pidfd_store_sk.desc b/test/zdtm/transition/pidfd_store_sk.desc new file mode 100644 index 0000000000..0bcb97b09a --- /dev/null +++ b/test/zdtm/transition/pidfd_store_sk.desc @@ -0,0 +1 @@ +{'flags': 'suid pre-dump-notify', 'opts': '--pidfd-store', 'feature': 'pidfd_store'}