Skip to content

Commit

Permalink
Merge pull request #3217 from esl/big_tests/remove-erlsh
Browse files Browse the repository at this point in the history
Remove erlsh frombig_tests
  • Loading branch information
NelsonVides authored Aug 12, 2021
2 parents 5739b9a + 4e71fde commit b2497b3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
1 change: 0 additions & 1 deletion big_tests/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
{lager, "3.9.2"},
{base16, "2.0.0"},
{bbmustache, "1.10.0"},
{erlsh, {git, "https://github.com/proger/erlsh.git", {ref, "4e8a107"}}},
{jiffy, "1.0.8"},
{proper, "1.4.0"},
{gun, "2.0.0-rc.2"},
Expand Down
4 changes: 0 additions & 4 deletions big_tests/rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
{pkg,<<"credentials_obfuscation">>,<<"2.4.0">>},
2},
{<<"csv">>,{pkg,<<"csve">>,<<"3.0.3">>},0},
{<<"erlsh">>,
{git,"https://github.com/proger/erlsh.git",
{ref,"4e8a107e4a082b5e687877cf08d152a45a715bf4"}},
0},
{<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.5">>},0},
{<<"esip">>,{pkg,<<"esip">>,<<"1.0.43">>},0},
{<<"exml">>,{pkg,<<"hexml">>,<<"3.0.5">>},1},
Expand Down
6 changes: 3 additions & 3 deletions big_tests/tests/connect_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,9 @@ ciphers_working_with_ssl_clients(Config) ->
openssl_client_can_use_cipher(Cipher, Port) ->
PortStr = integer_to_list(Port),
Cmd = "echo '' | openssl s_client -connect localhost:" ++ PortStr ++
" -cipher " "\"" ++ Cipher ++ "\" -tls1_2 2>&1",
{done, ReturnCode, _Result} = erlsh:oneliner(Cmd),
0 == ReturnCode.
" -cipher \"" ++ Cipher ++ "\" -tls1_2 2>&1",
Output = os:cmd(Cmd),
0 == string:str(Output, ":error:") andalso 0 == string:str(Output, "errno=0").

restore_c2s_listener(Config) ->
{_, _, Opts} = C2SListener = ?config(c2s_listener, Config),
Expand Down
20 changes: 9 additions & 11 deletions big_tests/tests/sasl_external_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -391,26 +391,24 @@ generate_cert(C, #{cn := User} = CertSpec) ->

generate_ca_signed_cert(C, User, UserConfig, UserKey ) ->
UserCsr = filename:join(?config(priv_dir, C), User ++ ".csr"),

Cmd = ["openssl", "req", "-config", UserConfig, "-newkey", "rsa:2048", "-sha256", "-nodes",
"-out", UserCsr, "-keyout", UserKey, "-outform", "PEM"],
{done, 0, _Output} = erlsh:run(Cmd),

Cmd = ["openssl req -config ", UserConfig, " -newkey rsa:2048 -sha256 -nodes -out ",
UserCsr, " -keyout ", UserKey, " -outform PEM"],
Out = os:cmd(Cmd),
UserCert = filename:join(?config(priv_dir, C), User ++ "_cert.pem"),
SignCmd = filename:join(?config(mim_data_dir, C), "sign_cert.sh"),
Cmd2 = [SignCmd, "--req", UserCsr, "--out", UserCert],
Cmd2 = [SignCmd, " --req ", UserCsr, " --out ", UserCert],
LogFile = filename:join(?config(priv_dir, C), User ++ "signing.log"),
SSLDir = filename:join([path_helper:repo_dir(C), "tools", "ssl"]),
{done, 0, _} = erlsh:run(Cmd2, LogFile, SSLDir),
OutLog = os:cmd("cd " ++ SSLDir ++ " && " ++ Cmd2),
[] = os:cmd("echo \"" ++ OutLog ++ "\" > " ++ LogFile),
#{key => UserKey,
cert => UserCert}.

generate_self_signed_cert(C, User, UserConfig, UserKey) ->
UserCert = filename:join(?config(priv_dir, C), User ++ "_self_signed_cert.pem"),

Cmd = ["openssl", "req", "-config", UserConfig, "-newkey", "rsa:2048", "-sha256", "-nodes",
"-out", UserCert, "-keyout", UserKey, "-x509", "-outform", "PEM", "-extensions", "client_req_extensions"],
{done, 0, _Output} = erlsh:run(Cmd),
Cmd = ["openssl req -config ", UserConfig, " -newkey rsa:2048 -sha256 -nodes -out ",
UserCert, " -keyout ", UserKey, " -x509 -outform PEM -extensions client_req_extensions"],
_ = os:cmd(Cmd),
#{key => UserKey,
cert => UserCert}.

Expand Down

0 comments on commit b2497b3

Please sign in to comment.