Skip to content

Commit 67ee867

Browse files
Improve rabbit_ssl:wrap_password_opt/1 tests
1 parent 9931386 commit 67ee867

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

deps/rabbit/test/unit_rabbit_ssl_SUITE.erl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ groups() ->
2727

2828
wrap_tls_opts_with_binary_password(_Config) ->
2929
Path = "/tmp/path/to/private_key.pem",
30+
Bin = <<"s3krE7">>,
3031
Opts0 = [
3132
{keyfile, Path},
32-
{password, <<"s3krE7">>}
33+
{password, Bin}
3334
],
3435

3536
Opts = rabbit_ssl:wrap_password_opt(Opts0),
@@ -38,11 +39,15 @@ wrap_tls_opts_with_binary_password(_Config) ->
3839
?assertEqual(Path, maps:get(keyfile, M)),
3940
?assert(is_function(maps:get(password, M))),
4041

42+
F = maps:get(password, M),
43+
?assertEqual(Bin, F()),
44+
4145
passed.
4246

4347
wrap_tls_opts_with_function_password(_Config) ->
4448
Path = "/tmp/path/to/private_key.pem",
45-
Fun = fun() -> <<"s3krE7">> end,
49+
Bin = <<"s3krE7">>,
50+
Fun = fun() -> Bin end,
4651
Opts0 = [
4752
{keyfile, Path},
4853
{password, Fun}
@@ -55,4 +60,7 @@ wrap_tls_opts_with_function_password(_Config) ->
5560
?assert(is_function(maps:get(password, M))),
5661
?assertEqual(Fun, maps:get(password, M)),
5762

63+
F = maps:get(password, M),
64+
?assertEqual(Bin, F()),
65+
5866
passed.

0 commit comments

Comments
 (0)