@@ -27,9 +27,10 @@ groups() ->
27
27
28
28
wrap_tls_opts_with_binary_password (_Config ) ->
29
29
Path = " /tmp/path/to/private_key.pem" ,
30
+ Bin = <<" s3krE7" >>,
30
31
Opts0 = [
31
32
{keyfile , Path },
32
- {password , << " s3krE7 " >> }
33
+ {password , Bin }
33
34
],
34
35
35
36
Opts = rabbit_ssl :wrap_password_opt (Opts0 ),
@@ -38,11 +39,15 @@ wrap_tls_opts_with_binary_password(_Config) ->
38
39
? assertEqual (Path , maps :get (keyfile , M )),
39
40
? assert (is_function (maps :get (password , M ))),
40
41
42
+ F = maps :get (password , M ),
43
+ ? assertEqual (Bin , F ()),
44
+
41
45
passed .
42
46
43
47
wrap_tls_opts_with_function_password (_Config ) ->
44
48
Path = " /tmp/path/to/private_key.pem" ,
45
- Fun = fun () -> <<" s3krE7" >> end ,
49
+ Bin = <<" s3krE7" >>,
50
+ Fun = fun () -> Bin end ,
46
51
Opts0 = [
47
52
{keyfile , Path },
48
53
{password , Fun }
@@ -55,4 +60,7 @@ wrap_tls_opts_with_function_password(_Config) ->
55
60
? assert (is_function (maps :get (password , M ))),
56
61
? assertEqual (Fun , maps :get (password , M )),
57
62
63
+ F = maps :get (password , M ),
64
+ ? assertEqual (Bin , F ()),
65
+
58
66
passed .
0 commit comments