From 57f009781d85bd8b0f1bc348cd63022e276f5780 Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Mon, 30 Mar 2026 11:05:28 -0400 Subject: [PATCH] import CS snapm-0.7.0-2.el9 --- .gitignore | 2 +- .snapm.metadata | 2 +- ...dful-of-tests-in-RH-CI-environments-.patch | 112 ++++++++++++++++++ SPECS/snapm.spec | 107 +++++++++++++++-- 4 files changed, 210 insertions(+), 13 deletions(-) create mode 100644 SOURCES/0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch diff --git a/.gitignore b/.gitignore index 1250e2f..4b73d16 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/snapm-0.4.3.tar.gz +SOURCES/snapm-0.7.0.tar.gz diff --git a/.snapm.metadata b/.snapm.metadata index d8f89c1..5be4966 100644 --- a/.snapm.metadata +++ b/.snapm.metadata @@ -1 +1 @@ -249e7900beb6fed873b91cc7152cbc5b13e3a450 SOURCES/snapm-0.4.3.tar.gz +20e288e9d9176177384bf9be307c4a8b66dc82a4 SOURCES/snapm-0.7.0.tar.gz diff --git a/SOURCES/0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch b/SOURCES/0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch new file mode 100644 index 0000000..6ad3f18 --- /dev/null +++ b/SOURCES/0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch @@ -0,0 +1,112 @@ +From 5d363f97d4ccea2a53c7da48ff9f18a3dd9da274 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Thu, 8 Jan 2026 18:24:16 +0000 +Subject: [PATCH] tests: skip a handful of tests in RH CI environments #915 + +Resolves: #915 + +Signed-off-by: Bryn M. Reeves +--- + tests/__init__.py | 7 +++++++ + tests/test_command.py | 4 +++- + tests/test_mounts.py | 4 +++- + tests/test_plugin.py | 3 ++- + 4 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/tests/__init__.py b/tests/__init__.py +index fa39b9cb..989fc87f 100644 +--- a/tests/__init__.py ++++ b/tests/__init__.py +@@ -101,3 +101,10 @@ def have_root(): + and ``False`` otherwise. + """ + return os.geteuid() == 0 and os.getegid() == 0 ++ ++ ++def in_rh_ci(): ++ """Return ``True`` if we appear to be running in CentOS/RHEL CI, ++ and ``False`` otherwise. ++ """ ++ return os.environ.get("IN_RH_CI", None) is not None +diff --git a/tests/test_command.py b/tests/test_command.py +index c1e547fb..4319ecd3 100644 +--- a/tests/test_command.py ++++ b/tests/test_command.py +@@ -18,7 +18,7 @@ from snapm.report import ReportOpts + import snapm.manager + import boom + +-from tests import MockArgs, have_root, BOOT_ROOT_TEST ++from tests import MockArgs, have_root, BOOT_ROOT_TEST, in_rh_ci + + from ._util import LvmLoopBacked, StratisLoopBacked + +@@ -1079,6 +1079,7 @@ class CommandTests(CommandTestsBase): + args += ["snapset", "delete", "hourly.0"] + self.assertEqual(command.main(args), 0) + ++ @unittest.skipIf(in_rh_ci(), "Tests running in RH CI pipeline") + def test_main_snapset_diff(self): + """Test 'snapm snapset diff' command.""" + self.manager.create_snapshot_set("testset0", self.mount_points()) +@@ -1110,6 +1111,7 @@ class CommandTests(CommandTestsBase): + self.manager.delete_snapshot_sets(snapm.Selection(name="testset0")) + self.manager.delete_snapshot_sets(snapm.Selection(name="testset1")) + ++ @unittest.skipIf(in_rh_ci(), "Tests running in RH CI pipeline") + def test_main_snapset_diffreport(self): + """Test 'snapm snapset diffreport' command.""" + self.manager.create_snapshot_set("testset0", self.mount_points()) +diff --git a/tests/test_mounts.py b/tests/test_mounts.py +index d6c7a5a3..db249341 100644 +--- a/tests/test_mounts.py ++++ b/tests/test_mounts.py +@@ -24,7 +24,7 @@ import snapm.manager._mounts as mounts + import snapm.manager + from snapm.manager.plugins import format_snapshot_name, encode_mount_point + +-from tests import have_root, is_redhat ++from tests import have_root, is_redhat, in_rh_ci + from ._util import LoopBackDevices, LvmLoopBacked + + ETC_FSTAB = "/etc/fstab" +@@ -587,6 +587,7 @@ class MountsTests(MountsTestsBase): + # 4. Check that the mount was still discovered (it's just a warning) + self.assertEqual(len(new_mounts._mounts), 1) + ++ @unittest.skipIf(in_rh_ci(), "Tests running in RH CI pipeline") + def test_discover_incomplete_api_mounts(self): + """ + Tests that discovery logs warnings for missing API mounts. +@@ -626,6 +627,7 @@ class MountsTestsExec(MountsTestsBase): + """ + need_exec = True + ++ @unittest.skipIf(in_rh_ci(), "Tests running in RH CI pipeline") + def test_mount_exec(self): + """ + Tests running a command chrooted inside a mounted snapshot set. +diff --git a/tests/test_plugin.py b/tests/test_plugin.py +index bd4fec08..7532a2fb 100644 +--- a/tests/test_plugin.py ++++ b/tests/test_plugin.py +@@ -14,7 +14,7 @@ log = logging.getLogger() + + import snapm.manager.plugins as plugins + +-from tests import MockPlugin ++from tests import MockPlugin, in_rh_ci + + + def _find_device_mounts(): +@@ -85,6 +85,7 @@ class PluginTests(unittest.TestCase): + for name, origin in snapshot_names.items(): + self.assertEqual(None, plugins.parse_snapshot_name(name, origin)) + ++ @unittest.skipIf(in_rh_ci(), "Tests running in RH CI pipeline") + def test_device_from_mount_point(self): + mounts = _find_device_mounts() + for mount in mounts: +-- +2.52.0 + diff --git a/SPECS/snapm.spec b/SPECS/snapm.spec index ed0d782..36647a4 100644 --- a/SPECS/snapm.spec +++ b/SPECS/snapm.spec @@ -1,13 +1,24 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + %global summary A set of tools for managing snapshots Name: snapm -Version: 0.4.3 -Release: 1%{?dist} +Version: 0.7.0 +Release: %autorelease Summary: %{summary} License: Apache-2.0 URL: https://github.com/snapshotmanager/%{name} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch1: 0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch BuildArch: noarch @@ -16,11 +27,16 @@ BuildRequires: lvm2 BuildRequires: make BuildRequires: stratis-cli BuildRequires: stratisd +BuildRequires: systemd-rpm-macros BuildRequires: python3-devel BuildRequires: python3-sphinx +%if 0%{?fedora} +BuildRequires: libfaketime +%endif Requires: python3-snapm = %{version}-%{release} Recommends: boom-boot +Recommends: python3-file-magic %package -n python3-snapm Summary: %{summary} @@ -65,8 +81,32 @@ rm -f doc/*.rst doc/Makefile doc/conf.py %install %pyproject_install -mkdir -p %{buildroot}/%{_mandir}/man8 -%{__install} -p -m 644 man/man8/snapm.8 %{buildroot}/%{_mandir}/man8 +mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/plugins.d +mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/schedule.d +%{__install} -p -m 644 etc/%{name}/snapm.conf ${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name} +%{__install} -p -m 644 etc/%{name}/plugins.d/lvm2-cow.conf ${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/plugins.d +%{__install} -p -m 644 etc/%{name}/plugins.d/lvm2-thin.conf ${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/plugins.d +%{__install} -p -m 644 etc/%{name}/plugins.d/stratis.conf ${RPM_BUILD_ROOT}/%{_sysconfdir}/%{name}/plugins.d + +mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man8 +mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man5 +%{__install} -p -m 644 man/man8/snapm.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8 +%{__install} -p -m 644 man/man5/snapm.conf.5 ${RPM_BUILD_ROOT}/%{_mandir}/man5 +%{__install} -p -m 644 man/man5/snapm-plugins.d.5 ${RPM_BUILD_ROOT}/%{_mandir}/man5 +%{__install} -p -m 644 man/man5/snapm-schedule.d.5 ${RPM_BUILD_ROOT}/%{_mandir}/man5 + +mkdir -p ${RPM_BUILD_ROOT}/%{_unitdir} +%{__install} -p -m 644 systemd/snapm-create@.service ${RPM_BUILD_ROOT}/%{_unitdir} +%{__install} -p -m 644 systemd/snapm-create@.timer ${RPM_BUILD_ROOT}/%{_unitdir} +%{__install} -p -m 644 systemd/snapm-gc@.service ${RPM_BUILD_ROOT}/%{_unitdir} +%{__install} -p -m 644 systemd/snapm-gc@.timer ${RPM_BUILD_ROOT}/%{_unitdir} + +mkdir -p ${RPM_BUILD_ROOT}/%{_tmpfilesdir} +%{__install} -p -m 644 systemd/tmpfiles.d/%{name}.conf ${RPM_BUILD_ROOT}/%{_tmpfilesdir}/ + +%{__install} -d -m 0700 ${RPM_BUILD_ROOT}/%{_rundir}/%{name} +%{__install} -d -m 0700 ${RPM_BUILD_ROOT}/%{_rundir}/%{name}/mounts +%{__install} -d -m 0700 ${RPM_BUILD_ROOT}/%{_rundir}/%{name}/lock %check %pytest --log-level=debug -v tests/ @@ -76,7 +116,18 @@ mkdir -p %{buildroot}/%{_mandir}/man8 %license LICENSE %doc README.md %{_bindir}/snapm -%doc %{_mandir}/man*/snapm.* +%doc %{_mandir}/man*/snapm* +%attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/snapm.conf +%attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/plugins.d/* +%dir %attr(755, -, -) %{_sysconfdir}/%{name}/schedule.d +%attr(644, -, -) %{_unitdir}/snapm-create@.service +%attr(644, -, -) %{_unitdir}/snapm-create@.timer +%attr(644, -, -) %{_unitdir}/snapm-gc@.service +%attr(644, -, -) %{_unitdir}/snapm-gc@.timer +%attr(644, -, -) %{_tmpfilesdir}/%{name}.conf +%dir %{_rundir}/%{name}/ +%dir %{_rundir}/%{name}/mounts +%dir %{_rundir}/%{name}/lock %files -n python3-snapm # license for snapm (Apache-2.0) @@ -92,15 +143,49 @@ mkdir -p %{buildroot}/%{_mandir}/man8 %doc doc %changelog +## START: Generated by rpmautospec +* Thu Jan 08 2026 Bryn M. Reeves - 0.7.0-2 +- Update the version test expectation. + +* Thu Jan 08 2026 Bryn M. Reeves - 0.7.0-1 +- Update to upstream 0.7.0 + +* Thu Nov 20 2025 Bryn M. Reeves - 0.5.2-3 +- schedule: fix TIMELINE policy retention indexing when keep_x > len(x) + +* Mon Nov 17 2025 Bryn M. Reeves - 0.5.2-2 +- Update expected string in TMT version test + +* Mon Nov 17 2025 Bryn M. Reeves - 0.5.2-1 +- Update to upstream 0.5.2 + +* Tue Nov 04 2025 Bryn M. Reeves - 0.5.1-2 +- Update TMT configuration + +* Tue Nov 04 2025 Bryn M. Reeves - 0.5.1-1 +- Update to upstream 0.5.1 + +* Mon May 12 2025 Bryn M. Reeves - 0.4.3-3 +- Bump tests/upstream/main.fmf duration to 30m + +* Mon May 12 2025 Bryn M. Reeves - 0.4.3-2 +- Update test path in main.fmf + * Mon May 12 2025 Bryn M. Reeves - 0.4.3-1 - Update to upstream 0.4.3 - Resolves: RHEL-89836 - Resolves: RHEL-78813 -* Thu Jan 09 2025 Bryn M. Reeves - 0.4.0-2 -- Bump release and rebuild - Resolves: RHEL-59005 +* Thu Jan 09 2025 Bryn M. Reeves - 0.4.0-5 +- Bump release and rebuild for c9s + +* Wed Jan 08 2025 Bryn M. Reeves - 0.4.0-4 +- Fix gating.yaml syntax + +* Fri Dec 20 2024 Bryn M. Reeves - 0.4.0-3 +- Initial gating tests for snapm + +* Fri Dec 20 2024 Bryn M. Reeves - 0.4.0-2 +- Backport test suite workaround for boom-boot #59 * Wed Dec 18 2024 Bryn M. Reeves - 0.4.0-1 - Initial commit on c9s - Resolves: RHEL-59005 +## END: Generated by rpmautospec