Skip to content

Commit

Permalink
Issue 6193 - Test failure: test_tls_command_returns_error_text
Browse files Browse the repository at this point in the history
Bug Description:
openssl changed error message in
openssl/openssl@fedab10

Fix Description:
Adjust assert to use regex for different messages.

Fixes: 389ds#6193

Reviewed by: @progier389 (Thanks!)
  • Loading branch information
vashirov committed May 31, 2024
1 parent 47c0bc3 commit 1b26ed9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dirsrvtests/tests/suites/clu/dsctl_tls_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pytest
import ssl
import os
import re
from lib389.topologies import topology_st as topo
from lib389.nss_ssl import NssSsl

Expand Down Expand Up @@ -79,9 +80,10 @@ def test_tls_command_returns_error_text(topo):
except ValueError as e:
assert '255' not in str(e)
if 'OpenSSL 3' in ssl.OPENSSL_VERSION:
assert 'Could not read private key from' in str(e)
error_message = r"Could not (read|find) private key from"
else:
assert 'unable to load private key' in str(e)
error_message = r"unable to load private key"
assert re.search(error_message, str(e))


if __name__ == '__main__':
Expand Down

0 comments on commit 1b26ed9

Please sign in to comment.