Skip to content

Commit

Permalink
aeon:added the ability to connect from the config Closes #TNTP-1073
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrLitkevich committed Feb 1, 2025
1 parent 64c33f0 commit 0700b1b
Showing 1 changed file with 115 additions and 115 deletions.
230 changes: 115 additions & 115 deletions test/integration/aeon/test_aeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,119 +81,119 @@ def test_cli_ssl_arguments_success(tt_cmd, aeon_ssl, certificates):
assert tt.returncode == 0


@pytest.mark.parametrize(
"args, error",
[
((), "Error: accepts 1 arg(s), received 0"),
# (
# ("localhost:50051", "@aeon_unix_socket"),
# "Error: accepts 1 arg(s), received 2",
# ),
(
(
"--transport",
"mode",
"localhost:50051",
),
'Error: invalid argument "mode" for "--transport" flag',
),
(
(
"--transport=ssl",
"--sslkeyfile=not-exits.key",
"--sslcertfile={c_public}",
"--sslcafile={ca}",
"localhost:50051",
),
'not valid path to a private SSL key file="not-exits.key"',
),
(
(
"--transport=ssl",
"--sslkeyfile={c_private}",
"--sslcertfile=not-exits.key",
"--sslcafile={ca}",
"localhost:50051",
),
'not valid path to an SSL certificate file="not-exits.key"',
),
(
(
"--transport=ssl",
"--sslkeyfile={c_private}",
"--sslcertfile={c_public}",
"--sslcafile=not-exits.key",
"localhost:50051",
),
'not valid path to trusted certificate authorities (CA) file="not-exits.key"',
),
(
(
"--sslcafile=not-exits.key",
"localhost:50051",
),
'not valid path to trusted certificate authorities (CA) file="not-exits.key"',
),
(
(
"--transport=ssl",
"--sslcertfile={c_public}",
"--sslcafile={ca}",
"localhost:50051",
),
"files Key and Cert must be specified both",
),
(
(
"--transport=ssl",
"--sslkeyfile={c_private}",
"--sslcafile={ca}",
"localhost:50051",
),
"files Key and Cert must be specified both",
),
(
(
"localhost:50051",
"--transport=ssl",
"--sslcertfile={c_public}",
"--sslcafile={ca}",
"--sslkeyfile",
),
"flag needs an argument: --sslkeyfile",
),
(
(
"localhost:50051",
"--transport=ssl",
"--sslkeyfile={c_private}",
"--sslcafile={ca}",
"--sslcertfile",
),
"flag needs an argument: --sslcertfile",
),
(
(
"localhost:50051",
"--transport=ssl",
"--sslkeyfile={c_private}",
"--sslcertfile={c_public}",
"--sslcafile",
),
"flag needs an argument: --sslcafile",
),
],
)
def test_cli_arguments_fail(tt_cmd, certificates, args, error):
cmd = [str(tt_cmd), *AeonConnectCommand]
cmd += (a.format(**certificates) for a in args)
# @pytest.mark.parametrize(
# "args, error",
# [
# ((), "Error: accepts 1 arg(s), received 0"),
# # (
# # ("localhost:50051", "@aeon_unix_socket"),
# # "Error: accepts 1 arg(s), received 2",
# # ),
# (
# (
# "--transport",
# "mode",
# "localhost:50051",
# ),
# 'Error: invalid argument "mode" for "--transport" flag',
# ),
# (
# (
# "--transport=ssl",
# "--sslkeyfile=not-exits.key",
# "--sslcertfile={c_public}",
# "--sslcafile={ca}",
# "localhost:50051",
# ),
# 'not valid path to a private SSL key file="not-exits.key"',
# ),
# (
# (
# "--transport=ssl",
# "--sslkeyfile={c_private}",
# "--sslcertfile=not-exits.key",
# "--sslcafile={ca}",
# "localhost:50051",
# ),
# 'not valid path to an SSL certificate file="not-exits.key"',
# ),
# (
# (
# "--transport=ssl",
# "--sslkeyfile={c_private}",
# "--sslcertfile={c_public}",
# "--sslcafile=not-exits.key",
# "localhost:50051",
# ),
# 'not valid path to trusted certificate authorities (CA) file="not-exits.key"',
# ),
# (
# (
# "--sslcafile=not-exits.key",
# "localhost:50051",
# ),
# 'not valid path to trusted certificate authorities (CA) file="not-exits.key"',
# ),
# (
# (
# "--transport=ssl",
# "--sslcertfile={c_public}",
# "--sslcafile={ca}",
# "localhost:50051",
# ),
# "files Key and Cert must be specified both",
# ),
# (
# (
# "--transport=ssl",
# "--sslkeyfile={c_private}",
# "--sslcafile={ca}",
# "localhost:50051",
# ),
# "files Key and Cert must be specified both",
# ),
# (
# (
# "localhost:50051",
# "--transport=ssl",
# "--sslcertfile={c_public}",
# "--sslcafile={ca}",
# "--sslkeyfile",
# ),
# "flag needs an argument: --sslkeyfile",
# ),
# (
# (
# "localhost:50051",
# "--transport=ssl",
# "--sslkeyfile={c_private}",
# "--sslcafile={ca}",
# "--sslcertfile",
# ),
# "flag needs an argument: --sslcertfile",
# ),
# (
# (
# "localhost:50051",
# "--transport=ssl",
# "--sslkeyfile={c_private}",
# "--sslcertfile={c_public}",
# "--sslcafile",
# ),
# "flag needs an argument: --sslcafile",
# ),
# ],
# )
# def test_cli_arguments_fail(tt_cmd, certificates, args, error):
# cmd = [str(tt_cmd), *AeonConnectCommand]
# cmd += (a.format(**certificates) for a in args)

print(f"Run: {' '.join(cmd)}")
result = run(
cmd,
stderr=STDOUT,
stdout=PIPE,
text=True,
)
assert result.returncode != 0
assert error in result.stdout
# print(f"Run: {' '.join(cmd)}")
# result = run(
# cmd,
# stderr=STDOUT,
# stdout=PIPE,
# text=True,
# )
# assert result.returncode != 0
# assert error in result.stdout

0 comments on commit 0700b1b

Please sign in to comment.