Skip to content

Commit 99a9237

Browse files
Merge pull request #13850 from rabbitmq/ik-stomp-evergreen
STOMP: queue type tests - add queue.type assertions
2 parents 53f511f + a91371d commit 99a9237

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

deps/rabbitmq_stomp/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define PROJECT_APP_EXTRA_KEYS
3131
endef
3232

3333
DEPS = ranch rabbit_common rabbit amqp_client
34-
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers
34+
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers rabbitmq_management
3535

3636
PLT_APPS += rabbitmq_cli elixir
3737

deps/rabbitmq_stomp/test/python_SUITE.erl

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ groups() ->
3131
].
3232

3333
init_per_suite(Config) ->
34-
DataDir = ?config(data_dir, Config),
3534
{ok, _} = rabbit_ct_helpers:exec(["pip", "install", "-r", requirements_path(Config),
3635
"--target", deps_path(Config)]),
3736
Config.
3837

3938
end_per_suite(Config) ->
40-
DataDir = ?config(data_dir, Config),
4139
ok = file:del_dir_r(deps_path(Config)),
4240
Config.
4341

@@ -82,8 +80,10 @@ run(Config, Test) ->
8280
StompPort = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_stomp),
8381
StompPortTls = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_stomp_tls),
8482
AmqpPort = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_amqp),
83+
MgmtPort = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_mgmt),
8584
NodeName = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
8685
os:putenv("AMQP_PORT", integer_to_list(AmqpPort)),
86+
os:putenv("MGMT_PORT", integer_to_list(MgmtPort)),
8787
os:putenv("STOMP_PORT", integer_to_list(StompPort)),
8888
os:putenv("STOMP_PORT_TLS", integer_to_list(StompPortTls)),
8989
os:putenv("RABBITMQ_NODENAME", atom_to_list(NodeName)),
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
stomp.py==8.1.0
22
pika==1.1.0
3-
3+
rabbitman===0.1.0

deps/rabbitmq_stomp/test/python_SUITE_data/src/x_queue_type_quorum.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import time
1111
import os
1212
import re
13-
13+
import rabbitman
1414

1515
class TestUserGeneratedQueueName(base.BaseTest):
1616

@@ -34,6 +34,11 @@ def test_quorum_queue(self):
3434
# let the quorum queue some time to start
3535
time.sleep(5)
3636

37+
client = rabbitman.Client(f'http://localhost:{(os.environ["MGMT_PORT"])}', 'guest', 'guest')
38+
queue = client.get_queues_by_vhost_and_name("/", queueName)
39+
40+
self.assertEqual(queue['type'], 'quorum')
41+
3742
connection = pika.BlockingConnection(
3843
pika.ConnectionParameters(host='127.0.0.1', port=int(os.environ["AMQP_PORT"])))
3944
channel = connection.channel()

deps/rabbitmq_stomp/test/python_SUITE_data/src/x_queue_type_stream.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import time
1111
import os
1212
import re
13-
import urllib.request, json
13+
import rabbitman
1414

1515
class TestUserGeneratedQueueName(base.BaseTest):
1616

@@ -34,12 +34,17 @@ def test_stream_queue(self):
3434
'id': 1234,
3535
'prefetch-count': 10
3636
},
37-
ack="client"
37+
ack="client"
3838
)
3939

4040
# let the stream queue some time to start
4141
time.sleep(5)
4242

43+
client = rabbitman.Client(f'http://localhost:{(os.environ["MGMT_PORT"])}', 'guest', 'guest')
44+
queue = client.get_queues_by_vhost_and_name("/", queueName)
45+
46+
self.assertEqual(queue['type'], 'stream')
47+
4348
connection = pika.BlockingConnection(
4449
pika.ConnectionParameters(host='127.0.0.1', port=int(os.environ["AMQP_PORT"])))
4550
channel = connection.channel()

0 commit comments

Comments
 (0)