From e07f0c2b8a09b3632229494b6b2e099524d8aa8f Mon Sep 17 00:00:00 2001 From: Marek Czernek Date: Tue, 8 Sep 2026 16:28:50 +0200 Subject: [PATCH 1/2] Fix repo URL that had expired gpg key Reordering of matching means all SUSE OSes get a default match repo match in SLS --- .../functional/states/pkgrepo/test_suse.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/pytests/functional/states/pkgrepo/test_suse.py b/tests/pytests/functional/states/pkgrepo/test_suse.py index 19ba928ce6ec..62b31356989c 100644 --- a/tests/pytests/functional/states/pkgrepo/test_suse.py +++ b/tests/pytests/functional/states/pkgrepo/test_suse.py @@ -26,14 +26,14 @@ def suse_state_tree(grains, pkgrepo, state_tree): - comments: - '# Salt Test' - refresh: 1 - {% if grains['osmajorrelease'] == 15 %} - - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/ - - humanname: openSUSE Backports for SLE 15 SP4 - - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key - {% elif grains['osfullname'] == 'openSUSE Tumbleweed' %} + {% if grains['osfullname'] == 'openSUSE Tumbleweed' %} - baseurl: http://download.opensuse.org/tumbleweed/repo/oss/ - humanname: openSUSE Tumbleweed OSS - gpgkey: https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key + {% else %} + - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP7/standard/ + - humanname: openSUSE Backports for SLE 15 SP7 + - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP7/standard/repodata/repomd.xml.key {% endif %} """ @@ -51,14 +51,14 @@ def suse_state_tree(grains, pkgrepo, state_tree): - comments: - '# Salt Test (modified)' - refresh: 1 - {% if grains['osmajorrelease'] == 15 %} - - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/ - - humanname: Salt modified Backports - - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key - {% elif grains['osfullname'] == 'openSUSE Tumbleweed' %} + {% if grains['osfullname'] == 'openSUSE Tumbleweed' %} - baseurl: http://download.opensuse.org/tumbleweed/repo/oss/ - humanname: Salt modified OSS - gpgkey: https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key + {% else %} + - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP7/standard/ + - humanname: Salt modified Backports + - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP7/standard/repodata/repomd.xml.key {% endif %} """ @@ -192,12 +192,12 @@ def _run(name, test=False): "comments": {"new": ["# Salt Test (modified)"], "old": None}, "refresh": {"new": 1, "old": None}, "gpgkey": { - "new": "https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key", + "new": "https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP7/standard/repodata/repomd.xml.key", "old": None, }, "name": { "new": "Salt modified Backports", - "old": "openSUSE Backports for SLE 15 SP4", + "old": "openSUSE Backports for SLE 15 SP7", }, } assert state.comment.startswith( @@ -213,7 +213,7 @@ def _run(name, test=False): assert state.changes == { "name": { "new": "Salt modified Backports", - "old": "openSUSE Backports for SLE 15 SP4", + "old": "openSUSE Backports for SLE 15 SP7", } } assert state.comment == "Configured package repo 'salttest'" From 06b2de865195839ba889c9f4d635a20cbf5aad6a Mon Sep 17 00:00:00 2001 From: Marek Czernek Date: Tue, 8 Sep 2026 16:29:07 +0200 Subject: [PATCH 2/2] Fix behavior on SUSE vs openSUSE systems Leap 15.6 uses $username(1000) as the default group, but SLE 15.6 uses users(100). SLE 16+ and Leap 16+ use `$username(1000)` only. --- tests/pytests/functional/states/test_user.py | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/pytests/functional/states/test_user.py b/tests/pytests/functional/states/test_user.py index a1d851e9d64c..2c60764ab0ed 100644 --- a/tests/pytests/functional/states/test_user.py +++ b/tests/pytests/functional/states/test_user.py @@ -144,8 +144,14 @@ def test_user_present_nondefault(grains, modules, states, username, user_home): if not salt.utils.platform.is_darwin() and not salt.utils.platform.is_windows(): assert user_home.is_dir() - if grains["os_family"] == "Suse" and not ( - grains.get("transactional", False) or grains.get("osmajorrelease", 0) >= 16 + if ( + grains["os_family"] == "Suse" + and not grains.get("transactional", False) + and grains.get("osmajorrelease", 0) < 16 + and ( + grains.get("osrelease_info", ()) < (15, 6) + or grains.get("osfullname", "") == "SLES" + ) ): expected_group_name = "users" elif grains["os_family"] == "MacOS": @@ -415,7 +421,12 @@ def test_user_present_change_groups( ): expected_groups = [group_2.name, group_1.name] if grains["os_family"] == "Suse" and ( - grains.get("transactional", False) or grains.get("osmajorrelease", 0) >= 16 + grains.get("transactional", False) + or grains.get("osmajorrelease", 0) >= 16 + or ( + grains.get("osrelease_info", ()) >= (15, 6) + and grains.get("osfullname", "") != "SLES" + ) ): expected_groups.append(username) @@ -449,7 +460,12 @@ def test_user_present_change_optional_groups( ): expected_groups = [group_2.name, group_1.name] if grains["os_family"] == "Suse" and ( - grains.get("transactional", False) or grains.get("osmajorrelease", 0) >= 16 + grains.get("transactional", False) + or grains.get("osmajorrelease", 0) >= 16 + or ( + grains.get("osrelease_info", ()) >= (15, 6) + and grains.get("osfullname", "") != "SLES" + ) ): expected_groups.append(username)