diff --git a/test/box/net.box.result b/test/box/net.box.result index fcd441856fcc0806172ac2e3aa1988f0095bd46e..5f4e163c0332e2db8f300f6b32f20c0f8814c6e4 100644 --- a/test/box/net.box.result +++ b/test/box/net.box.result @@ -2134,6 +2134,70 @@ 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') --- ... +c:close() +--- +... +c = nil +--- +... diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua index 378dfd4ab4abafb29b0d1a505be00e308cd9f0d6..b23a8830c186e4177a331ab1057afde5454b1e2f 100644 --- a/test/box/net.box.test.lua +++ b/test/box/net.box.test.lua @@ -871,4 +871,28 @@ 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') +c:close() +c = nil