import CS libblockdev-2.28-12.el9

This commit is contained in:
eabdullin 2025-03-11 07:36:06 +00:00
parent 9cb07c5cb0
commit d9bdf4fdaf
3 changed files with 102 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 6067dbdf0fe3c2d83055c43edf35cddf277e7236 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Fri, 10 Nov 2023 14:09:20 +0100
Subject: [PATCH] tests: Remove unreliable nvme attribute checks
Some attributes like this health information data read counters
are just too volatile to be tested as there might be some other
processes probing the device causing the statistics counters to increase.
---
tests/nvme_test.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/nvme_test.py b/tests/nvme_test.py
index 3c7c0a29..f31de546 100644
--- a/tests/nvme_test.py
+++ b/tests/nvme_test.py
@@ -157,14 +157,12 @@ def test_smart_log(self):
self.assertEqual(log.critical_temp_time, 0)
self.assertEqual(log.ctrl_busy_time, 0)
self.assertEqual(log.media_errors, 0)
- # self.assertEqual(log.num_err_log_entries, 0)
self.assertEqual(log.percent_used, 0)
self.assertEqual(log.power_cycles, 0)
self.assertEqual(log.power_on_hours, 0)
self.assertEqual(log.spare_thresh, 0)
self.assertEqual(log.temp_sensors, [0, 0, 0, 0, 0, 0, 0, 0])
self.assertEqual(log.temperature, 0)
- self.assertGreater(log.total_data_read, 1)
self.assertEqual(log.unsafe_shutdowns, 0)
self.assertEqual(log.warning_temp_time, 0)
self.assertEqual(log.wctemp, 0)

View File

@ -0,0 +1,60 @@
From 874f378ae48860be89807c8021f66d23d5c7da62 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Thu, 14 Mar 2024 13:53:04 +0100
Subject: [PATCH] nvme: Add bd_nvme_is_tech_avail to the API file
---
src/lib/plugin_apis/nvme.api | 11 +++++++++++
tests/nvme_test.py | 14 ++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/lib/plugin_apis/nvme.api b/src/lib/plugin_apis/nvme.api
index 667dbe9e..af892d8e 100644
--- a/src/lib/plugin_apis/nvme.api
+++ b/src/lib/plugin_apis/nvme.api
@@ -66,6 +66,17 @@ typedef enum {
BD_NVME_TECH_MODE_INITIATOR = 1 << 2,
} BDNVMETechMode;
+/**
+ * bd_nvme_is_tech_avail:
+ * @tech: the queried tech
+ * @mode: a bit mask of queried modes of operation (#BDNVMETechMode) for @tech
+ * @error: (out) (nullable): place to store error (details about why the @tech-@mode combination is not available)
+ *
+ * Returns: whether the @tech-@mode combination is available -- supported by the
+ * plugin implementation and having all the runtime dependencies available
+ */
+gboolean bd_nvme_is_tech_avail (BDNVMETech tech, G_GNUC_UNUSED guint64 mode, GError **error);
+
/* BpG-skip */
/**
diff --git a/tests/nvme_test.py b/tests/nvme_test.py
index 060d6ebc..ca4fec90 100644
--- a/tests/nvme_test.py
+++ b/tests/nvme_test.py
@@ -27,6 +27,20 @@ class NVMeTest(unittest.TestCase):
BlockDev.reinit(cls.requested_plugins, True, None)
+class NVMePluginVersionTestCase(NVMeTest):
+ @tag_test(TestTags.NOSTORAGE)
+ def test_plugin_version(self):
+ self.assertEqual(BlockDev.get_plugin_soname(BlockDev.Plugin.NVME), "libbd_nvme.so.2")
+
+ @tag_test(TestTags.NOSTORAGE)
+ def test_availability(self):
+ avail = BlockDev.nvme_is_tech_avail(BlockDev.NVMETech.NVME, 0)
+ self.assertTrue(avail)
+
+ avail = BlockDev.nvme_is_tech_avail(BlockDev.NVMETech.FABRICS, 0)
+ self.assertTrue(avail)
+
+
class NVMeTestCase(NVMeTest):
def setUp(self):
self.dev_file = None
--
2.46.1

View File

@ -129,7 +129,7 @@
Name: libblockdev
Version: 2.28
Release: 10%{?dist}
Release: 12%{?dist}
Summary: A library for low-level manipulation with block devices
License: LGPLv2+
URL: https://github.com/storaged-project/libblockdev
@ -147,6 +147,8 @@ Patch9: 0009-Fix-issues-in-tests-when-running-in-FIPS-mode.patch
Patch10: 0010-lvm-Add-a-function-to-activate-LVs-in-shared-mode.patch
Patch11: 0011-nvme_libblockdev-3.0.4_backport.patch
Patch12: 0012-lvm-Add-support-for-starting-and-stopping-VG-locking.patch
Patch13: 0013-tests-Remove_unreliable_nvme_attribute_checks.patch
Patch14: 0014-nvme-Add-bd_nvme_is_tech_avail-to-the-API-file.patch
BuildRequires: make
BuildRequires: glib2-devel
@ -1045,6 +1047,14 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%files plugins-all
%changelog
* Thu Sep 19 2024 Vojtech Trefny <vtrefny@redhat.com> - 2.28-12
- nvme: Add bd_nvme_is_tech_avail to the API file
Resolves: RHEL-59588
* Tue Nov 28 2023 Tomas Bzatek <tbzatek@redhat.com> - 2.28-11
- tests: Remove unreliable nvme attribute checks
Resolves: RHEL-16126
* Wed Nov 08 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-10
- lvm: Add support for starting and stopping VG locking
Resolves: RHEL-15921