Skip to content

Commit 4ad8889

Browse files
Add test for ibm mq
1 parent d5d50d6 commit 4ad8889

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

deps/amqp10_client/ibm-mq/README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
# Build docker image
2-
3-
It downloads artifacts from https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv.
4-
5-
For ubuntu x86, run this command:
6-
```
7-
docker build -t "ibm-mq" --build-arg ARCH=UbuntuLinuxX64 .
8-
```
1+
https://developer.ibm.com/tutorials/mq-setting-up-amqp-with-mq/
92

10-
For ubuntu ARM, run this command:
11-
```
12-
docker build -t "ibm-mq" --build-arg ARCH=UbuntuLinuxARM .
13-
```
3+
# Build docker image
144

155

166
# Run docker image
177

18-
docker run -d ibm-mq
19-
8+
docker run --name mq --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --env MQ_APP_PASSWORD=passw0rd --env MQ_ADMIN_PASSWORD=passw0rd --publish 1414:1414 --publish 9443:9443 --publish 5677:5672 --detach ibm-mqadvanced-server-dev:9.3.5.1-arm64
9+
2010
# Display queues
2111

2212
docker exec -it ibm-mq

deps/amqp10_client/test/system_SUITE.erl

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@ suite() ->
2121

2222
all() ->
2323
[
24-
{group, rabbitmq},
25-
{group, rabbitmq_strict},
26-
{group, activemq},
27-
{group, activemq_no_anon},
28-
{group, mock}
24+
% {group, rabbitmq},
25+
% {group, rabbitmq_strict},
26+
% {group, activemq},
27+
{group, ibmmq}
28+
% {group, activemq_no_anon},
29+
% {group, mock}
2930
].
3031

3132
groups() ->
3233
[
3334
{rabbitmq, [], shared()},
3435
{activemq, [], shared()},
36+
{ibmmq, [], test()},
3537
{rabbitmq_strict, [], [
3638
basic_roundtrip_tls,
3739
roundtrip_tls_global_config,
@@ -60,6 +62,13 @@ groups() ->
6062
]}
6163
].
6264

65+
test() ->
66+
[
67+
open_close_connection,
68+
basic_roundtrip,
69+
set_sender_capabilities
70+
].
71+
6372
shared() ->
6473
[
6574
open_close_connection,
@@ -120,6 +129,12 @@ init_per_group(activemq, Config0) ->
120129
Config = rabbit_ct_helpers:set_config(Config0, {sasl, anon}),
121130
rabbit_ct_helpers:run_steps(Config,
122131
activemq_ct_helpers:setup_steps("activemq.xml"));
132+
133+
init_per_group(ibmmq, Config0) ->
134+
rabbit_ct_helpers:set_config(Config0, [ {rmq_hostname, "localhost"},
135+
{tcp_hostname_amqp, "localhost"},
136+
{tcp_port_amqp, 5677},
137+
{sasl, {plain, <<"app">>, <<"passw0rd">>}} ]);
123138
init_per_group(activemq_no_anon, Config0) ->
124139
Config = rabbit_ct_helpers:set_config(
125140
Config0, {sasl, {plain, <<"user">>, <<"password">>}}),
@@ -134,8 +149,8 @@ init_per_group(azure, Config) ->
134149
{sb_port, 5671}
135150
]);
136151
init_per_group(mock, Config) ->
137-
rabbit_ct_helpers:set_config(Config, [{mock_port, 25000},
138-
{mock_host, "localhost"},
152+
rabbit_ct_helpers:set_config(Config, [{tcp_port_amqp, 25000},
153+
{tcp_hostname_amqp, "localhost"},
139154
{sasl, none}
140155
]).
141156
end_per_group(rabbitmq, Config) ->
@@ -171,7 +186,8 @@ end_per_testcase(_Test, Config) ->
171186

172187
open_close_connection(Config) ->
173188
Hostname = ?config(rmq_hostname, Config),
174-
Port = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_amqp),
189+
Port = ?config(tcp_port_amqp, Config),
190+
%% Port = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_amqp),
175191
%% an address list
176192
OpnConf = #{addresses => [Hostname],
177193
port => Port,
@@ -816,8 +832,11 @@ multi_transfer_without_delivery_id(Config) ->
816832
ok.
817833

818834
set_receiver_capabilities(Config) ->
819-
Hostname = ?config(mock_host, Config),
820-
Port = ?config(mock_port, Config),
835+
Hostname = ?config(tcp_hostname_amqp, Config),
836+
Port = ?config(tcp_port_amqp, Config),
837+
838+
% Hostname = ?config(mock_host, Config),
839+
% Port = ?config(mock_port, Config),
821840

822841
OpenStep = fun({0 = Ch, #'v1_0.open'{}, _Pay}) ->
823842
{Ch, [#'v1_0.open'{container_id = {utf8, <<"mock">>}}]}
@@ -889,8 +908,8 @@ set_receiver_capabilities(Config) ->
889908
ok.
890909

891910
set_sender_capabilities(Config) ->
892-
Hostname = ?config(mock_host, Config),
893-
Port = ?config(mock_port, Config),
911+
Hostname = ?config(tcp_hostname_amqp, Config),
912+
Port = ?config(tcp_port_amqp, Config),
894913
OpenStep = fun({0 = Ch, #'v1_0.open'{}, _Pay}) ->
895914
{Ch, [#'v1_0.open'{container_id = {utf8, <<"mock">>}}]}
896915
end,
@@ -940,8 +959,9 @@ set_sender_capabilities(Config) ->
940959

941960

942961
set_sender_sync_capabilities(Config) ->
943-
Hostname = ?config(mock_host, Config),
944-
Port = ?config(mock_port, Config),
962+
Hostname = ?config(tcp_hostname_amqp, Config),
963+
Port = ?config(tcp_port_amqp, Config),
964+
945965
OpenStep = fun({0 = Ch, #'v1_0.open'{}, _Pay}) ->
946966
{Ch, [#'v1_0.open'{container_id = {utf8, <<"mock">>}}]}
947967
end,

0 commit comments

Comments
 (0)