[Tarantool-patches] [PATCH] box: user.grant error should be versatile

Alexander Turenko alexander.turenko at tarantool.org
Fri Feb 28 00:06:18 MSK 2020


We can just revoke privileges granted for 'guest' and the patch will be
smaller.

Changed the patch and the description (in the spirit of Igor's wording).

The result:

 | commit e33216af9889a2387f331fd30c157d60292bdc5b
 | Author: Maria <maria.khaydich at tarantool.org>
 | Date:   Wed Feb 26 16:55:36 2020 +0300
 | 
 |     test: add clean up for box/access test
 |     
 |     The commit e8009f4158fc2d6efa2824cd634564b3c7a2f899 ('box: user.grant
 |     error should be versatile') did not do proper clean-up: it grants
 |     non-default privileges for user 'guest' and does not revoke them at the
 |     end. That caused occasional failures of other tests, all with the same
 |     error saying user 'guest' already had access on universe.
 |     
 |     This case should be handled by test-run in a future, see [1].
 |     
 |     [1]: https://github.com/tarantool/test-run/issues/156
 |     
 |     Follows up #714
 | 
 | diff --git a/test/box/access.result b/test/box/access.result
 | index b454d0eaa..20b1b8b35 100644
 | --- a/test/box/access.result
 | +++ b/test/box/access.result
 | @@ -2131,6 +2131,13 @@ box.schema.user.grant('guest', 'read,write,execute', 'space', 'not_universe')
 |  ---
 |  - error: User 'guest' already has read,write,execute access on space 'not_universe'
 |  ...
 | +-- Clean up.
 | +box.schema.user.revoke('guest', 'read,write,execute', 'universe')
 | +---
 | +...
 | +box.schema.user.revoke('guest', 'read,write,execute', 'space', 'not_universe')
 | +---
 | +...
 |  sp:drop()
 |  ---
 |  ...
 | diff --git a/test/box/access.test.lua b/test/box/access.test.lua
 | index 387c8b06b..3e083a383 100644
 | --- a/test/box/access.test.lua
 | +++ b/test/box/access.test.lua
 | @@ -819,4 +819,8 @@ box.schema.user.grant('guest', 'read,write,execute', 'universe')
 |  sp = box.schema.create_space('not_universe')
 |  box.schema.user.grant('guest', 'read,write,execute', 'space', 'not_universe')
 |  box.schema.user.grant('guest', 'read,write,execute', 'space', 'not_universe')
 | +
 | +-- Clean up.
 | +box.schema.user.revoke('guest', 'read,write,execute', 'universe')
 | +box.schema.user.revoke('guest', 'read,write,execute', 'space', 'not_universe')
 |  sp:drop()

Pushed to master. CCed Kirill.

WBR, Alexander Turenko.


More information about the Tarantool-patches mailing list