diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2020-08-11 21:17:01 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2020-08-11 21:17:01 +0300 |
| commit | ff5bbbe5141c093eeb20c4d836d1598d1a27aebb (patch) | |
| tree | 200ea57c680d6300c2077b955efad468ae0295c1 | |
| parent | ad0c0bd294b5f63b3531a22a6082c3592284e644 (diff) | |
| download | rabbitmq-server-git-ff5bbbe5141c093eeb20c4d836d1598d1a27aebb.tar.gz | |
Add a definition import test for #2426
| -rw-r--r-- | test/definition_import_SUITE.erl | 25 | ||||
| -rw-r--r-- | test/definition_import_SUITE_data/case13.json | 55 |
2 files changed, 79 insertions, 1 deletions
diff --git a/test/definition_import_SUITE.erl b/test/definition_import_SUITE.erl index 6f9aaefc6c..376d4d66d2 100644 --- a/test/definition_import_SUITE.erl +++ b/test/definition_import_SUITE.erl @@ -38,7 +38,8 @@ groups() -> import_case9, import_case10, import_case11, - import_case12 + import_case12, + import_case13 ]}, {boot_time_import, [], [ import_on_a_booting_node @@ -115,6 +116,25 @@ import_case5(Config) -> import_case11(Config) -> import_file_case(Config, "case11"). import_case12(Config) -> import_invalid_file_case(Config, "failing_case12"). +import_case13(Config) -> + import_file_case(Config, "case13"), + VHost = <<"/">>, + QueueName = <<"definitions.import.case13.qq.1">>, + QueueIsImported = fun () -> + case queue_lookup(Config, VHost, QueueName) of + {ok, _} -> true; + _ -> false + end + end, + rabbit_ct_helpers:await_condition(QueueIsImported, 20000), + {ok, Q} = queue_lookup(Config, VHost, QueueName), + + %% see rabbitmq/rabbitmq-server#2400, rabbitmq/rabbitmq-server#2426 + ?assert(amqqueue:is_quorum(Q)), + ?assertEqual([{<<"x-max-length">>, long, 991}, + {<<"x-queue-type">>, longstr, <<"quorum">>}], + amqqueue:get_arguments(Q)). + export_import_round_trip_case1(Config) -> %% case 6 has runtime parameters that do not depend on any plugins import_file_case(Config, "case6"), @@ -226,3 +246,6 @@ run_invalid_import_case(Path) -> ct:fail({failure, Path}); {error, _E} -> ok end. + +queue_lookup(Config, VHost, Name) -> + rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_amqqueue, lookup, [rabbit_misc:r(VHost, queue, Name)]). diff --git a/test/definition_import_SUITE_data/case13.json b/test/definition_import_SUITE_data/case13.json new file mode 100644 index 0000000000..726aab1e6c --- /dev/null +++ b/test/definition_import_SUITE_data/case13.json @@ -0,0 +1,55 @@ +{ + "bindings": [], + "exchanges": [], + "global_parameters": [ + { + "name": "cluster_name", + "value": "rabbit@localhost" + } + ], + "parameters": [], + "permissions": [ + { + "configure": ".*", + "read": ".*", + "user": "guest", + "vhost": "/", + "write": ".*" + } + ], + "policies": [], + "queues": [ + { + "arguments": { + "x-max-length": 991, + "x-queue-type": "quorum" + }, + "auto_delete": false, + "durable": true, + "name": "definitions.import.case13.qq.1", + "type": "quorum", + "vhost": "/" + } + ], + "rabbit_version": "3.8.6.gad0c0bd", + "rabbitmq_version": "3.8.6.gad0c0bd", + "topic_permissions": [], + "users": [ + { + "hashing_algorithm": "rabbit_password_hashing_sha256", + "name": "guest", + "password_hash": "e8lL5PHYcbv3Pd53EUoTOMnVDmsLDgVJXqSQMT+mrO4LVIdW", + "tags": "administrator" + } + ], + "vhosts": [ + { + "limits": [], + "metadata": { + "description": "Default virtual host", + "tags": [] + }, + "name": "/" + } + ] +} |
