2020-07-15 08:19:24 +08:00
|
|
|
%% This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
%% License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
2017-03-10 20:35:09 +08:00
|
|
|
%%
|
2024-01-02 11:02:20 +08:00
|
|
|
%% Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
|
2017-03-10 20:35:09 +08:00
|
|
|
%%
|
|
|
|
|
|
|
|
|
|
-module(unit_SUITE).
|
|
|
|
|
|
|
|
|
|
-compile(export_all).
|
|
|
|
|
|
|
|
|
|
all() ->
|
|
|
|
|
[
|
|
|
|
|
get_tcp_conf,
|
|
|
|
|
get_tcp_port,
|
|
|
|
|
get_binding_address
|
|
|
|
|
].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
|
%% Testsuite setup/teardown.
|
|
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
init_per_group(_, Config) ->
|
|
|
|
|
Config.
|
|
|
|
|
|
|
|
|
|
end_per_group(_, Config) ->
|
|
|
|
|
Config.
|
|
|
|
|
|
|
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
|
%% Testcases.
|
|
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
get_tcp_conf(_Config) ->
|
2019-06-07 18:10:03 +08:00
|
|
|
[{ip, {127, 0, 0, 1}}, {port, 15674}] = lists:sort(rabbit_web_stomp_listener:get_tcp_conf(
|
2017-03-10 20:35:09 +08:00
|
|
|
[{ip, {127, 0, 0, 1}}, {port, 1245}], 15674
|
|
|
|
|
)),
|
2019-06-07 18:10:03 +08:00
|
|
|
[{ip, {127, 0, 0, 1}}, {port, 15674}] = lists:sort(rabbit_web_stomp_listener:get_tcp_conf(
|
2017-03-10 20:35:09 +08:00
|
|
|
[{ip, {127, 0, 0, 1}}], 15674
|
|
|
|
|
)),
|
2019-06-07 18:10:03 +08:00
|
|
|
[{port, 15674}] = lists:sort(rabbit_web_stomp_listener:get_tcp_conf(
|
2017-03-10 20:35:09 +08:00
|
|
|
[], 15674
|
|
|
|
|
)),
|
|
|
|
|
ok.
|
|
|
|
|
|
|
|
|
|
get_tcp_port(_Config) ->
|
2019-06-07 18:10:03 +08:00
|
|
|
15674 = rabbit_web_stomp_listener:get_tcp_port([{port, 15674}]),
|
|
|
|
|
15674 = rabbit_web_stomp_listener:get_tcp_port([{port, 15674}, {tcp_config, []}]),
|
|
|
|
|
12345 = rabbit_web_stomp_listener:get_tcp_port([{port, 15674}, {tcp_config, [{port, 12345}]}]),
|
2017-03-10 20:35:09 +08:00
|
|
|
ok.
|
|
|
|
|
|
|
|
|
|
get_binding_address(_Config) ->
|
2019-06-07 18:10:03 +08:00
|
|
|
"0.0.0.0" = rabbit_web_stomp_listener:get_binding_address([]),
|
|
|
|
|
"192.168.1.10" = rabbit_web_stomp_listener:get_binding_address([{ip, "192.168.1.10"}]),
|
|
|
|
|
"192.168.1.10" = rabbit_web_stomp_listener:get_binding_address([{ip, {192, 168, 1, 10}}]),
|
2017-03-10 20:35:09 +08:00
|
|
|
ok.
|