Remove tests

This commit is contained in:
János Benjamin Antal 2023-09-21 08:19:09 +00:00
parent 036aa9f756
commit 6d254aa557
2 changed files with 8 additions and 114 deletions

View File

@ -206,20 +206,8 @@ def test_https_wrong_cert():
execute_query_https("SELECT currentUser()", user="john", cert_name="client2") execute_query_https("SELECT currentUser()", user="john", cert_name="client2")
assert "403" in str(err.value) assert "403" in str(err.value)
count = 0 # TODO: Add non-flaky tests for:
# Wrong certificate: self-signed certificate. # - Wrong certificate: self-signed certificate.
while count <= MAX_RETRY:
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) or ("EOF occurred" in err_str)
):
count = count + 1
logging.warning(f"Failed attempt with wrong cert, err: {err_str}")
continue
assert "unknown ca" in err_str
break
# No certificate. # No certificate.
with pytest.raises(Exception) as err: with pytest.raises(Exception) as err:
@ -309,49 +297,8 @@ def test_https_non_ssl_auth():
== "jane\n" == "jane\n"
) )
count = 0 # TODO: Add non-flaky tests for:
# However if we send a certificate it must not be wrong. # - sending wrong cert
while count <= MAX_RETRY:
with pytest.raises(Exception) as err:
execute_query_https(
"SELECT currentUser()",
user="peter",
enable_ssl_auth=False,
cert_name="wrong",
)
err_str = str(err.value)
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}"
)
continue
assert "unknown ca" in err_str
break
count = 0
while count <= MAX_RETRY:
with pytest.raises(Exception) as err:
execute_query_https(
"SELECT currentUser()",
user="jane",
enable_ssl_auth=False,
password="qwe123",
cert_name="wrong",
)
err_str = str(err.value)
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}"
)
continue
assert "unknown ca" in err_str
break
def test_create_user(): def test_create_user():

View File

@ -90,20 +90,8 @@ def test_https_wrong_cert():
execute_query_https("SELECT currentUser()", user="john", cert_name="client2") execute_query_https("SELECT currentUser()", user="john", cert_name="client2")
assert "HTTP Error 403" in str(err.value) assert "HTTP Error 403" in str(err.value)
count = 0 # TODO: Add non-flaky tests for:
# Wrong certificate: self-signed certificate. # - Wrong certificate: self-signed certificate.
while count <= MAX_RETRY:
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) or ("EOF occurred" in err_str)
):
count = count + 1
logging.warning(f"Failed attempt with wrong cert, err: {err_str}")
continue
assert "unknown ca" in err_str
break
# No certificate. # No certificate.
with pytest.raises(Exception) as err: with pytest.raises(Exception) as err:
@ -193,49 +181,8 @@ def test_https_non_ssl_auth():
== "jane\n" == "jane\n"
) )
count = 0 # TODO: Add non-flaky tests for:
# However if we send a certificate it must not be wrong. # - sending wrong cert
while count <= MAX_RETRY:
with pytest.raises(Exception) as err:
execute_query_https(
"SELECT currentUser()",
user="peter",
enable_ssl_auth=False,
cert_name="wrong",
)
err_str = str(err.value)
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}"
)
continue
assert "unknown ca" in err_str
break
count = 0
while count <= MAX_RETRY:
with pytest.raises(Exception) as err:
execute_query_https(
"SELECT currentUser()",
user="jane",
enable_ssl_auth=False,
password="qwe123",
cert_name="wrong",
)
err_str = str(err.value)
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}"
)
continue
assert "unknown ca" in err_str
break
def test_create_user(): def test_create_user():