forked from rpms/libblockdev
import libblockdev-2.25-7.el9
This commit is contained in:
commit
f5166a0ed0
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/libblockdev-2.25.tar.gz
|
1
.libblockdev.metadata
Normal file
1
.libblockdev.metadata
Normal file
@ -0,0 +1 @@
|
||||
c16d236f95a7a88b1d0f5309fdc8823999d297d1 SOURCES/libblockdev-2.25.tar.gz
|
27
SOURCES/0001-Fix-comparing-DM-RAID-member-devices-UUID.patch
Normal file
27
SOURCES/0001-Fix-comparing-DM-RAID-member-devices-UUID.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 2da13152619ee7233650339797657b45088b2219 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 18 Aug 2020 09:44:29 +0200
|
||||
Subject: [PATCH] dm: Fix comparing DM RAID member devices UUID
|
||||
|
||||
There is no "UUID" property in UDev we must use the "ID_FS_UUID"
|
||||
one.
|
||||
This comparison works only because most DM RAID members don't have
|
||||
UUID so the check is skipped, but it fails for DDF RAID members
|
||||
which have a special GUID/UUID in UDev database.
|
||||
---
|
||||
src/plugins/dm.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/dm.c b/src/plugins/dm.c
|
||||
index a6412028..4ab0d2a4 100644
|
||||
--- a/src/plugins/dm.c
|
||||
+++ b/src/plugins/dm.c
|
||||
@@ -482,7 +482,7 @@ static gboolean raid_dev_matches_spec (struct raid_dev *raid_dev, const gchar *n
|
||||
|
||||
context = udev_new ();
|
||||
device = udev_device_new_from_subsystem_sysname (context, "block", dev_name);
|
||||
- dev_uuid = udev_device_get_property_value (device, "UUID");
|
||||
+ dev_uuid = udev_device_get_property_value (device, "ID_FS_UUID");
|
||||
major_str = udev_device_get_property_value (device, "MAJOR");
|
||||
minor_str = udev_device_get_property_value (device, "MINOR");
|
||||
|
97
SOURCES/0002-Fix-default-key-size-for-non-XTS-ciphers.patch
Normal file
97
SOURCES/0002-Fix-default-key-size-for-non-XTS-ciphers.patch
Normal file
@ -0,0 +1,97 @@
|
||||
From 5d29bc014a33d9bdc1c5fb4b8add2f38850f46a8 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 14:44:03 +0100
|
||||
Subject: [PATCH] crypto: Fix default key size for non XTS ciphers
|
||||
|
||||
512 bits should be default only for AES-XTS which needs two keys,
|
||||
default for other modes must be 256 bits.
|
||||
|
||||
resolves: rhbz#1931847
|
||||
---
|
||||
src/plugins/crypto.c | 11 +++++++++--
|
||||
src/plugins/crypto.h | 2 +-
|
||||
tests/crypto_test.py | 36 ++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 46 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
|
||||
index f4a2e8f0..1e7043fa 100644
|
||||
--- a/src/plugins/crypto.c
|
||||
+++ b/src/plugins/crypto.c
|
||||
@@ -774,8 +774,15 @@ static gboolean luks_format (const gchar *device, const gchar *cipher, guint64 k
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- /* resolve requested/default key_size (should be in bytes) */
|
||||
- key_size = (key_size != 0) ? (key_size / 8) : (DEFAULT_LUKS_KEYSIZE_BITS / 8);
|
||||
+ if (key_size == 0) {
|
||||
+ if (g_str_has_prefix (cipher_specs[1], "xts-"))
|
||||
+ key_size = DEFAULT_LUKS_KEYSIZE_BITS * 2;
|
||||
+ else
|
||||
+ key_size = DEFAULT_LUKS_KEYSIZE_BITS;
|
||||
+ }
|
||||
+
|
||||
+ /* key_size should be in bytes */
|
||||
+ key_size = key_size / 8;
|
||||
|
||||
/* wait for enough random data entropy (if requested) */
|
||||
if (min_entropy > 0) {
|
||||
diff --git a/src/plugins/crypto.h b/src/plugins/crypto.h
|
||||
index 71a1438d..a38724d9 100644
|
||||
--- a/src/plugins/crypto.h
|
||||
+++ b/src/plugins/crypto.h
|
||||
@@ -36,7 +36,7 @@ typedef enum {
|
||||
/* 20 chars * 6 bits per char (64-item charset) = 120 "bits of security" */
|
||||
#define BD_CRYPTO_BACKUP_PASSPHRASE_LENGTH 20
|
||||
|
||||
-#define DEFAULT_LUKS_KEYSIZE_BITS 512
|
||||
+#define DEFAULT_LUKS_KEYSIZE_BITS 256
|
||||
#define DEFAULT_LUKS_CIPHER "aes-xts-plain64"
|
||||
#define DEFAULT_LUKS2_SECTOR_SIZE 512
|
||||
|
||||
diff --git a/tests/crypto_test.py b/tests/crypto_test.py
|
||||
index 0609a070..0aecc032 100644
|
||||
--- a/tests/crypto_test.py
|
||||
+++ b/tests/crypto_test.py
|
||||
@@ -236,6 +236,42 @@ def test_luks2_format(self):
|
||||
self.fail("Failed to get pbkdf information from:\n%s %s" % (out, err))
|
||||
self.assertEqual(int(m.group(1)), 5)
|
||||
|
||||
+ def _get_luks1_key_size(self, device):
|
||||
+ _ret, out, err = run_command("cryptsetup luksDump %s" % device)
|
||||
+ m = re.search(r"MK bits:\s*(\S+)\s*", out)
|
||||
+ if not m or len(m.groups()) != 1:
|
||||
+ self.fail("Failed to get key size information from:\n%s %s" % (out, err))
|
||||
+ key_size = m.group(1)
|
||||
+ if not key_size.isnumeric():
|
||||
+ self.fail("Failed to get key size information from: %s" % key_size)
|
||||
+ return int(key_size)
|
||||
+
|
||||
+ @tag_test(TestTags.SLOW, TestTags.CORE)
|
||||
+ def test_luks_format_key_size(self):
|
||||
+ """Verify that formating device as LUKS works"""
|
||||
+
|
||||
+ # aes-xts: key size should default to 512
|
||||
+ succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-xts-plain64", 0, PASSWD, None, 0)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ key_size = self._get_luks1_key_size(self.loop_dev)
|
||||
+ self.assertEqual(key_size, 512)
|
||||
+
|
||||
+ # aes-cbc: key size should default to 256
|
||||
+ succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-cbc-essiv:sha256", 0, PASSWD, None, 0)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ key_size = self._get_luks1_key_size(self.loop_dev)
|
||||
+ self.assertEqual(key_size, 256)
|
||||
+
|
||||
+ # try specifying key size for aes-xts
|
||||
+ succ = BlockDev.crypto_luks_format(self.loop_dev, "aes-xts-plain64", 256, PASSWD, None, 0)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ key_size = self._get_luks1_key_size(self.loop_dev)
|
||||
+ self.assertEqual(key_size, 256)
|
||||
+
|
||||
+
|
||||
class CryptoTestResize(CryptoTestCase):
|
||||
|
||||
def _get_key_location(self, device):
|
178
SOURCES/0003-Memory-leaks-fixes-backport.patch
Normal file
178
SOURCES/0003-Memory-leaks-fixes-backport.patch
Normal file
@ -0,0 +1,178 @@
|
||||
From 98cb3b9cf2046ba6e33db6ff400449c6a4827932 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Thu, 29 Apr 2021 12:38:49 +0200
|
||||
Subject: [PATCH 1/8] kbd: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/kbd.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/kbd.c b/src/plugins/kbd.c
|
||||
index a2908ecb..d5ae0ed7 100644
|
||||
--- a/src/plugins/kbd.c
|
||||
+++ b/src/plugins/kbd.c
|
||||
@@ -1035,6 +1035,7 @@ gboolean bd_kbd_bcache_destroy (const gchar *bcache_device, GError **error) {
|
||||
|
||||
if (c_set_uuid) {
|
||||
path = g_strdup_printf ("/sys/fs/bcache/%s/stop", c_set_uuid);
|
||||
+ g_free (c_set_uuid);
|
||||
success = bd_utils_echo_str_to_file ("1", path, error);
|
||||
g_free (path);
|
||||
if (!success) {
|
||||
|
||||
From c6d226c70996f6006a3f6eff13f8264f03e95c4f Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:22:58 +0200
|
||||
Subject: [PATCH 2/8] crypto: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/crypto.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
|
||||
index 1e7043fa..4fad9a85 100644
|
||||
--- a/src/plugins/crypto.c
|
||||
+++ b/src/plugins/crypto.c
|
||||
@@ -1275,6 +1275,7 @@ gboolean bd_crypto_luks_add_key (const gchar *device, const gchar *pass, const g
|
||||
success = g_file_get_contents (nkey_file, &nkey_buf, &nbuf_len, error);
|
||||
if (!success) {
|
||||
g_prefix_error (error, "Failed to load key from file '%s': ", nkey_file);
|
||||
+ g_free (key_buf);
|
||||
return FALSE;
|
||||
}
|
||||
} else
|
||||
|
||||
From 41b460fb81cf066e7ddc0bdda7f34db5e90b9f79 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:23:24 +0200
|
||||
Subject: [PATCH 3/8] dm: Fix memory leak in the DM plugin and DM logging
|
||||
redirect function
|
||||
|
||||
---
|
||||
src/plugins/dm.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/dm.c b/src/plugins/dm.c
|
||||
index fb4e50b5..c9a735ed 100644
|
||||
--- a/src/plugins/dm.c
|
||||
+++ b/src/plugins/dm.c
|
||||
@@ -245,7 +245,8 @@ gchar* bd_dm_name_from_node (const gchar *dm_node, GError **error) {
|
||||
g_free (sys_path);
|
||||
|
||||
if (!success) {
|
||||
- /* errror is already populated */
|
||||
+ /* error is already populated */
|
||||
+ g_free (ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
From 8d085fbb15c18ca91a5eff89192391c5a0b3bb7a Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:24:14 +0200
|
||||
Subject: [PATCH 4/8] fs: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/fs/mount.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/fs/mount.c b/src/plugins/fs/mount.c
|
||||
index 43d64e8c..46e03ca4 100644
|
||||
--- a/src/plugins/fs/mount.c
|
||||
+++ b/src/plugins/fs/mount.c
|
||||
@@ -541,6 +541,7 @@ static gboolean run_as_user (MountFunc func, MountArgs *args, uid_t run_as_uid,
|
||||
"Unknoen error while reading error.");
|
||||
g_io_channel_unref (channel);
|
||||
close (pipefd[0]);
|
||||
+ g_free (error_msg);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
From 6c45f4ef1fc898d71cc2f13670adb508a6037c66 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:26:24 +0200
|
||||
Subject: [PATCH 5/8] kbd: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/kbd.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/kbd.c b/src/plugins/kbd.c
|
||||
index d5ae0ed7..ff8bde17 100644
|
||||
--- a/src/plugins/kbd.c
|
||||
+++ b/src/plugins/kbd.c
|
||||
@@ -1255,6 +1255,7 @@ static gboolean get_cache_size_used (const gchar *cache_dev_sys, guint64 *size,
|
||||
g_io_channel_unref (file);
|
||||
|
||||
if (!found) {
|
||||
+ g_free (line);
|
||||
g_set_error (error, BD_KBD_ERROR, BD_KBD_ERROR_BCACHE_INVAL,
|
||||
"Failed to get cache usage data");
|
||||
return FALSE;
|
||||
|
||||
From 4f4e93dfca36421eb0e0cb2dec5d48df5bc2f363 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:26:37 +0200
|
||||
Subject: [PATCH 6/8] lvm-dbus: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/lvm-dbus.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
|
||||
index b7b4480e..144551f5 100644
|
||||
--- a/src/plugins/lvm-dbus.c
|
||||
+++ b/src/plugins/lvm-dbus.c
|
||||
@@ -2927,6 +2927,7 @@ gboolean bd_lvm_cache_detach (const gchar *vg_name, const gchar *cached_lv, gboo
|
||||
lv_id = g_strdup_printf ("%s/%s", vg_name, cached_lv);
|
||||
call_lvm_obj_method_sync (lv_id, CACHED_LV_INTF, "DetachCachePool", params, NULL, extra, TRUE, error);
|
||||
g_free (lv_id);
|
||||
+ g_free (cache_pool_name);
|
||||
return ((*error) == NULL);
|
||||
}
|
||||
|
||||
|
||||
From 410a10bc2cfceeb550d72456573d4722b4207ddc Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:27:22 +0200
|
||||
Subject: [PATCH 7/8] mdraid: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/mdraid.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c
|
||||
index 74af744c..b97bc641 100644
|
||||
--- a/src/plugins/mdraid.c
|
||||
+++ b/src/plugins/mdraid.c
|
||||
@@ -1332,6 +1332,7 @@ gchar* bd_md_name_from_node (const gchar *node, GError **error) {
|
||||
continue;
|
||||
}
|
||||
node_name = g_path_get_basename (dev_path);
|
||||
+ g_free (dev_path);
|
||||
if (g_strcmp0 (node_name, node) == 0) {
|
||||
found = TRUE;
|
||||
name = g_path_get_basename (*path_p);
|
||||
|
||||
From 0d49e5d190e24fa89ae2795714d0276f24285b19 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Fri, 25 Sep 2020 14:27:54 +0200
|
||||
Subject: [PATCH 8/8] swap: Fix memory leak
|
||||
|
||||
---
|
||||
src/plugins/swap.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/swap.c b/src/plugins/swap.c
|
||||
index 102780a7..115f8fca 100644
|
||||
--- a/src/plugins/swap.c
|
||||
+++ b/src/plugins/swap.c
|
||||
@@ -417,6 +417,7 @@ gboolean bd_swap_swapstatus (const gchar *device, GError **error) {
|
||||
if (!real_device) {
|
||||
/* the device doesn't exist and thus is not an active swap */
|
||||
g_clear_error (error);
|
||||
+ g_free (file_content);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
296
SOURCES/0004-Adapt-to-dosfstools-4.2-changes.patch
Normal file
296
SOURCES/0004-Adapt-to-dosfstools-4.2-changes.patch
Normal file
@ -0,0 +1,296 @@
|
||||
From cc522ec3717d909370af6181c7859c62fa0167df Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 22 Feb 2021 15:40:56 +0100
|
||||
Subject: [PATCH 1/2] fs: Allow using empty label for vfat with newest
|
||||
dosfstools
|
||||
|
||||
---
|
||||
src/plugins/fs/vfat.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/fs/vfat.c b/src/plugins/fs/vfat.c
|
||||
index ff0c35a3..ce13f147 100644
|
||||
--- a/src/plugins/fs/vfat.c
|
||||
+++ b/src/plugins/fs/vfat.c
|
||||
@@ -232,10 +232,21 @@ gboolean bd_fs_vfat_repair (const gchar *device, const BDExtraArg **extra, GErro
|
||||
*/
|
||||
gboolean bd_fs_vfat_set_label (const gchar *device, const gchar *label, GError **error) {
|
||||
const gchar *args[4] = {"fatlabel", device, label, NULL};
|
||||
+ UtilDep dep = {"fatlabel", "4.2", "--version", "fatlabel\\s+([\\d\\.]+).+"};
|
||||
+ gboolean new_vfat = FALSE;
|
||||
|
||||
if (!check_deps (&avail_deps, DEPS_FATLABEL_MASK, deps, DEPS_LAST, &deps_check_lock, error))
|
||||
return FALSE;
|
||||
|
||||
+ if (!label || g_strcmp0 (label, "") == 0) {
|
||||
+ /* fatlabel >= 4.2 refuses to set empty label */
|
||||
+ new_vfat = bd_utils_check_util_version (dep.name, dep.version,
|
||||
+ dep.ver_arg, dep.ver_regexp,
|
||||
+ NULL);
|
||||
+ if (new_vfat)
|
||||
+ args[2] = "--reset";
|
||||
+ }
|
||||
+
|
||||
return bd_utils_exec_and_report_error (args, NULL, error);
|
||||
}
|
||||
|
||||
|
||||
From c3c3583409c8ed8f99a840e0c70cc92ca1dd3c93 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 27 Apr 2021 14:06:59 +0200
|
||||
Subject: [PATCH 2/2] tests: Call fs_vfat_mkfs with "--mbr=n" extra option in
|
||||
tests
|
||||
|
||||
Without the option the newest dosfstools 4.2 will create a valid
|
||||
MBR partition table with a simgle partition on the disk, see
|
||||
dosfstools/dosfstools#95 for details.
|
||||
---
|
||||
src/plugins/fs/vfat.c | 5 ++-
|
||||
tests/fs_test.py | 76 +++++++++++++++++++++++++++++++++----------
|
||||
2 files changed, 62 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/fs/vfat.c b/src/plugins/fs/vfat.c
|
||||
index ce13f147..6cb82537 100644
|
||||
--- a/src/plugins/fs/vfat.c
|
||||
+++ b/src/plugins/fs/vfat.c
|
||||
@@ -234,6 +234,7 @@ gboolean bd_fs_vfat_set_label (const gchar *device, const gchar *label, GError *
|
||||
const gchar *args[4] = {"fatlabel", device, label, NULL};
|
||||
UtilDep dep = {"fatlabel", "4.2", "--version", "fatlabel\\s+([\\d\\.]+).+"};
|
||||
gboolean new_vfat = FALSE;
|
||||
+ GError *loc_error = NULL;
|
||||
|
||||
if (!check_deps (&avail_deps, DEPS_FATLABEL_MASK, deps, DEPS_LAST, &deps_check_lock, error))
|
||||
return FALSE;
|
||||
@@ -242,9 +243,11 @@ gboolean bd_fs_vfat_set_label (const gchar *device, const gchar *label, GError *
|
||||
/* fatlabel >= 4.2 refuses to set empty label */
|
||||
new_vfat = bd_utils_check_util_version (dep.name, dep.version,
|
||||
dep.ver_arg, dep.ver_regexp,
|
||||
- NULL);
|
||||
+ &loc_error);
|
||||
if (new_vfat)
|
||||
args[2] = "--reset";
|
||||
+ else
|
||||
+ g_clear_error (&loc_error);
|
||||
}
|
||||
|
||||
return bd_utils_exec_and_report_error (args, NULL, error);
|
||||
diff --git a/tests/fs_test.py b/tests/fs_test.py
|
||||
index 239cb47c..2233db4f 100644
|
||||
--- a/tests/fs_test.py
|
||||
+++ b/tests/fs_test.py
|
||||
@@ -5,10 +5,13 @@
|
||||
import tempfile
|
||||
from contextlib import contextmanager
|
||||
import utils
|
||||
-from utils import run, create_sparse_tempfile, mount, umount, TestTags, tag_test
|
||||
+from utils import run, create_sparse_tempfile, mount, umount, TestTags, tag_test, run_command
|
||||
+import re
|
||||
import six
|
||||
import overrides_hack
|
||||
|
||||
+from distutils.version import LooseVersion
|
||||
+
|
||||
from gi.repository import BlockDev, GLib
|
||||
|
||||
|
||||
@@ -29,9 +32,20 @@ def mounted(device, where, ro=False):
|
||||
yield
|
||||
umount(where)
|
||||
|
||||
+
|
||||
+def _get_dosfstools_version():
|
||||
+ _ret, out, _err = run_command("mkfs.vfat --help")
|
||||
+ # mkfs.fat 4.1 (2017-01-24)
|
||||
+ m = re.search(r"mkfs\.fat ([\d\.]+)", out)
|
||||
+ if not m or len(m.groups()) != 1:
|
||||
+ raise RuntimeError("Failed to determine dosfstools version from: %s" % out)
|
||||
+ return LooseVersion(m.groups()[0])
|
||||
+
|
||||
+
|
||||
class FSTestCase(unittest.TestCase):
|
||||
|
||||
requested_plugins = BlockDev.plugin_specs_from_names(("fs", "loop"))
|
||||
+ _vfat_version = _get_dosfstools_version()
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -66,6 +80,11 @@ def setUp(self):
|
||||
|
||||
self.mount_dir = tempfile.mkdtemp(prefix="libblockdev.", suffix="ext4_test")
|
||||
|
||||
+ if self._vfat_version <= LooseVersion("4.1"):
|
||||
+ self._mkfs_options = None
|
||||
+ else:
|
||||
+ self._mkfs_options = [BlockDev.ExtraArg.new("--mbr=n", "")]
|
||||
+
|
||||
def _clean_up(self):
|
||||
try:
|
||||
utils.delete_lio_device(self.loop_dev)
|
||||
@@ -120,7 +139,10 @@ def test_generic_wipe(self):
|
||||
|
||||
# vfat has multiple signatures on the device so it allows us to test the
|
||||
# 'all' argument of fs_wipe()
|
||||
- ret = run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
|
||||
+ if self._vfat_version >= LooseVersion("4.2"):
|
||||
+ ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1 --mbr=n" % self.loop_dev)
|
||||
+ else:
|
||||
+ ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
time.sleep(0.5)
|
||||
@@ -142,7 +164,10 @@ def test_generic_wipe(self):
|
||||
self.assertEqual(fs_type, b"")
|
||||
|
||||
# now do the wipe all in a one step
|
||||
- ret = run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
|
||||
+ if self._vfat_version >= LooseVersion("4.2"):
|
||||
+ ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1 --mbr=n" % self.loop_dev)
|
||||
+ else:
|
||||
+ ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
succ = BlockDev.fs_wipe(self.loop_dev, True)
|
||||
@@ -197,7 +222,10 @@ def test_clean(self):
|
||||
|
||||
# vfat has multiple signatures on the device so it allows us to test
|
||||
# that clean removes all signatures
|
||||
- ret = run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
|
||||
+ if self._vfat_version >= LooseVersion("4.2"):
|
||||
+ ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1 --mbr=n" % self.loop_dev)
|
||||
+ else:
|
||||
+ ret = utils.run("mkfs.vfat -I %s >/dev/null 2>&1" % self.loop_dev)
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
time.sleep(0.5)
|
||||
@@ -744,9 +772,9 @@ def test_vfat_mkfs(self):
|
||||
"""Verify that it is possible to create a new vfat file system"""
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.fs_vfat_mkfs("/non/existing/device", None)
|
||||
+ BlockDev.fs_vfat_mkfs("/non/existing/device", self._mkfs_options)
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
# just try if we can mount the file system
|
||||
@@ -764,7 +792,10 @@ def test_vfat_mkfs_with_label(self):
|
||||
"""Verify that it is possible to create an vfat file system with label"""
|
||||
|
||||
ea = BlockDev.ExtraArg.new("-n", "TEST_LABEL")
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, [ea])
|
||||
+ if self._mkfs_options:
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, [ea] + self._mkfs_options)
|
||||
+ else:
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, [ea])
|
||||
self.assertTrue(succ)
|
||||
|
||||
fi = BlockDev.fs_vfat_get_info(self.loop_dev)
|
||||
@@ -775,7 +806,7 @@ class VfatTestWipe(FSTestCase):
|
||||
def test_vfat_wipe(self):
|
||||
"""Verify that it is possible to wipe an vfat file system"""
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
succ = BlockDev.fs_vfat_wipe(self.loop_dev)
|
||||
@@ -805,7 +836,7 @@ class VfatTestCheck(FSTestCase):
|
||||
def test_vfat_check(self):
|
||||
"""Verify that it is possible to check an vfat file system"""
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
succ = BlockDev.fs_vfat_check(self.loop_dev, None)
|
||||
@@ -818,7 +849,7 @@ class VfatTestRepair(FSTestCase):
|
||||
def test_vfat_repair(self):
|
||||
"""Verify that it is possible to repair an vfat file system"""
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
succ = BlockDev.fs_vfat_repair(self.loop_dev, None)
|
||||
@@ -828,7 +859,7 @@ class VfatGetInfo(FSTestCase):
|
||||
def test_vfat_get_info(self):
|
||||
"""Verify that it is possible to get info about an vfat file system"""
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
fi = BlockDev.fs_vfat_get_info(self.loop_dev)
|
||||
@@ -841,7 +872,7 @@ class VfatSetLabel(FSTestCase):
|
||||
def test_vfat_set_label(self):
|
||||
"""Verify that it is possible to set label of an vfat file system"""
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
fi = BlockDev.fs_vfat_get_info(self.loop_dev)
|
||||
@@ -870,7 +901,7 @@ class VfatResize(FSTestCase):
|
||||
def test_vfat_resize(self):
|
||||
"""Verify that it is possible to resize an vfat file system"""
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
# shrink
|
||||
@@ -999,7 +1030,7 @@ def _remove_user(self):
|
||||
def test_mount(self):
|
||||
""" Test basic mounting and unmounting """
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="mount_test")
|
||||
@@ -1104,7 +1135,7 @@ def test_mount_fstab(self):
|
||||
fstab = utils.read_file("/etc/fstab")
|
||||
self.addCleanup(utils.write_file, "/etc/fstab", fstab)
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="mount_fstab_test")
|
||||
@@ -1139,7 +1170,7 @@ def test_mount_fstab_user(self):
|
||||
fstab = utils.read_file("/etc/fstab")
|
||||
self.addCleanup(utils.write_file, "/etc/fstab", fstab)
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="mount_fstab_user_test")
|
||||
@@ -1423,7 +1454,16 @@ def expected_size(fi):
|
||||
@tag_test(TestTags.UNSTABLE)
|
||||
def test_vfat_generic_resize(self):
|
||||
"""Test generic resize function with a vfat file system"""
|
||||
- self._test_generic_resize(mkfs_function=BlockDev.fs_vfat_mkfs)
|
||||
+ def mkfs_vfat(device, options=None):
|
||||
+ if self._vfat_version >= LooseVersion("4.2"):
|
||||
+ if options:
|
||||
+ return BlockDev.fs_vfat_mkfs(device, options + [BlockDev.ExtraArg.new("--mbr=n", "")])
|
||||
+ else:
|
||||
+ return BlockDev.fs_vfat_mkfs(device, [BlockDev.ExtraArg.new("--mbr=n", "")])
|
||||
+ else:
|
||||
+ return BlockDev.fs_vfat_mkfs(device, options)
|
||||
+
|
||||
+ self._test_generic_resize(mkfs_function=mkfs_vfat)
|
||||
|
||||
def _destroy_lvm(self):
|
||||
run("vgremove --yes libbd_fs_tests >/dev/null 2>&1")
|
||||
@@ -1539,7 +1579,7 @@ def test_freeze_xfs(self):
|
||||
def test_freeze_vfat(self):
|
||||
""" Test basic freezing and un-freezing with FAT """
|
||||
|
||||
- succ = BlockDev.fs_vfat_mkfs(self.loop_dev, None)
|
||||
+ succ = BlockDev.fs_vfat_mkfs(self.loop_dev, self._mkfs_options)
|
||||
self.assertTrue(succ)
|
||||
|
||||
tmp = tempfile.mkdtemp(prefix="libblockdev.", suffix="freeze_test")
|
157
SOURCES/0005-Add-workarounds-for-some-LVM-test-issues.patch
Normal file
157
SOURCES/0005-Add-workarounds-for-some-LVM-test-issues.patch
Normal file
@ -0,0 +1,157 @@
|
||||
From 7c31cc534f96766dd2e3427b09d0affca66b0745 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 23 Mar 2021 13:54:02 +0100
|
||||
Subject: [PATCH 1/3] tests: Do not try to remove VG before removing the VDO
|
||||
pool
|
||||
|
||||
---
|
||||
tests/lvm_dbus_tests.py | 6 +++---
|
||||
tests/lvm_test.py | 6 +++---
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
|
||||
index 8f2bb95d..b599fdd0 100644
|
||||
--- a/tests/lvm_dbus_tests.py
|
||||
+++ b/tests/lvm_dbus_tests.py
|
||||
@@ -1517,14 +1517,14 @@ def setUp(self):
|
||||
self.assertTrue(succ)
|
||||
|
||||
def _clean_up(self):
|
||||
- BlockDev.lvm_vgremove("testVDOVG")
|
||||
- BlockDev.lvm_pvremove(self.loop_dev)
|
||||
-
|
||||
try:
|
||||
BlockDev.lvm_lvremove("testVDOVG", "vdoPool", True, None)
|
||||
except:
|
||||
pass
|
||||
|
||||
+ BlockDev.lvm_vgremove("testVDOVG")
|
||||
+ BlockDev.lvm_pvremove(self.loop_dev)
|
||||
+
|
||||
try:
|
||||
delete_lio_device(self.loop_dev)
|
||||
except RuntimeError:
|
||||
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
|
||||
index 6f80a3ba..6c04faf9 100644
|
||||
--- a/tests/lvm_test.py
|
||||
+++ b/tests/lvm_test.py
|
||||
@@ -1437,14 +1437,14 @@ def setUp(self):
|
||||
self.assertTrue(succ)
|
||||
|
||||
def _clean_up(self):
|
||||
- BlockDev.lvm_vgremove("testVDOVG")
|
||||
- BlockDev.lvm_pvremove(self.loop_dev)
|
||||
-
|
||||
try:
|
||||
BlockDev.lvm_lvremove("testVDOVG", "vdoPool", True, None)
|
||||
except:
|
||||
pass
|
||||
|
||||
+ BlockDev.lvm_vgremove("testVDOVG")
|
||||
+ BlockDev.lvm_pvremove(self.loop_dev)
|
||||
+
|
||||
try:
|
||||
delete_lio_device(self.loop_dev)
|
||||
except RuntimeError:
|
||||
|
||||
From 41b9d745b8c1a33221e15683f390bae180d1e960 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 23 Mar 2021 13:59:24 +0100
|
||||
Subject: [PATCH 2/3] tests: Force remove LVM VG /dev/ entry not removed by
|
||||
vgremove
|
||||
|
||||
The directory is sometimes not removed. This is a known bug that
|
||||
causes subsequent test cases to fail.
|
||||
---
|
||||
tests/lvm_dbus_tests.py | 6 ++++++
|
||||
tests/lvm_test.py | 6 ++++++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
|
||||
index b599fdd0..3278716e 100644
|
||||
--- a/tests/lvm_dbus_tests.py
|
||||
+++ b/tests/lvm_dbus_tests.py
|
||||
@@ -399,6 +399,9 @@ def _clean_up(self):
|
||||
except:
|
||||
pass
|
||||
|
||||
+ # XXX remove lingering /dev entries
|
||||
+ shutil.rmtree("/dev/testVG", ignore_errors=True)
|
||||
+
|
||||
LvmPVonlyTestCase._clean_up(self)
|
||||
|
||||
@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
|
||||
@@ -1525,6 +1528,9 @@ def _clean_up(self):
|
||||
BlockDev.lvm_vgremove("testVDOVG")
|
||||
BlockDev.lvm_pvremove(self.loop_dev)
|
||||
|
||||
+ # XXX remove lingering /dev entries
|
||||
+ shutil.rmtree("/dev/testVDOVG", ignore_errors=True)
|
||||
+
|
||||
try:
|
||||
delete_lio_device(self.loop_dev)
|
||||
except RuntimeError:
|
||||
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
|
||||
index 6c04faf9..d7e1f84c 100644
|
||||
--- a/tests/lvm_test.py
|
||||
+++ b/tests/lvm_test.py
|
||||
@@ -378,6 +378,9 @@ def _clean_up(self):
|
||||
except:
|
||||
pass
|
||||
|
||||
+ # XXX remove lingering /dev entries
|
||||
+ shutil.rmtree("/dev/testVG", ignore_errors=True)
|
||||
+
|
||||
LvmPVonlyTestCase._clean_up(self)
|
||||
|
||||
class LvmTestVGcreateRemove(LvmPVVGTestCase):
|
||||
@@ -1445,6 +1448,9 @@ def _clean_up(self):
|
||||
BlockDev.lvm_vgremove("testVDOVG")
|
||||
BlockDev.lvm_pvremove(self.loop_dev)
|
||||
|
||||
+ # XXX remove lingering /dev entries
|
||||
+ shutil.rmtree("/dev/testVDOVG", ignore_errors=True)
|
||||
+
|
||||
try:
|
||||
delete_lio_device(self.loop_dev)
|
||||
except RuntimeError:
|
||||
|
||||
From 4ecf0075cedf3a1d275d34b94ce5bb512c4e970e Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 23 Mar 2021 14:03:44 +0100
|
||||
Subject: [PATCH 3/3] tests: Tag LvmPVVGLVcachePoolCreateRemoveTestCase as
|
||||
unstable
|
||||
|
||||
LVM randomly fails to activate the newly created metadata LV.
|
||||
Issue is reported to LVM and not yet fixed.
|
||||
---
|
||||
tests/lvm_dbus_tests.py | 2 +-
|
||||
tests/lvm_test.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
|
||||
index 3278716e..4882da88 100644
|
||||
--- a/tests/lvm_dbus_tests.py
|
||||
+++ b/tests/lvm_dbus_tests.py
|
||||
@@ -1213,7 +1213,7 @@ def _clean_up(self):
|
||||
|
||||
@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
|
||||
class LvmPVVGLVcachePoolCreateRemoveTestCase(LvmPVVGLVcachePoolTestCase):
|
||||
- @tag_test(TestTags.SLOW)
|
||||
+ @tag_test(TestTags.SLOW, TestTags.UNSTABLE)
|
||||
def test_cache_pool_create_remove(self):
|
||||
"""Verify that is it possible to create and remove a cache pool"""
|
||||
|
||||
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
|
||||
index d7e1f84c..eb94c917 100644
|
||||
--- a/tests/lvm_test.py
|
||||
+++ b/tests/lvm_test.py
|
||||
@@ -1129,7 +1129,7 @@ def _clean_up(self):
|
||||
LvmPVVGLVTestCase._clean_up(self)
|
||||
|
||||
class LvmPVVGLVcachePoolCreateRemoveTestCase(LvmPVVGLVcachePoolTestCase):
|
||||
- @tag_test(TestTags.SLOW)
|
||||
+ @tag_test(TestTags.SLOW, TestTags.UNSTABLE)
|
||||
def test_cache_pool_create_remove(self):
|
||||
"""Verify that is it possible to create and remove a cache pool"""
|
||||
|
144
SOURCES/0006-Misc-test-fixes-backport.patch
Normal file
144
SOURCES/0006-Misc-test-fixes-backport.patch
Normal file
@ -0,0 +1,144 @@
|
||||
From 77b8d17b0baf96a7a552fb8963afdbe8c3b18da7 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 2 Jun 2021 12:53:24 +0200
|
||||
Subject: [PATCH 1/4] tests: Make sure the test temp mount is always unmounted
|
||||
|
||||
With try-finally the unmount function will always run even if the
|
||||
test case fails.
|
||||
---
|
||||
tests/fs_test.py | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/fs_test.py b/tests/fs_test.py
|
||||
index 2233db4f..de685b5f 100644
|
||||
--- a/tests/fs_test.py
|
||||
+++ b/tests/fs_test.py
|
||||
@@ -29,8 +29,10 @@ def check_output(args, ignore_retcode=True):
|
||||
@contextmanager
|
||||
def mounted(device, where, ro=False):
|
||||
mount(device, where, ro)
|
||||
- yield
|
||||
- umount(where)
|
||||
+ try:
|
||||
+ yield
|
||||
+ finally:
|
||||
+ utils.umount(where)
|
||||
|
||||
|
||||
def _get_dosfstools_version():
|
||||
|
||||
From aa802b6a2c9038069cfea7f821333367840a43ca Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 2 Jun 2021 13:05:17 +0200
|
||||
Subject: [PATCH 2/4] tests: Do not check that XFS shrink fails with xfsprogs
|
||||
>= 5.12
|
||||
|
||||
xfsprogs 5.12 now has experimental support for shrinking, we need
|
||||
more changes to support it properly so just skip this check for
|
||||
now.
|
||||
---
|
||||
tests/fs_test.py | 24 ++++++++++++++++++------
|
||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tests/fs_test.py b/tests/fs_test.py
|
||||
index de685b5f..551b6a7b 100644
|
||||
--- a/tests/fs_test.py
|
||||
+++ b/tests/fs_test.py
|
||||
@@ -44,6 +44,14 @@ def _get_dosfstools_version():
|
||||
return LooseVersion(m.groups()[0])
|
||||
|
||||
|
||||
+def _get_xfs_version():
|
||||
+ _ret, out, _err = utils.run_command("mkfs.xfs -V")
|
||||
+ m = re.search(r"mkfs\.xfs version ([\d\.]+)", out)
|
||||
+ if not m or len(m.groups()) != 1:
|
||||
+ raise RuntimeError("Failed to determine xfsprogs version from: %s" % out)
|
||||
+ return LooseVersion(m.groups()[0])
|
||||
+
|
||||
+
|
||||
class FSTestCase(unittest.TestCase):
|
||||
|
||||
requested_plugins = BlockDev.plugin_specs_from_names(("fs", "loop"))
|
||||
@@ -736,9 +744,11 @@ def test_xfs_resize(self):
|
||||
self.assertEqual(fi.block_size * fi.block_count, 50 * 1024**2)
|
||||
|
||||
# (still) impossible to shrink an XFS file system
|
||||
- with mounted(lv, self.mount_dir):
|
||||
- with self.assertRaises(GLib.GError):
|
||||
- succ = BlockDev.fs_xfs_resize(self.mount_dir, 40 * 1024**2 / fi.block_size, None)
|
||||
+ xfs_version = _get_xfs_version()
|
||||
+ if xfs_version < LooseVersion("5.1.12"):
|
||||
+ with mounted(lv, self.mount_dir):
|
||||
+ with self.assertRaises(GLib.GError):
|
||||
+ succ = BlockDev.fs_resize(lv, 40 * 1024**2)
|
||||
|
||||
run("lvresize -L70M libbd_fs_tests/xfs_test >/dev/null 2>&1")
|
||||
# should grow
|
||||
@@ -1503,9 +1513,11 @@ def test_xfs_generic_resize(self):
|
||||
self.assertEqual(fi.block_size * fi.block_count, 50 * 1024**2)
|
||||
|
||||
# (still) impossible to shrink an XFS file system
|
||||
- with mounted(lv, self.mount_dir):
|
||||
- with self.assertRaises(GLib.GError):
|
||||
- succ = BlockDev.fs_resize(lv, 40 * 1024**2)
|
||||
+ xfs_version = _get_xfs_version()
|
||||
+ if xfs_version < LooseVersion("5.1.12"):
|
||||
+ with mounted(lv, self.mount_dir):
|
||||
+ with self.assertRaises(GLib.GError):
|
||||
+ succ = BlockDev.fs_resize(lv, 40 * 1024**2)
|
||||
|
||||
run("lvresize -L70M libbd_fs_tests/xfs_test >/dev/null 2>&1")
|
||||
# should grow
|
||||
|
||||
From ca01b6021cce3ea6a2318e74de408757f933d947 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 2 Jun 2021 13:06:41 +0200
|
||||
Subject: [PATCH 3/4] tests: Temporarily skip
|
||||
test_snapshotcreate_lvorigin_snapshotmerge
|
||||
|
||||
With LVM DBus API the lvconvert job is never finished which means
|
||||
the test run never finishes in our CI.
|
||||
---
|
||||
tests/skip.yml | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/tests/skip.yml b/tests/skip.yml
|
||||
index 145d321d..e22e712d 100644
|
||||
--- a/tests/skip.yml
|
||||
+++ b/tests/skip.yml
|
||||
@@ -137,3 +137,9 @@
|
||||
- distro: "fedora"
|
||||
version: ["31", "32"]
|
||||
reason: "working with old-style LVM snapshots leads to deadlock in LVM tools"
|
||||
+
|
||||
+- test: lvm_dbus_tests.LvmTestLVsnapshots.test_snapshotcreate_lvorigin_snapshotmerge
|
||||
+ skip_on:
|
||||
+ - distro: "centos"
|
||||
+ version: "9"
|
||||
+ reason: "snapshot merge doesn't work on CentOS 9 Stream with LVM DBus API"
|
||||
|
||||
From d0c44cd3d182599433f352901796af7c403239eb Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 2 Jun 2021 13:08:09 +0200
|
||||
Subject: [PATCH 4/4] Fix skipping tests on Debian testing
|
||||
|
||||
Testing now identifies itself as "Debian GNU/Linux 11 (bullseye)"
|
||||
so the tests that should be skipped on testing needs to be skipped
|
||||
on "11" too.
|
||||
---
|
||||
tests/skip.yml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/skip.yml b/tests/skip.yml
|
||||
index e22e712d..4134ee87 100644
|
||||
--- a/tests/skip.yml
|
||||
+++ b/tests/skip.yml
|
||||
@@ -37,7 +37,7 @@
|
||||
- test: fs_test.MountTest.test_mount_ntfs_ro
|
||||
skip_on:
|
||||
- distro: "debian"
|
||||
- version: ["9", "10", "testing"]
|
||||
+ version: ["9", "10", "11", "testing"]
|
||||
reason: "NTFS mounting of read-only devices doesn't work as expected on Debian"
|
||||
|
||||
- test: kbd_test.KbdZRAM*
|
15
SOURCES/libblockdev-gcc11.patch
Normal file
15
SOURCES/libblockdev-gcc11.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/src/plugins/kbd.c b/src/plugins/kbd.c
|
||||
index a2908ec..97abd3b 100644
|
||||
--- a/src/plugins/kbd.c
|
||||
+++ b/src/plugins/kbd.c
|
||||
@@ -732,6 +732,10 @@ static gboolean wait_for_file (const char *filename) {
|
||||
*
|
||||
* Tech category: %BD_KBD_TECH_BCACHE-%BD_KBD_TECH_MODE_CREATE
|
||||
*/
|
||||
+/* This triggers a known false positive warning in gcc-11. It's being
|
||||
+ addressed upstream, but until the fix is available, this works around
|
||||
+ the false positive. */
|
||||
+__attribute__ ((optimize ("-O1")))
|
||||
gboolean bd_kbd_bcache_create (const gchar *backing_device, const gchar *cache_device, const BDExtraArg **extra, const gchar **bcache_device, GError **error) {
|
||||
const gchar *argv[6] = {"make-bcache", "-B", backing_device, "-C", cache_device, NULL};
|
||||
gboolean success = FALSE;
|
2267
SPECS/libblockdev.spec
Normal file
2267
SPECS/libblockdev.spec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user