Maybe fix TLS tests

This commit is contained in:
Alexey Milovidov 2023-07-31 07:26:36 +02:00
parent d243602e74
commit efad90d0f2
2 changed files with 6 additions and 6 deletions

View File

@ -208,7 +208,7 @@ def test_https_wrong_cert():
with pytest.raises(Exception) as err:
execute_query_https("SELECT currentUser()", user="john", cert_name="wrong")
err_str = str(err.value)
if count < MAX_RETRY and "Broken pipe" in err_str:
if count < MAX_RETRY and (("Broken pipe" in err_str) or ("EOF occurred" in err_str)):
count = count + 1
logging.warning(f"Failed attempt with wrong cert, err: {err_str}")
continue
@ -314,7 +314,7 @@ def test_https_non_ssl_auth():
cert_name="wrong",
)
err_str = str(err.value)
if count < MAX_RETRY and "Broken pipe" in err_str:
if count < MAX_RETRY and (("Broken pipe" in err_str) or ("EOF occurred" in err_str)):
count = count + 1
logging.warning(
f"Failed attempt with wrong cert, user: peter, err: {err_str}"
@ -334,7 +334,7 @@ def test_https_non_ssl_auth():
cert_name="wrong",
)
err_str = str(err.value)
if count < MAX_RETRY and "Broken pipe" in err_str:
if count < MAX_RETRY and (("Broken pipe" in err_str) or ("EOF occurred" in err_str)):
count = count + 1
logging.warning(
f"Failed attempt with wrong cert, user: jane, err: {err_str}"

View File

@ -96,7 +96,7 @@ def test_https_wrong_cert():
with pytest.raises(Exception) as err:
execute_query_https("SELECT currentUser()", user="john", cert_name="wrong")
err_str = str(err.value)
if count < MAX_RETRY and "Broken pipe" in err_str:
if count < MAX_RETRY and (("Broken pipe" in err_str) or ("EOF occurred" in err_str)):
count = count + 1
logging.warning(f"Failed attempt with wrong cert, err: {err_str}")
continue
@ -202,7 +202,7 @@ def test_https_non_ssl_auth():
cert_name="wrong",
)
err_str = str(err.value)
if count < MAX_RETRY and "Broken pipe" in err_str:
if count < MAX_RETRY and (("Broken pipe" in err_str) or ("EOF occurred" in err_str)):
count = count + 1
logging.warning(
f"Failed attempt with wrong cert, user: peter, err: {err_str}"
@ -222,7 +222,7 @@ def test_https_non_ssl_auth():
cert_name="wrong",
)
err_str = str(err.value)
if count < MAX_RETRY and "Broken pipe" in err_str:
if count < MAX_RETRY and (("Broken pipe" in err_str) or ("EOF occurred" in err_str)):
count = count + 1
logging.warning(
f"Failed attempt with wrong cert, user: jane, err: {err_str}"