udisks2/udisks-2.10.0-integration_test_force_readonly.patch
Tomas Bzatek 10280ed660 * Fri Jun 02 2023 Tomas Bzatek <tbzatek@redhat.com> - 2.9.4-8
- iscsi: CHAP auth algorithm selection fixes (#2188916)
- tests: Use stronger passphrases for LUKS tests (#2188750,#2188752)
- integration-test: Fix scsi_debug cd drive read-only detection (#2211191)
- lvm2: Improve uevent processing (#2031673)
- tests: Mark test_job.UdisksJobTest.test_job as unstable (#2148844)

Resolves: #2188916,#2188750,#2188752,#2211191,#2031673,#2148844
2023-06-02 15:23:19 +02:00

34 lines
1.4 KiB
Diff

From def82f87dcc0b21e4890e12d82e6007f98551dcb Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 30 May 2023 18:23:08 +0200
Subject: [PATCH] tests: Forcefully set scsi_debug cd drive as read-only
There's something fishy in newer kernels and read-only detection
doesn't seem to work properly. As suggested in
https://github.com/util-linux/util-linux/issues/18#issuecomment-8453739
setting device ro by `blockdev --setro` seems to fix the issue.
---
src/tests/integration-test | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/tests/integration-test b/src/tests/integration-test
index 5f68217e0..10cdff85e 100755
--- a/src/tests/integration-test
+++ b/src/tests/integration-test
@@ -1096,6 +1096,7 @@ class FS(UDisksTestCase):
time.sleep(5)
self.sync()
cd_fs = self.udisks_filesystem(cd=True)
+ subprocess.call(['blockdev', '--setro', self.cd_device])
# forcing mount CD drive as 'rw' should fail
try:
@@ -1748,6 +1749,7 @@ class Polkit(UDisksTestCase, test_polkitd.PolkitTestCase):
try:
fs = self.udisks_filesystem(cd=True)
self.assertNotEqual(fs, None)
+ subprocess.call(['blockdev', '--setro', self.cd_device])
mount_path = fs.call_mount_sync(no_options, None)
self.assertIn('/media/', mount_path)