Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package salt for openSUSE:Factory checked in at 2026-04-18 21:34:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/salt (Old) and /work/SRC/openSUSE:Factory/.salt.new.11940 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "salt" Sat Apr 18 21:34:00 2026 rev:193 rq:1347248 version:3006.0 Changes: -------- --- /work/SRC/openSUSE:Factory/salt/salt.changes 2026-03-18 16:49:42.619030984 +0100 +++ /work/SRC/openSUSE:Factory/.salt.new.11940/salt.changes 2026-04-18 21:34:01.307811896 +0200 @@ -1,0 +2,8 @@ +Tue Apr 14 14:48:40 UTC 2026 - Marek Czernek <[email protected]> + +- Fix testsuite failures + +- Added: + * fix-test-failures-754.patch + +------------------------------------------------------------------- New: ---- fix-test-failures-754.patch ----------(New B)---------- New:- Added: * fix-test-failures-754.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ salt.spec ++++++ --- /var/tmp/diff_new_pack.Byvmqn/_old 2026-04-18 21:34:05.495982063 +0200 +++ /var/tmp/diff_new_pack.Byvmqn/_new 2026-04-18 21:34:05.499982226 +0200 @@ -626,6 +626,13 @@ # PATCH-FIX_UPSTREAM: https://github.com/tornadoweb/tornado/pull/3584 # PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/750 Patch200: backport-of-the-cve-2026-31958-fix-bsc-1259554.patch +# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/commit/919994f2b0ce50d5ce89a36e9273fc61013ccc8d +# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/commit/7835f3acb1179bbe00e8af28a7f3af67fa30afab +# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/commit/6dc6cc3b595de454e68e413308c9875151108d67 +# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/commit/1d4f9dcc40f1845b3fa942794177a671df03f90e +# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/pull/68928 +# PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/754 +Patch201: fix-test-failures-754.patch ### IMPORTANT: The line below is used as a snippet marker. Do not touch it. ### SALT PATCHES LIST END ++++++ _lastrevision ++++++ --- /var/tmp/diff_new_pack.Byvmqn/_old 2026-04-18 21:34:05.623987264 +0200 +++ /var/tmp/diff_new_pack.Byvmqn/_new 2026-04-18 21:34:05.627987427 +0200 @@ -1,3 +1,3 @@ -2bafa6ca6d63750ac4a2bfd25fb28d1e52e989b7 +8b6e8757be49c548a84a0245e1bd8e90b1f966ba (No newline at EOF) ++++++ fix-test-failures-754.patch ++++++ >From 9cbec0c2c88bf955bf06236228d0cfb0448c848a Mon Sep 17 00:00:00 2001 From: Marek Czernek <[email protected]> Date: Tue, 14 Apr 2026 08:43:21 +0200 Subject: [PATCH] Fix test failures (#754) * Fix test failures salt/states/pkgrepo.py: - https://github.com/saltstack/salt/commit/919994f2b0ce50d5ce89a36e9273fc61013ccc8d tests/pytests/functional/modules/test_pkg.py: - https://github.com/saltstack/salt/commit/7835f3acb1179bbe00e8af28a7f3af67fa30afab - https://github.com/saltstack/salt/commit/6dc6cc3b595de454e68e413308c9875151108d67 tests/integration/modules/test_gem.py: - Started failing because after several years, brass released a new version - https://github.com/saltstack/salt/commit/1d4f9dcc40f1845b3fa942794177a671df03f90e tests/pytests/unit/modules/test_aptpkg.py: - Was broken after our latest code upgrade * Fix reap_stray_processes fixture error - https://github.com/saltstack/salt/pull/68928 --- salt/states/pkgrepo.py | 4 +-- tests/conftest.py | 14 +++++---- tests/integration/modules/test_gem.py | 30 ++++++++++++++++++-- tests/pytests/functional/modules/test_pkg.py | 11 +++---- tests/pytests/unit/modules/test_aptpkg.py | 28 +++++++++--------- 5 files changed, 59 insertions(+), 28 deletions(-) diff --git a/salt/states/pkgrepo.py b/salt/states/pkgrepo.py index cbaf5ef4938..fc7b9126446 100644 --- a/salt/states/pkgrepo.py +++ b/salt/states/pkgrepo.py @@ -740,9 +740,9 @@ def absent(name, **kwargs): # architectures of the matched repo to the architectures specified in # the repo string passed to this state. If the architectures do not # match, then invalidate the match by setting repo to an empty dict. - import salt.modules.aptpkg + from salt.modules.aptpkg import _split_repo_str - if set(salt.modules.aptpkg._split_repo_str(stripname)["architectures"]) != set( + if set(_split_repo_str(stripname)["architectures"]) != set( repo["architectures"] ): repo = {} diff --git a/tests/conftest.py b/tests/conftest.py index 436d5a8a126..a931617b7cf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1717,11 +1717,15 @@ def reap_stray_processes(): if alive: # Give up for child in alive: - log.warning( - "Process %s survived SIGKILL, giving up:\n%s", - child, - pprint.pformat(child.as_dict()), - ) + try: + log.warning( + "Process %s survived SIGKILL, giving up:\n%s", + child, + pprint.pformat(child.as_dict()), + ) + except psutil.NoSuchProcess: + # Process killed between the alive check and the log statement + continue @pytest.fixture(scope="session") diff --git a/tests/integration/modules/test_gem.py b/tests/integration/modules/test_gem.py index 7c988800018..9d318bf648b 100644 --- a/tests/integration/modules/test_gem.py +++ b/tests/integration/modules/test_gem.py @@ -2,6 +2,7 @@ Integration tests for Ruby Gem module """ +import subprocess import pytest from tornado.httpclient import HTTPClient @@ -79,11 +80,22 @@ class GemModuleTest(ModuleCase): self.run_function("gem.uninstall", [self.GEM]) self.assertFalse(self.run_function("gem.list", [self.GEM])) + def _get_ruby_version(self): + try: + output = subprocess.check_output(["ruby", "-v"]).decode("utf-8") + version_str = output.split()[1] + major_version = int(version_str.split('.')[0]) + return major_version + except (IndexError, subprocess.CalledProcessError, FileNotFoundError): + return 0 + @pytest.mark.slow_test def test_list(self): """ gem.list """ + if self._get_ruby_version() < 3: + self.skipTest("Cannot install brass, skipping") self.run_function("gem.install", [" ".join(self.GEM_LIST)]) all_ret = self.run_function("gem.list") @@ -135,7 +147,21 @@ class GemModuleTest(ModuleCase): self.run_function("gem.update", [self.OLD_GEM]) gem_list = self.run_function("gem.list", [self.OLD_GEM]) - self.assertEqual({self.OLD_GEM: [self.NEW_VERSION, self.OLD_VERSION]}, gem_list) + installed_versions = gem_list.get(self.OLD_GEM, []) + + if installed_versions == [self.OLD_VERSION]: + # gem update may be unable to install a newer version when the + # only available release requires a Ruby version not present on + # this system (e.g. brass >= 1.3.0 requires Ruby >= 3.1). + self.skipTest( + "gem update did not install a newer version of {}; the " + "latest release may require a newer Ruby version".format(self.OLD_GEM) + ) + + self.assertEqual( + {self.OLD_GEM: [self.NEW_VERSION, self.OLD_VERSION]}, + gem_list, + ) self.run_function("gem.uninstall", [self.OLD_GEM]) self.assertFalse(self.run_function("gem.list", [self.OLD_GEM])) @@ -146,4 +172,4 @@ class GemModuleTest(ModuleCase): gem.update_system """ ret = self.run_function("gem.update_system") - self.assertTrue(ret) + self.assertTrue(ret) \ No newline at end of file diff --git a/tests/pytests/functional/modules/test_pkg.py b/tests/pytests/functional/modules/test_pkg.py index bd9a2093cbd..84e999cad81 100644 --- a/tests/pytests/functional/modules/test_pkg.py +++ b/tests/pytests/functional/modules/test_pkg.py @@ -223,11 +223,12 @@ def test_which(grains, modules): """ test finding the package owning a file """ - if grains["os_family"] in ["Debian", "RedHat"]: - file = "/bin/mknod" - else: - file = "/usr/local/bin/salt-call" - ret = modules.pkg.which(file) + binary = "/bin/ls" + if grains["os"] == "Ubuntu" and grains["osmajorrelease"] >= 24: + binary = "/usr/bin/ls" + elif grains["os"] == "Debian" and grains["osmajorrelease"] >= 13: + binary = "/usr/bin/ls" + ret = modules.pkg.which(binary) assert len(ret) != 0 diff --git a/tests/pytests/unit/modules/test_aptpkg.py b/tests/pytests/unit/modules/test_aptpkg.py index 2e2b73b8560..af3d335ded5 100644 --- a/tests/pytests/unit/modules/test_aptpkg.py +++ b/tests/pytests/unit/modules/test_aptpkg.py @@ -16,7 +16,6 @@ import pytest import salt.modules.aptpkg as aptpkg import salt.modules.pkg_resource as pkg_resource -import salt.utils.path from salt.exceptions import ( CommandExecutionError, CommandNotFoundError, @@ -1497,7 +1496,7 @@ def test_sourceslist_multiple_comps(): """ repo_line = "deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted" with patch("salt.utils.files.fopen", mock_open(read_data=repo_line)), patch( - "pathlib.Path.is_file", side_effect=[True, False] + "os.path.isdir", MagicMock(return_value=False) ): sources = aptpkg.SourcesList() for source in sources: @@ -1523,15 +1522,16 @@ def test_sourceslist_architectures(repo_line): """ Test SourcesList when architectures is in repo """ - with patch("salt.utils.files.fopen", mock_open(read_data=repo_line)): - with patch("pathlib.Path.is_file", side_effect=[True, False]): - sources = aptpkg.SourcesList() - for source in sources: - assert source.type == "deb" - assert source.uri == "http://archive.ubuntu.com/ubuntu/" - assert source.comps == ["main", "restricted"] - assert source.dist == "focal-updates" - if "," in repo_line: - assert source.architectures == ["amd64", "armel"] - else: - assert source.architectures == ["amd64"] + with patch("salt.utils.files.fopen", mock_open(read_data=repo_line)), patch( + "os.path.isdir", MagicMock(return_value=False) + ): + sources = aptpkg.SourcesList() + for source in sources: + assert source.type == "deb" + assert source.uri == "http://archive.ubuntu.com/ubuntu/" + assert source.comps == ["main", "restricted"] + assert source.dist == "focal-updates" + if "," in repo_line: + assert source.architectures == ["amd64", "armel"] + else: + assert source.architectures == ["amd64"] -- 2.53.0
