cryptsetup/cryptsetup-2.8.7-test-use-scsi_debug_teardown-helper-in-reencryption-.patch
Ondrej Kozina 2bf77a8fa4 Load volume keys in an intermediary keyring.
Adds patches fixing the pinned thread keyring issue.
Reinstate skipped gating tests due to missing crypto-check
test utility.

- Resolves: RHEL-193183
2026-07-31 11:42:59 +02:00

59 lines
1.4 KiB
Diff

From 0d49c448f070a09c0fcb12aab525b978da91e559 Mon Sep 17 00:00:00 2001
From: Ondrej Kozina <okozina@redhat.com>
Date: Tue, 30 Jun 2026 12:44:44 +0200
Subject: [PATCH] test: use scsi_debug_teardown helper in reencryption test.
---
tests/reencryption-compat-test | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/tests/reencryption-compat-test b/tests/reencryption-compat-test
index a14a5b4d..090373d8 100755
--- a/tests/reencryption-compat-test
+++ b/tests/reencryption-compat-test
@@ -37,10 +37,19 @@ fips_mode()
[ -n "$FIPS_MODE" ] && [ "$FIPS_MODE" -gt 0 ]
}
-del_scsi_device()
-{
- rmmod scsi_debug >/dev/null 2>&1
- sleep 1
+# $1 path to scsi debug bdev
+scsi_debug_teardown() {
+ local _tries=15;
+
+ while [ -b "$1" -a $_tries -gt 0 ]; do
+ rmmod scsi_debug >/dev/null 2>&1
+ if [ -b "$1" ]; then
+ sleep .1
+ _tries=$((_tries-1))
+ fi
+ done
+
+ test ! -b "$1" || rmmod scsi_debug >/dev/null 2>&1
}
remove_mapping()
@@ -52,7 +61,7 @@ remove_mapping()
umount $MNT_DIR > /dev/null 2>&1
rmdir $MNT_DIR > /dev/null 2>&1
LOOPDEV1=""
- del_scsi_device
+ test -b "$SCSI_DEV" && scsi_debug_teardown $SCSI_DEV
}
fail()
@@ -90,7 +99,7 @@ valgrind_run()
}
add_scsi_device() {
- del_scsi_device
+ test -b "$SCSI_DEV" && scsi_debug_teardown $SCSI_DEV
if [ -d /sys/module/scsi_debug ] ; then
echo "Cannot use scsi_debug module (in use or compiled-in), test skipped."
exit 77
--
2.55.0