[patches] [PATCH 1/1] test: check that netbox does not repeat request on schema change

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Mon Feb 26 18:58:31 MSK 2018


Closes #2666

Signed-off-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
---
 test/box/net.box.result   | 58 +++++++++++++++++++++++++++++++++++++++++++++++
 test/box/net.box.test.lua | 22 ++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/test/box/net.box.result b/test/box/net.box.result
index fcd441856..abfd2226b 100644
--- a/test/box/net.box.result
+++ b/test/box/net.box.result
@@ -2134,6 +2134,64 @@ disconnected -- true
 box.session.on_disconnect(nil, on_disconnect)
 ---
 ...
+--
+-- gh-2666: check that netbox.call is not repeated on schema
+-- change.
+--
+box.schema.user.grant('guest', 'write', 'space', '_space')
+---
+...
+box.schema.user.grant('guest', 'write', 'space', '_schema')
+---
+...
+count = 0
+---
+...
+function create_space(name) count = count + 1 box.schema.create_space(name) return true end
+---
+...
+c = net.connect(box.cfg.listen)
+---
+...
+c:call('create_space', {'test1'})
+---
+- true
+...
+count
+---
+- 1
+...
+c:call('create_space', {'test2'})
+---
+- true
+...
+count
+---
+- 2
+...
+c:call('create_space', {'test3'})
+---
+- true
+...
+count
+---
+- 3
+...
+box.space.test1:drop()
+---
+...
+box.space.test2:drop()
+---
+...
+box.space.test3:drop()
+---
+...
+box.schema.user.revoke('guest', 'write', 'space', '_space')
+---
+...
+box.schema.user.revoke('guest', 'write', 'space', '_schema')
+---
+...
 box.schema.user.revoke('guest', 'execute', 'universe')
 ---
 ...
diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
index 378dfd4ab..16d85e732 100644
--- a/test/box/net.box.test.lua
+++ b/test/box/net.box.test.lua
@@ -871,4 +871,26 @@ while disconnected == false do fiber.sleep(0.01) end
 disconnected -- true
 
 box.session.on_disconnect(nil, on_disconnect)
+
+--
+-- gh-2666: check that netbox.call is not repeated on schema
+-- change.
+--
+box.schema.user.grant('guest', 'write', 'space', '_space')
+box.schema.user.grant('guest', 'write', 'space', '_schema')
+count = 0
+function create_space(name) count = count + 1 box.schema.create_space(name) return true end
+c = net.connect(box.cfg.listen)
+c:call('create_space', {'test1'})
+count
+c:call('create_space', {'test2'})
+count
+c:call('create_space', {'test3'})
+count
+box.space.test1:drop()
+box.space.test2:drop()
+box.space.test3:drop()
+box.schema.user.revoke('guest', 'write', 'space', '_space')
+box.schema.user.revoke('guest', 'write', 'space', '_schema')
+
 box.schema.user.revoke('guest', 'execute', 'universe')
-- 
2.14.3 (Apple Git-98)




More information about the Tarantool-patches mailing list