From 1c08709cdbea76c87dadefe534eee1b0d06e0d41 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 ++- scripts/ci/vagrant.sh | 3 +++ test/zdtm/transition/Makefile | 1 + test/zdtm/transition/pidfd_store_sk.c | 1 + test/zdtm/transition/pidfd_store_sk.desc | 1 + 5 files changed, 8 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 8fabf4a1d..72b31f7a2 100755 --- a/scripts/ci/run-ci-tests.sh +++ b/scripts/ci/run-ci-tests.sh @@ -253,7 +253,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/scripts/ci/vagrant.sh b/scripts/ci/vagrant.sh index 3ed1a2675..91b912aad 100755 --- a/scripts/ci/vagrant.sh +++ b/scripts/ci/vagrant.sh @@ -53,6 +53,9 @@ fedora-no-vdso() { # BPF tests are failing see: https://github.com/checkpoint-restore/criu/issues/1354 # Needs to be fixed, skip for now ssh default 'cd /vagrant/criu/test; sudo ./zdtm.py run -a --keep-going -x zdtm/static/bpf_hash -x zdtm/static/bpf_array' + # This test (pidfd_store_sk) requires pidfd_getfd syscall which is guaranteed in Fedora 33. + # It is also skipped from -a because it runs in RPC mode only + ssh default 'cd /vagrant/criu/test; sudo ./zdtm.py run -t zdtm/transition/pidfd_store_sk --rpc --pre 2' } $1 diff --git a/test/zdtm/transition/Makefile b/test/zdtm/transition/Makefile index 35301ac85..9388157e8 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 000000000..fa1219477 --- /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 000000000..841b21783 --- /dev/null +++ b/test/zdtm/transition/pidfd_store_sk.desc @@ -0,0 +1 @@ +{'flags': 'noauto suid pre-dump-notify', 'opts': '--pidfd-store', 'feature': 'pidfd_store'}