summaryrefslogtreecommitdiff
path: root/sys-libs/libblockdev/files/libblockdev-3.3.0-tests-skip-vdo.patch
blob: d6a3ae77bd7b04a0b48bba23ce5a520b9afc13c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
https://github.com/storaged-project/libblockdev/commit/08a78e8bb33963f0221af08cb115ecf83ecba74e

From 08a78e8bb33963f0221af08cb115ecf83ecba74e Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Thu, 27 Feb 2025 07:42:40 +0100
Subject: [PATCH] tests: Skip LVM VDO tests if 'vdoformat' is not available

LVM VDO still uses the vdoformat binary which might not be
available everywhere.

Related: https://github.com/storaged-project/udisks/issues/1353
---
 tests/lvm_dbus_tests.py | 3 +++
 tests/lvm_test.py       | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
index 644d3587..f28e0a79 100644
--- a/tests/lvm_dbus_tests.py
+++ b/tests/lvm_dbus_tests.py
@@ -2116,6 +2116,9 @@ def setUpClass(cls):
         if lvm_version < Version("2.3.07"):
             raise unittest.SkipTest("LVM version 2.3.07 or newer needed for LVM VDO.")
 
+        if not shutil.which("vdoformat"):
+            raise unittest.SkipTest("vdoformat executable not found in $PATH, skipping.")
+
         super().setUpClass()
 
     def setUp(self):
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
index 038e580d..0d7fe56f 100644
--- a/tests/lvm_test.py
+++ b/tests/lvm_test.py
@@ -1986,6 +1986,9 @@ def setUpClass(cls):
         if lvm_version < Version("2.3.07"):
             raise unittest.SkipTest("LVM version 2.3.07 or newer needed for LVM VDO.")
 
+        if not shutil.which("vdoformat"):
+            raise unittest.SkipTest("vdoformat executable not found in $PATH, skipping.")
+
         super().setUpClass()
 
     def setUp(self):