!107 test: others/rpc do not use nftables locking backend

From: @maskinghk 
Reviewed-by: @chenwei_kernel 
Signed-off-by: @chenwei_kernel
This commit is contained in:
openeuler-ci-bot 2025-04-22 04:27:31 +00:00 committed by Gitee
commit c8aacfc30f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 95 additions and 1 deletions

View File

@ -0,0 +1,90 @@
From 29ccb5b625a5cf915f87d1d85952dde6b9b572ee Mon Sep 17 00:00:00 2001
From: Adrian Reber <areber@redhat.com>
Date: Thu, 6 Feb 2025 07:34:26 +0000
Subject: [PATCH] test: others/rpc do not use nftables locking backend
The tests in others/rpc are running as non-root and
fail silently if the nftables network locking backend is used.
This switches those tests to skip the network locking.
Signed-off-by: Adrian Reber <areber@redhat.com>
---
test/others/rpc/errno.py | 2 ++
test/others/rpc/ps_test.py | 1 +
test/others/rpc/run.sh | 2 +-
test/others/rpc/test-c.c | 2 ++
test/others/rpc/test.py | 1 +
5 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/others/rpc/errno.py b/test/others/rpc/errno.py
index b600b6d1c4..4ea6c9d441 100755
--- a/test/others/rpc/errno.py
+++ b/test/others/rpc/errno.py
@@ -67,6 +67,7 @@ def no_process(self):
req = self.get_base_req()
req.type = rpc.DUMP
req.opts.pid = pid
+ req.opts.network_lock = rpc.SKIP
self.send_req(req)
resp = self.recv_resp()
@@ -84,6 +85,7 @@ def process_exists(self):
req = self.get_base_req()
req.type = rpc.DUMP
req.opts.leave_running = True
+ req.opts.network_lock = rpc.SKIP
self.send_req(req)
resp = self.recv_resp()
diff --git a/test/others/rpc/ps_test.py b/test/others/rpc/ps_test.py
index daeda49bce..259f22e775 100755
--- a/test/others/rpc/ps_test.py
+++ b/test/others/rpc/ps_test.py
@@ -23,6 +23,7 @@
req.opts.log_file = 'page-server.log'
req.opts.log_level = 4
req.opts.images_dir_fd = os.open(args['dir'], os.O_DIRECTORY)
+req.opts.network_lock = rpc.SKIP
s.send(req.SerializeToString())
diff --git a/test/others/rpc/run.sh b/test/others/rpc/run.sh
index afd4fb5e33..3d5a53ae66 100755
--- a/test/others/rpc/run.sh
+++ b/test/others/rpc/run.sh
@@ -51,7 +51,7 @@ function test_restore_loop {
title_print "Dump loop process"
# So theoretically '-j' (--shell-job) should not be necessary, but on alpine
# this test fails without it.
- ${CRIU} dump -j -v4 -o dump-loop.log -D build/imgs_loop -t ${P}
+ ${CRIU} dump -j -v4 -o dump-loop.log --network-lock skip -D build/imgs_loop -t ${P}
title_print "Run restore-loop"
./restore-loop.py build/criu_service.socket build/imgs_loop
diff --git a/test/others/rpc/test-c.c b/test/others/rpc/test-c.c
index 792dbbf9c9..b3507975f8 100644
--- a/test/others/rpc/test-c.c
+++ b/test/others/rpc/test-c.c
@@ -99,6 +99,8 @@ int main(int argc, char *argv[])
req.opts->images_dir_fd = dir_fd;
req.opts->has_log_level = true;
req.opts->log_level = 4;
+ req.opts->has_network_lock = true;
+ req.opts->network_lock = CRIU_NETWORK_LOCK_METHOD__SKIP;
/*
* Connect to service socket
diff --git a/test/others/rpc/test.py b/test/others/rpc/test.py
index ce8411bc60..6f692f7557 100755
--- a/test/others/rpc/test.py
+++ b/test/others/rpc/test.py
@@ -24,6 +24,7 @@
req.opts.leave_running = True
req.opts.log_level = 4
req.opts.images_dir_fd = os.open(args['dir'], os.O_DIRECTORY)
+req.opts.network_lock = rpc.SKIP
# Send request
s.send(req.SerializeToString())

View File

@ -1,6 +1,6 @@
Name: criu
Version: 3.19
Release: 6
Release: 7
Provides: crtools = %{version}-%{release}
Obsoletes: crtools <= 1.0-2
Summary: A tool of Checkpoint/Restore in User-space
@ -21,6 +21,7 @@ Patch2: 0002-Add-sys_sched_setaffinity-define-for-loongarch64.patch
Patch3: 0003-chore-support-building-without-network.patch
Patch4: 0004-criu-fix-log_keep_err-signal-deadlock.patch
Patch5: 0005-lsm-use-the-user-provided-lsm-label.patch
Patch6: 0006-test-others-rpc-do-not-use-nftables-locking-backend.patch
%description
Checkpoint/Restore in Userspace(CRIU),is a software tool for the linux operating system.
@ -106,6 +107,9 @@ chmod 0755 %{buildroot}/run/%{name}/
%doc %{_mandir}/man1/{compel.1*,crit.1*,criu-ns.1*,criu-amdgpu-plugin.1*}
%changelog
* Mon Apr 21 2025 maxin <maxin@xfusion.com> - 3.19-7
- test: others/rpc do not use nftables locking backend
* Mon Apr 21 2025 maxin <maxin@xfusion.com> - 3.19-6
- lsm: use the user provided lsm label