Skip to content

Commit 1de50cc

Browse files
authored
Fix additional x509 tests and test_suse tests for SLE12
1 parent cc4e56e commit 1de50cc

File tree

2 files changed

+90
-1
lines changed

2 files changed

+90
-1
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
From 43e05d3beea1d6e772fe88c051abf006c2a9bf90 Mon Sep 17 00:00:00 2001
2+
From: Marek Czernek <[email protected]>
3+
Date: Thu, 3 Oct 2024 13:08:16 +0200
4+
Subject: [PATCH] Fix x509 private key tests and test_suse on SLE12
5+
(#684)
6+
7+
---
8+
.../functional/modules/test_x509_v2.py | 12 +++++++++--
9+
.../functional/states/pkgrepo/test_suse.py | 20 +++++++++----------
10+
2 files changed, 20 insertions(+), 12 deletions(-)
11+
12+
diff --git a/tests/pytests/functional/modules/test_x509_v2.py b/tests/pytests/functional/modules/test_x509_v2.py
13+
index 7de8f3b01f..3db78c1b63 100644
14+
--- a/tests/pytests/functional/modules/test_x509_v2.py
15+
+++ b/tests/pytests/functional/modules/test_x509_v2.py
16+
@@ -1442,14 +1442,22 @@ def test_create_private_key_with_passphrase(x509, algo):
17+
18+
@pytest.mark.slow_test
19+
def test_create_private_key_der(x509):
20+
- res = x509.create_private_key(algo="ec", encoding="der")
21+
+ try:
22+
+ res = x509.create_private_key(algo="ec", encoding="der")
23+
+ except NotImplementedError:
24+
+ pytest.skip("Algorithm 'ec' is not supported on this OpenSSL version")
25+
assert base64.b64decode(res)
26+
27+
28+
@pytest.mark.slow_test
29+
@pytest.mark.parametrize("passphrase", [None, "hunter2"])
30+
def test_create_private_key_pkcs12(x509, passphrase):
31+
- res = x509.create_private_key(algo="ec", encoding="pkcs12", passphrase=passphrase)
32+
+ try:
33+
+ res = x509.create_private_key(
34+
+ algo="ec", encoding="pkcs12", passphrase=passphrase
35+
+ )
36+
+ except NotImplementedError:
37+
+ pytest.skip("Algorithm 'ec' is not supported on this OpenSSL version")
38+
assert base64.b64decode(res)
39+
40+
41+
diff --git a/tests/pytests/functional/states/pkgrepo/test_suse.py b/tests/pytests/functional/states/pkgrepo/test_suse.py
42+
index 3bafeedc94..d21a9aeb9d 100644
43+
--- a/tests/pytests/functional/states/pkgrepo/test_suse.py
44+
+++ b/tests/pytests/functional/states/pkgrepo/test_suse.py
45+
@@ -28,14 +28,14 @@ def suse_state_tree(grains, pkgrepo, state_tree):
46+
- comments:
47+
- '# Salt Test'
48+
- refresh: 1
49+
- {% if grains['osmajorrelease'] == 15 %}
50+
- - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/
51+
- - humanname: openSUSE Backports for SLE 15 SP4
52+
- - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
53+
- {% elif grains['osfullname'] == 'openSUSE Tumbleweed' %}
54+
+ {% if grains['osfullname'] == 'openSUSE Tumbleweed' %}
55+
- baseurl: http://download.opensuse.org/tumbleweed/repo/oss/
56+
- humanname: openSUSE Tumbleweed OSS
57+
- gpgkey: https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key
58+
+ {% else %}
59+
+ - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/
60+
+ - humanname: openSUSE Backports for SLE 15 SP4
61+
+ - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
62+
{% endif %}
63+
"""
64+
65+
@@ -53,14 +53,14 @@ def suse_state_tree(grains, pkgrepo, state_tree):
66+
- comments:
67+
- '# Salt Test (modified)'
68+
- refresh: 1
69+
- {% if grains['osmajorrelease'] == 15 %}
70+
- - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/
71+
- - humanname: Salt modified Backports
72+
- - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
73+
- {% elif grains['osfullname'] == 'openSUSE Tumbleweed' %}
74+
+ {% if grains['osfullname'] == 'openSUSE Tumbleweed' %}
75+
- baseurl: http://download.opensuse.org/tumbleweed/repo/oss/
76+
- humanname: Salt modified OSS
77+
- gpgkey: https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key
78+
+ {% else %}
79+
+ - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/
80+
+ - humanname: Salt modified Backports
81+
+ - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
82+
{% endif %}
83+
"""
84+
85+
--
86+
2.46.1
87+

salt/salt.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,10 @@ Patch140: revert-the-change-making-reactor-less-blocking-bsc-1.patch
446446
Patch141: allow-namedloadercontexts-to-be-returned-from-loader.patch
447447
# PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/commit/d54407ba6dc664e5e5f3f613e27ae24f828c9648
448448
Patch142: avoid-explicit-reading-of-etc-salt-minion-bsc-122035.patch
449-
# PATCH-FIX_UPSTREAM: https://github.com/openSUSE/salt/pull/682
449+
# PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/682
450450
Patch143: fix-x509-test-fails-on-old-openssl-systems-682.patch
451+
# PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/684
452+
Patch144: fix-x509-private-key-tests-and-test_suse-on-sle12-68.patch
451453

452454
### IMPORTANT: The line below is used as a snippet marker. Do not touch it.
453455
### SALT PATCHES LIST END

0 commit comments

Comments
 (0)