diff --git a/.gitignore b/.gitignore index 07094a8..4fa2323 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,5 @@ /blivet-3.8.2-tests.tar.gz /blivet-3.9.0-tests.tar.gz /blivet-3.9.0.tar.gz +/blivet-3.10.0.tar.gz +/blivet-3.10.0-tests.tar.gz diff --git a/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch b/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch deleted file mode 100644 index ebbd2c1..0000000 --- a/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d5169a83f2428dbe2406881e8928a4418c04a365 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Fri, 2 Feb 2024 12:05:15 +0100 -Subject: [PATCH] Fix crash when scanning degraded/not fully assembled MD - arrays - -When we don't have the array name we cannot construct device ID -for the devicetree lookup, we need to let the code fallback to -other means like UUID. ---- - blivet/populator/helpers/mdraid.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/blivet/populator/helpers/mdraid.py b/blivet/populator/helpers/mdraid.py -index 6d66b0c0..22ca5195 100644 ---- a/blivet/populator/helpers/mdraid.py -+++ b/blivet/populator/helpers/mdraid.py -@@ -58,7 +58,8 @@ class MDDevicePopulator(DevicePopulator): - return None - - # try to get the device again now that we've got all the parents -- device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices) -+ if name: -+ device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices) - - if device is None: - try: --- -2.43.0 - diff --git a/0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch b/0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch deleted file mode 100644 index ccefb9c..0000000 --- a/0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch +++ /dev/null @@ -1,60 +0,0 @@ -From e65ff27b7e7907258faf25bd94880c310ce6744a Mon Sep 17 00:00:00 2001 -From: Steffen Maier -Date: Thu, 23 Feb 2023 13:28:50 +0100 -Subject: [PATCH] add udev-builtin-path_id property to zfcp-attached SCSI disks - -so anaconda can use it to display path_id information for multipath -members - -Signed-off-by: Steffen Maier ---- - blivet/devices/disk.py | 2 ++ - blivet/populator/helpers/disk.py | 1 + - tests/unit_tests/tags_test.py | 2 +- - 3 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py -index 5053f7bb..1db4b940 100644 ---- a/blivet/devices/disk.py -+++ b/blivet/devices/disk.py -@@ -469,10 +469,12 @@ class ZFCPDiskDevice(DiskDevice): - :keyword hba_id: ??? - :keyword wwpn: ??? - :keyword fcp_lun: ??? -+ :keyword id_path: string from udev-builtin-path_id - """ - self.hba_id = kwargs.pop("hba_id") - self.wwpn = kwargs.pop("wwpn") - self.fcp_lun = kwargs.pop("fcp_lun") -+ self.id_path = kwargs.pop("id_path") - DiskDevice.__init__(self, device, **kwargs) - self._clear_local_tags() - self.tags.add(Tags.remote) -diff --git a/blivet/populator/helpers/disk.py b/blivet/populator/helpers/disk.py -index ce2cb73b..2d66f797 100644 ---- a/blivet/populator/helpers/disk.py -+++ b/blivet/populator/helpers/disk.py -@@ -223,6 +223,7 @@ class ZFCPDevicePopulator(DiskDevicePopulator): - def _get_kwargs(self): - kwargs = super(ZFCPDevicePopulator, self)._get_kwargs() - -+ kwargs["id_path"] = udev.device_get_path(self.data) - for attr in ['hba_id', 'wwpn', 'fcp_lun']: - kwargs[attr] = udev.device_get_zfcp_attribute(self.data, attr=attr) - -diff --git a/tests/unit_tests/tags_test.py b/tests/unit_tests/tags_test.py -index 49a2d72e..15fa2a40 100644 ---- a/tests/unit_tests/tags_test.py -+++ b/tests/unit_tests/tags_test.py -@@ -72,7 +72,7 @@ class DeviceTagsTest(unittest.TestCase): - fcoe_device = FcoeDiskDevice('test6', nic=None, identifier=None, id_path=None) - self.assertIn(Tags.remote, fcoe_device.tags) - self.assertNotIn(Tags.local, fcoe_device.tags) -- zfcp_device = ZFCPDiskDevice('test7', hba_id=None, wwpn=None, fcp_lun=None) -+ zfcp_device = ZFCPDiskDevice('test7', hba_id=None, wwpn=None, fcp_lun=None, id_path=None) - self.assertIn(Tags.remote, zfcp_device.tags) - self.assertNotIn(Tags.local, zfcp_device.tags) - --- -2.43.0 - diff --git a/0003-Fix-UnboundLocalError-in-MD-populator.patch b/0003-Fix-UnboundLocalError-in-MD-populator.patch deleted file mode 100644 index c81c78f..0000000 --- a/0003-Fix-UnboundLocalError-in-MD-populator.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c141179b18984c5a96cd605c29df9716c714afe8 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 12 Feb 2024 14:49:23 +0100 -Subject: [PATCH] Fix UnboundLocalError in MD populator - -Follow-up for a73bb08255a97cf4f16c764ef09341a2421318d6 ---- - blivet/populator/helpers/mdraid.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/blivet/populator/helpers/mdraid.py b/blivet/populator/helpers/mdraid.py -index 22ca5195..c552aace 100644 ---- a/blivet/populator/helpers/mdraid.py -+++ b/blivet/populator/helpers/mdraid.py -@@ -60,6 +60,8 @@ class MDDevicePopulator(DevicePopulator): - # try to get the device again now that we've got all the parents - if name: - device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices) -+ else: -+ device = None - - if device is None: - try: --- -2.43.0 - diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4ca9235 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/python-blivet.spec b/python-blivet.spec index 991d441..0868360 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -1,11 +1,11 @@ Summary: A python module for system storage configuration Name: python-blivet Url: https://storageapis.wordpress.com/projects/blivet -Version: 3.9.0 +Version: 3.10.0 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 3%{?prerelease}%{?dist} +Release: 1%{?prerelease}%{?dist} Epoch: 1 License: LGPL-2.1-or-later %global realname blivet @@ -17,9 +17,6 @@ Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver Patch0: 0001-remove-btrfs-plugin.patch %endif -Patch1: 0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch -Patch2: 0003-Fix-UnboundLocalError-in-MD-populator.patch - # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). %global partedver 1.8.1 @@ -58,7 +55,6 @@ BuildRequires: python3-devel BuildRequires: python3-setuptools Requires: python3 -Requires: python3-six Requires: python3-pyudev >= %{pyudevver} Requires: parted >= %{partedver} Requires: python3-pyparted >= %{pypartedver} @@ -117,6 +113,40 @@ make DESTDIR=%{buildroot} install %{python3_sitelib}/* %changelog +* Fri May 10 2024 Vojtech Trefny - 3.10.0-1 +- Added support for PV grow (japokorn) +- misc: Add stratis-cli and stratisd to test dependencies (vtrefny) +- tests: Add a base class for stratis tests (vtrefny) +- Add a Stratis example with pool encryption using Clevis/Tang (vtrefny) +- Clear VG UUID from PVs after removing the PV (#2278058) (vtrefny) +- Use longer timeout for Stratis DBus calls (vtrefny) +- safe-dbus: Allow using custom timeouts for the DBus calls (vtrefny) +- Catch JSONDecodeError when parsing Stratis Clevis info (vtrefny) +- Add support for unlocking locked Stratis pools with Clevis (vtrefny) +- Add support for creating encrypted Stratis pool with Clevis (vtrefny) +- Round Stratis Filesystem size down to the nearest sector (vtrefny) +- Make sure to include stderr when gathering output of stratis tools (vtrefny) +- Add support for adding new members to existing Stratis pool (vtrefny) +- Base StratisPoolDevice on ContainerDevice instead of StorageDevice (vtrefny) +- Ignore invalid/empty UUIDs for NVMe namespaces (vtrefny) +- lvm: Use more generic exception for inconsistent PV sector sizes (vtrefny) +- Do not allow creating stratis pools with different sector sizes (vtrefny) +- availability: Fix starting DBus services (vtrefny) +- fstab: Use 'mount_type' when writing filesystem type to fstab (vtrefny) +- Add basic support for BitLocker devices (vtrefny) +- nvme: Skip startup/write when NVMe plugin isn't available (vtrefny) +- Fix scanning partitions on RAID arrays (#2269133) (vtrefny) +- Add a test case with DDF BIOS RAID array (vtrefny) +- tests: Try to get distro and version from /etc/os-release (vtrefny) +- availability: Fix checking for DBus service availability (vtrefny) +- ci: Update packit configuration for 3.10-devel (vtrefny) +- Remove vim formatting comments (vtrefny) +- tests: Do not ignore entire test files in pylint (vtrefny) +- tests: Do not try to import mock and patch from mock (vtrefny) +- Remove util.stringize and unicodeize functions (vtrefny) +- Remove Python SIX usage (vtrefny) +- Remove unused flags and do not read flags from boot command line (vtrefny) + * Mon Feb 12 2024 Vojtech Trefny - 3.9.0-3 - Fix UnboundLocalError in MD populator (#2263668) diff --git a/sources b/sources index feed479..58027aa 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (blivet-3.9.0-tests.tar.gz) = 8b332fd68f025b7fccb6701e763fd948ab80ae6facd031bfbbdc0c29337db6ba428d6e379e3135d5e79c14ef475c8947a6bd57a31f33c07a9705b0b937a08c4d -SHA512 (blivet-3.9.0.tar.gz) = 76d064bfe5087f0243f6bbd58b47f5be9b4e1f519be7feddf15b05f717b96725178b4025efec4721f4090f0bb8dc5c1199abcfe6be8d112f58af54091af44eaa +SHA512 (blivet-3.10.0.tar.gz) = 74172dec98a1b4f71cee6d64d46cdafa5116cfbbaddfdaed3dd118fef019dce54ff9d9206faada5991efac6b61bc558bb3050165f1d68bde1c1ec228c01916c8 +SHA512 (blivet-3.10.0-tests.tar.gz) = 53d2f37ff9822141caf669889835069da6e3f728761c0d006afcf80a2628f8816cbf558d30a085082e1bfec2e4b575f9ea78859a17f4e0bf7458e3faba158ef7 diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/lvm_factory.py b/tests/lvm_factory.py new file mode 100644 index 0000000..6603af2 --- /dev/null +++ b/tests/lvm_factory.py @@ -0,0 +1,42 @@ +#!/usr/bin/python3 + +import argparse +import sys + +import blivet + + +POOL_NAME = "blivet_test" + +parser = argparse.ArgumentParser() +parser.add_argument('-d', '--disks', default='') +args = parser.parse_args() + +b = blivet.Blivet() +b.reset() + +disks = list() +for disk_id in args.disks.split(','): + disk = b.devicetree.resolve_device(disk_id) + if not disk.is_disk: + sys.stderr.write("specified disk '%s' is not a disk\n" % disk_id) + sys.exit(1) + + disks.append(disk) + b.initialize_disk(disk) + +if len(disks) > 1: + container_raid_level = "raid1" + total_size = min(d.size for d in disks) +else: + container_raid_level = None + total_size = sum(d.size for d in disks) + +lv1 = b.factory_device(size=total_size*0.8, disks=disks, + name="lv1", container_name=POOL_NAME, + fstype='xfs', device_type=blivet.devicefactory.DEVICE_TYPE_LVM) +lv2 = b.factory_device(disks=disks, name="lv2", + container_name=POOL_NAME, container_raid_level='raid1', + fstype='ext4', device_type=blivet.devicefactory.DEVICE_TYPE_LVM) + +b.do_it() diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..be22d73 --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,8 @@ +--- + +standard-inventory-qcow2: + qemu: + m: 1G + drive: + - size: 10737418240 + - size: 10737418240 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..4ca1638 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,25 @@ +--- +# - hosts: localhost +- hosts: all + roles: + - role: standard-test-source + tags: + - always + + - role: standard-test-basic + tags: + - atomic + - classic + required_packages: + - python3 + - python3-dbus + - libblockdev-plugins-all + - python3-yaml + - targetcli + - stratis-cli + - stratisd + tests: + - unit-tests: + dir: . + run: ./unit_testing.sh + diff --git a/tests/unit_testing.sh b/tests/unit_testing.sh new file mode 100644 index 0000000..e028333 --- /dev/null +++ b/tests/unit_testing.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Bail out if anything goes wrong +set -e + +# Get path to blivet +blivet_path=$(find /usr/ -path */site-packages | tr '\n' ':') + +# Run upstream unit tests +cd ./source/ +PYTHONPATH=$blivet_path python3 tests/run_tests.py