|
12 | 12 | -include_lib("exml/include/exml_stream.hrl").
|
13 | 13 | -include_lib("eunit/include/eunit.hrl").
|
14 | 14 |
|
| 15 | +-include_lib("kernel/include/logger.hrl"). |
| 16 | + |
15 | 17 | -import(distributed_helper, [mim/0, rpc_spec/1, rpc/4]).
|
16 | 18 | -import(domain_helper, [host_type/0]).
|
17 | 19 |
|
|
23 | 25 |
|
24 | 26 | all() ->
|
25 | 27 | [
|
26 |
| - {group, both_plain}, |
27 |
| - {group, both_tls_optional}, %% default MongooseIM config |
28 |
| - {group, both_tls_required}, |
29 |
| - {group, both_tls_enforced}, |
| 28 | + {group, both_plain} |
| 29 | + % {group, both_tls_optional}, %% default MongooseIM config |
| 30 | + % {group, both_tls_required}, |
| 31 | + % {group, both_tls_enforced}, |
30 | 32 |
|
31 |
| - {group, node1_tls_optional_node2_tls_required}, |
32 |
| - {group, node1_tls_required_node2_tls_optional}, |
| 33 | + % {group, node1_tls_optional_node2_tls_required}, |
| 34 | + % {group, node1_tls_required_node2_tls_optional}, |
33 | 35 |
|
34 |
| - {group, node1_tls_required_trusted_node2_tls_optional}, |
35 |
| - {group, node1_tls_optional_node2_tls_required_trusted_with_cachain}, |
| 36 | + % {group, node1_tls_required_trusted_node2_tls_optional}, |
| 37 | + % {group, node1_tls_optional_node2_tls_required_trusted_with_cachain}, |
36 | 38 |
|
37 |
| - {group, node1_tls_false_node2_tls_required}, |
38 |
| - {group, node1_tls_required_node2_tls_false}, |
| 39 | + % {group, node1_tls_false_node2_tls_required}, |
| 40 | + % {group, node1_tls_required_node2_tls_false}, |
39 | 41 |
|
40 |
| - {group, dialback} |
| 42 | + % {group, dialback} |
41 | 43 | ].
|
42 | 44 |
|
43 | 45 | groups() ->
|
44 |
| - [{both_plain, [], all_tests()}, |
45 |
| - {both_tls_optional, [], essentials()}, |
46 |
| - {both_tls_required, [], essentials()}, |
47 |
| - {both_tls_enforced, [], essentials()}, |
| 46 | + [{both_plain, [], all_tests()} |
| 47 | + % {both_tls_optional, [], essentials()}, |
| 48 | + % {both_tls_required, [], essentials()}, |
| 49 | + % {both_tls_enforced, [], essentials()}, |
48 | 50 |
|
49 |
| - {node1_tls_optional_node2_tls_required, [], essentials()}, |
50 |
| - {node1_tls_required_node2_tls_optional, [], essentials()}, |
| 51 | + % {node1_tls_optional_node2_tls_required, [], essentials()}, |
| 52 | + % {node1_tls_required_node2_tls_optional, [], essentials()}, |
51 | 53 |
|
52 |
| - %% Node1 closes connection from nodes with invalid certs |
53 |
| - {node1_tls_required_trusted_node2_tls_optional, [], negative()}, |
| 54 | + % %% Node1 closes connection from nodes with invalid certs |
| 55 | + % {node1_tls_required_trusted_node2_tls_optional, [], negative()}, |
54 | 56 |
|
55 |
| - %% Node1 accepts connection provided the cert can be verified |
56 |
| - {node1_tls_optional_node2_tls_required_trusted_with_cachain, [parallel], |
57 |
| - essentials() ++ connection_cases() ++ start_stream_error_groups()}, |
| 57 | + % %% Node1 accepts connection provided the cert can be verified |
| 58 | + % {node1_tls_optional_node2_tls_required_trusted_with_cachain, [parallel], |
| 59 | + % essentials() ++ connection_cases() ++ start_stream_error_groups()}, |
58 | 60 |
|
59 |
| - {node1_tls_false_node2_tls_required, [], negative()}, |
60 |
| - {node1_tls_required_node2_tls_false, [], negative()}, |
61 |
| - {dialback, [], [dialback_key_is_synchronized_on_different_nodes]}, |
| 61 | + % {node1_tls_false_node2_tls_required, [], negative()}, |
| 62 | + % {node1_tls_required_node2_tls_false, [], negative()}, |
| 63 | + % {dialback, [], [dialback_key_is_synchronized_on_different_nodes]}, |
62 | 64 |
|
63 |
| - {start_stream_errors, [parallel], start_stream_error_cases()}, |
64 |
| - {start_stream_errors_after_starttls, [parallel], start_stream_error_cases()}, |
65 |
| - {start_stream_errors_after_auth, [parallel], start_stream_error_cases()} |
| 65 | + % {start_stream_errors, [parallel], start_stream_error_cases()}, |
| 66 | + % {start_stream_errors_after_starttls, [parallel], start_stream_error_cases()}, |
| 67 | + % {start_stream_errors_after_auth, [parallel], start_stream_error_cases()} |
66 | 68 | ].
|
67 | 69 |
|
68 | 70 | essentials() ->
|
69 | 71 | [simple_message].
|
70 | 72 |
|
71 | 73 | all_tests() ->
|
72 |
| - [connections_info, |
73 |
| - dns_srv_discovery, |
74 |
| - dns_ip_discovery, |
75 |
| - dns_discovery_fail, |
76 |
| - nonexistent_user, |
77 |
| - unknown_domain, |
78 |
| - malformed_jid, |
79 |
| - dialback_with_wrong_key]. |
| 74 | + [ |
| 75 | + % connections_info, |
| 76 | + % dns_srv_discovery, |
| 77 | + dns_ip_discovery |
| 78 | + % dns_discovery_fail, |
| 79 | + % nonexistent_user, |
| 80 | + % unknown_domain, |
| 81 | + % malformed_jid, |
| 82 | + % dialback_with_wrong_key |
| 83 | + ]. |
80 | 84 |
|
81 | 85 | negative() ->
|
82 | 86 | [timeout_waiting_for_message].
|
@@ -108,7 +112,7 @@ suite() ->
|
108 | 112 | %%%===================================================================
|
109 | 113 |
|
110 | 114 | init_per_suite(Config0) ->
|
111 |
| - ct:pal("Tested events: ~p~n", [tested_events()]), |
| 115 | + ?LOG_WARNING("Tested events: ~p~n", [tested_events()]), |
112 | 116 | instrument_helper:start(tested_events()),
|
113 | 117 | mongoose_helper:inject_module(?MODULE, reload),
|
114 | 118 | Config1 = escalus:init_per_suite(Config0),
|
@@ -161,34 +165,49 @@ init_per_testcase(CaseName, Config) ->
|
161 | 165 | escalus:init_per_testcase(CaseName, Config).
|
162 | 166 |
|
163 | 167 | meck_dns_srv_lookup(Domain, Which) ->
|
| 168 | + ?LOG_WARNING("meck_dns_srv_lookup"), |
164 | 169 | FedPort = ct:get_config({hosts, fed, incoming_s2s_port}),
|
165 | 170 | ok = rpc(mim(), meck, new, [inet_res, [no_link, unstick, passthrough]]),
|
166 | 171 | ok = rpc(mim(), meck, expect, [inet_res, lookup, inet_res_lookup_fun(Domain, FedPort, Which)]).
|
167 | 172 |
|
168 | 173 | inet_res_lookup_fun(Domain, FedPort, srv_ssl) ->
|
169 | 174 | fun("_xmpps-server._tcp." ++ Domain1, in, srv, _Opts, _Timeout) when Domain1 =:= Domain ->
|
| 175 | + ?LOG_WARNING("srv_ssl - meck"), |
170 | 176 | [{30, 0, FedPort, "localhost"}];
|
171 | 177 | (Name, Class, Type, Opts, Timeout) ->
|
| 178 | + ?LOG_WARNING("srv_ssl - passthrough"), |
172 | 179 | meck:passthrough([Name, Class, Type, Opts, Timeout])
|
173 | 180 | end;
|
174 | 181 | inet_res_lookup_fun(Domain, FedPort, srv) ->
|
175 | 182 | fun("_xmpp-server._tcp." ++ Domain1, in, srv, _Opts, _Timeout) when Domain1 =:= Domain ->
|
| 183 | + ?LOG_WARNING("srv - meck"), |
176 | 184 | [{30, 0, FedPort, "localhost"}];
|
177 | 185 | (Name, Class, Type, Opts, Timeout) ->
|
| 186 | + ?LOG_WARNING("srv - passthrough"), |
178 | 187 | meck:passthrough([Name, Class, Type, Opts, Timeout])
|
179 | 188 | end;
|
180 | 189 | inet_res_lookup_fun(Domain, _FedPort, ip) ->
|
181 | 190 | fun(Domain1, in, a, _Opts, _Timeout) when Domain1 =:= Domain ->
|
| 191 | + ?LOG_WARNING("ip - meck"), |
182 | 192 | [{127, 0, 0, 1}];
|
183 | 193 | (Name, Class, Type, Opts, Timeout) ->
|
| 194 | + ?LOG_WARNING("ip - passthrough"), |
| 195 | + ?LOG_WARNING("Name: ~p", [Name]), |
| 196 | + ?LOG_WARNING("Class: ~p", [Class]), |
| 197 | + ?LOG_WARNING("Type: ~p", [Type]), |
| 198 | + ?LOG_WARNING("Opts: ~p", [Opts]), |
| 199 | + ?LOG_WARNING("Timeout: ~p", [Timeout]), |
184 | 200 | meck:passthrough([Name, Class, Type, Opts, Timeout])
|
185 | 201 | end;
|
186 | 202 | inet_res_lookup_fun(Domain, _FedPort, none) ->
|
187 | 203 | fun("_xmpp-server._tcp." ++ Domain1, in, srv, _Opts, _Timeout) when Domain1 =:= Domain ->
|
| 204 | + ?LOG_WARNING("none - meck - srv"), |
188 | 205 | {error, nxdomain};
|
189 | 206 | (Domain1, in, inet, _Opts, _Timeout) when Domain1 =:= Domain ->
|
| 207 | + ?LOG_WARNING("none - meck - inet"), |
190 | 208 | {error, nxdomain};
|
191 | 209 | (Name, Class, Type, Opts, Timeout) ->
|
| 210 | + ?LOG_WARNING("none - passthrough"), |
192 | 211 | meck:passthrough([Name, Class, Type, Opts, Timeout])
|
193 | 212 | end.
|
194 | 213 |
|
@@ -296,7 +315,7 @@ get_s2s_connections(RPCSpec, Domain, Type) ->
|
296 | 315 | [Connection || Connection <- AllS2SConnections,
|
297 | 316 | Type =/= in orelse [Domain] =:= maps:get(domains, Connection),
|
298 | 317 | Type =/= out orelse Domain =:= maps:get(server, Connection)],
|
299 |
| - ct:pal("Node = ~p, ConnectionType = ~p, Domain = ~s~nDomainS2SConnections(~p): ~p~nAll Connections: ~p", |
| 318 | + ?LOG_WARNING("Node = ~p, ConnectionType = ~p, Domain = ~s~nDomainS2SConnections(~p): ~p~nAll Connections: ~p", |
300 | 319 | [maps:get(node, RPCSpec), Type, Domain, length(DomainS2SConnections),
|
301 | 320 | DomainS2SConnections, AllS2SConnections]),
|
302 | 321 | DomainS2SConnections.
|
|
0 commit comments