Skip to content

Commit

Permalink
Fix x509 private key tests and test_suse on SLE12 (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-czernek authored Oct 3, 2024
1 parent 7daf461 commit 43e05d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
12 changes: 10 additions & 2 deletions tests/pytests/functional/modules/test_x509_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,14 +1442,22 @@ def test_create_private_key_with_passphrase(x509, algo):

@pytest.mark.slow_test
def test_create_private_key_der(x509):
res = x509.create_private_key(algo="ec", encoding="der")
try:
res = x509.create_private_key(algo="ec", encoding="der")
except NotImplementedError:
pytest.skip("Algorithm 'ec' is not supported on this OpenSSL version")
assert base64.b64decode(res)


@pytest.mark.slow_test
@pytest.mark.parametrize("passphrase", [None, "hunter2"])
def test_create_private_key_pkcs12(x509, passphrase):
res = x509.create_private_key(algo="ec", encoding="pkcs12", passphrase=passphrase)
try:
res = x509.create_private_key(
algo="ec", encoding="pkcs12", passphrase=passphrase
)
except NotImplementedError:
pytest.skip("Algorithm 'ec' is not supported on this OpenSSL version")
assert base64.b64decode(res)


Expand Down
20 changes: 10 additions & 10 deletions tests/pytests/functional/states/pkgrepo/test_suse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,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-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
{% endif %}
"""

Expand All @@ -53,14 +53,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-SP4/standard/
- humanname: Salt modified Backports
- gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
{% endif %}
"""

Expand Down

0 comments on commit 43e05d3

Please sign in to comment.