Skip to content

Commit

Permalink
Adding test case verifying user permission when deleting queue
Browse files Browse the repository at this point in the history
  • Loading branch information
anhanhnguyen committed Dec 6, 2023
1 parent 393d3a9 commit e0a10cf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ all_tests() -> [
permissions_administrator_test,
permissions_vhost_test,
permissions_amqp_test,
permissions_queue_delete_test,
permissions_connection_channel_consumer_test,
consumers_cq_test,
consumers_qq_test,
Expand Down Expand Up @@ -1418,6 +1419,18 @@ permissions_amqp_test(Config) ->
http_delete(Config, "/users/myuser", {group, '2xx'}),
passed.

permissions_queue_delete_test(Config) ->
QArgs = #{},
PermArgs = [{configure, <<"foo.*">>}, {write, <<".*">>}, {read, <<".*">>}],
http_put(Config, "/users/myuser", [{password, <<"myuser">>},
{tags, <<"management">>}], {group, '2xx'}),
http_put(Config, "/permissions/%2F/myuser", PermArgs, {group, '2xx'}),
http_put(Config, "/queues/%2F/bar-queue", QArgs, {group, '2xx'}),
http_delete(Config, "/queues/%2F/bar-queue", "myuser", "myuser", ?NOT_AUTHORISED),
http_delete(Config, "/queues/%2F/bar-queue", {group, '2xx'}),
http_delete(Config, "/users/myuser", {group, '2xx'}),
passed.

%% Opens a new connection and a channel on it.
%% The channel is not managed by rabbit_ct_client_helpers and
%% should be explicitly closed by the caller.
Expand Down

0 comments on commit e0a10cf

Please sign in to comment.