Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d1865620c | ||
|
|
1bf5ff4739 | ||
|
|
fed5ae3ccd | ||
|
|
138e85b1f5 | ||
|
|
306b87c104 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
/snapm-0.4.0.tar.gz
|
/snapm-0.4.0.tar.gz
|
||||||
/snapm-0.4.3.tar.gz
|
/snapm-0.4.3.tar.gz
|
||||||
/snapm-0.5.1.tar.gz
|
/snapm-0.5.1.tar.gz
|
||||||
|
/snapm-0.5.2.tar.gz
|
||||||
|
/snapm-0.7.0.tar.gz
|
||||||
|
|||||||
112
0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch
Normal file
112
0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
From 5d363f97d4ccea2a53c7da48ff9f18a3dd9da274 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Bryn M. Reeves" <bmr@redhat.com>
|
||||||
|
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 <bmr@redhat.com>
|
||||||
|
---
|
||||||
|
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
|
||||||
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
From a25c448e741870d8baaff2d32e7afb47fc031857 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
||||||
Date: Wed, 5 Nov 2025 11:16:23 +0000
|
|
||||||
Subject: [PATCH] tests: skip test_create_snapshot_set_no_provider if
|
|
||||||
!ismount("/boot")
|
|
||||||
|
|
||||||
Resolves: #588
|
|
||||||
|
|
||||||
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
||||||
---
|
|
||||||
tests/test_manager.py | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/tests/test_manager.py b/tests/test_manager.py
|
|
||||||
index 62c0603..5dc8ea4 100644
|
|
||||||
--- a/tests/test_manager.py
|
|
||||||
+++ b/tests/test_manager.py
|
|
||||||
@@ -8,6 +8,7 @@
|
|
||||||
import unittest
|
|
||||||
import logging
|
|
||||||
import os
|
|
||||||
+import os.path
|
|
||||||
from uuid import UUID
|
|
||||||
from json import loads
|
|
||||||
import tempfile
|
|
||||||
@@ -506,6 +507,7 @@ class ManagerTests(unittest.TestCase):
|
|
||||||
with self.assertRaises(snapm.SnapmPathError) as cm:
|
|
||||||
self.manager.create_snapshot_set("testset0", [non_mount])
|
|
||||||
|
|
||||||
+ @unittest.skipIf(not os.path.ismount("/boot"), "no suitable mount path")
|
|
||||||
def test_create_snapshot_set_no_provider(self):
|
|
||||||
with self.assertRaises(snapm.SnapmNoProviderError):
|
|
||||||
self.manager.create_snapshot_set("testset0", ["/boot"])
|
|
||||||
--
|
|
||||||
2.51.0
|
|
||||||
|
|
||||||
@ -1,14 +1,14 @@
|
|||||||
%global summary A set of tools for managing snapshots
|
%global summary A set of tools for managing snapshots
|
||||||
|
|
||||||
Name: snapm
|
Name: snapm
|
||||||
Version: 0.5.1
|
Version: 0.7.0
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
|
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/snapshotmanager/%{name}
|
URL: https://github.com/snapshotmanager/%{name}
|
||||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
Patch1: 0001-tests-skip-test_create_snapshot_set_no_provider-if-i.patch
|
Patch1: 0001-tests-skip-a-handful-of-tests-in-RH-CI-environments-.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -26,6 +26,7 @@ BuildRequires: libfaketime
|
|||||||
|
|
||||||
Requires: python3-snapm = %{version}-%{release}
|
Requires: python3-snapm = %{version}-%{release}
|
||||||
Recommends: boom-boot
|
Recommends: boom-boot
|
||||||
|
Recommends: python3-file-magic
|
||||||
|
|
||||||
%package -n python3-snapm
|
%package -n python3-snapm
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
|
|||||||
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (snapm-0.5.1.tar.gz) = 30bec3d65c24732ad88ddc04ead12b2fafc96ca2e740283bae02b1214bd77f4d108cf1c597aaf27a487eec334243afac83b6ff8202adfe5224694302f40d7a99
|
SHA512 (snapm-0.7.0.tar.gz) = 13f88538070690bd4a051968f6a23abfc65c5bc5e30ed9fc75dd9cf0518c295099e237b66d704a560df5e9fb8ef5fd544ab72bd302f296be7d077feb78480368
|
||||||
|
|||||||
@ -22,4 +22,4 @@ systemctl daemon-reload
|
|||||||
systemd-tmpfiles --create /usr/lib/tmpfiles.d/snapm.conf
|
systemd-tmpfiles --create /usr/lib/tmpfiles.d/snapm.conf
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
sudo pytest -v --log-level=debug tests/
|
sudo IN_RH_CI=yes pytest -v --log-level=debug tests/
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
tmp=$(mktemp)
|
tmp=$(mktemp)
|
||||||
snapm --version > "$tmp"
|
snapm --version > "$tmp"
|
||||||
grep '0.5.1' "$tmp"
|
grep '0.7.0' "$tmp"
|
||||||
rm "$tmp"
|
rm "$tmp"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user