From e33216af9889a2387f331fd30c157d60292bdc5b Mon Sep 17 00:00:00 2001
From: Maria <maria.khaydich@tarantool.org>
Date: Wed, 26 Feb 2020 16:55:36 +0300
Subject: [PATCH] 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
---
 test/box/access.result   | 7 +++++++
 test/box/access.test.lua | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/test/box/access.result b/test/box/access.result
index b454d0eaaf..20b1b8b351 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 387c8b06bc..3e083a3830 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()
-- 
GitLab