Skip to content

Commit e2caa93

Browse files
michaelklishinmergify[bot]
authored andcommitted
definition_import_SUITE: a new case
that features a deletion-protected virtual host. (cherry picked from commit 1d88a9d)
1 parent 687d5f9 commit e2caa93

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

deps/rabbit/test/definition_import_SUITE.erl

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ groups() ->
5353
import_case18,
5454
import_case19,
5555
import_case20,
56-
import_case21
56+
import_case21,
57+
import_case22
5758
]},
5859

5960
{boot_time_import_using_classic_source, [], [
@@ -315,6 +316,25 @@ import_case20(Config) ->
315316

316317
import_case21(Config) -> import_invalid_file_case(Config, "failing_case21").
317318

319+
import_case22(Config) ->
320+
import_file_case(Config, "case22"),
321+
Name = <<"protected">>,
322+
VirtualHostIsImported =
323+
fun () ->
324+
case vhost_lookup(Config, Name) of
325+
{error, not_found} -> false;
326+
_ -> true
327+
end
328+
end,
329+
rabbit_ct_helpers:await_condition(VirtualHostIsImported, 20000),
330+
VHost = vhost_lookup(Config, Name),
331+
?assertEqual(true, vhost:is_protected_from_deletion(VHost)),
332+
333+
VHost2 = vhost_lookup(Config, <<"non-protected">>),
334+
?assertEqual(false, vhost:is_protected_from_deletion(VHost2)),
335+
336+
ok.
337+
318338
export_import_round_trip_case1(Config) ->
319339
case rabbit_ct_helpers:is_mixed_versions() of
320340
false ->
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"bindings": [],
3+
"exchanges": [],
4+
"global_parameters": [
5+
{
6+
"name": "cluster_name",
7+
"value": "rabbitmq@localhost"
8+
}
9+
],
10+
"parameters": [],
11+
"permissions": [
12+
{
13+
"configure": ".*",
14+
"read": ".*",
15+
"user": "guest",
16+
"vhost": "/",
17+
"write": ".*"
18+
}
19+
],
20+
"policies": [],
21+
"queues": [],
22+
"rabbit_version": "4.0.5",
23+
"rabbitmq_version": "4.0.5",
24+
"topic_permissions": [],
25+
"users": [
26+
{
27+
"hashing_algorithm": "rabbit_password_hashing_sha256",
28+
"limits": {"max-connections" : 2},
29+
"name": "limited_guest",
30+
"password_hash": "wS4AT3B4Z5RpWlFn1FA30osf2C75D7WA3gem591ACDZ6saO6",
31+
"tags": [
32+
"administrator"
33+
]
34+
}
35+
],
36+
"vhosts": [
37+
{
38+
"limits": [],
39+
"name": "non-protected",
40+
"description": "",
41+
"metadata": {
42+
"description": "",
43+
"tags": [],
44+
"default_queue_type": "classic"
45+
},
46+
"tags": [],
47+
"default_queue_type": "classic"
48+
},
49+
{
50+
"name": "protected",
51+
"description": "protected, DQT = quorum",
52+
"metadata": {
53+
"description": "DQT = quorum",
54+
"tags": [],
55+
"default_queue_type": "quorum",
56+
"protected_from_deletion": true
57+
},
58+
"tags": [],
59+
"default_queue_type": "quorum"
60+
},
61+
{
62+
"limits": [],
63+
"name": "tagged"
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)