Skip to content
Snippets Groups Projects
Commit 337e55b1 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov Committed by Roman Tsisyk
Browse files

Added more test cases to multiengine join test

parent 8b9afae7
No related branches found
No related tags found
No related merge requests found
......@@ -22,15 +22,125 @@ space = box.schema.space.create('test', { id = 99999, engine = engine })
index = space:create_index('primary', { type = index})
---
...
for k = 1, 123 do space:insert{k, k*k} end
box.snapshot()
---
- ok
...
-- replica join
test_run:cmd("create server replica with rpl_master=default, script='replication/replica.lua'")
---
- true
...
test_run:cmd("start server replica")
---
- true
...
test_run:cmd('wait_lsn replica default')
---
- true
...
test_run:cmd('switch replica')
---
- true
...
box.space.test:select()
---
- []
...
test_run:cmd('switch default')
---
- true
...
test_run:cmd("stop server replica")
---
- true
...
_ = test_run:cmd("cleanup server replica")
---
...
-- new data
_ = box.space.test:insert{1, 1}
---
...
-- replica join
test_run:cmd("deploy server replica")
---
- true
...
test_run:cmd("start server replica")
---
- true
...
test_run:cmd('wait_lsn replica default')
---
- true
...
test_run:cmd('switch replica')
---
- true
...
box.space.test:select()
---
- - [1, 1]
...
test_run:cmd('switch default')
---
- true
...
test_run:cmd("stop server replica")
---
- true
...
_ = test_run:cmd("cleanup server replica")
---
...
-- add snapshot
box.snapshot()
---
- ok
...
-- replica join
test_run:cmd("create server replica with rpl_master=default, script='replication/replica.lua'")
test_run:cmd("deploy server replica")
---
- true
...
test_run:cmd("start server replica")
---
- true
...
test_run:cmd('wait_lsn replica default')
---
- true
...
test_run:cmd('switch replica')
---
- true
...
box.space.test:select()
---
- - [1, 1]
...
test_run:cmd('switch default')
---
- true
...
test_run:cmd("stop server replica")
---
- true
...
_ = test_run:cmd("cleanup server replica")
---
...
-- new data
for k = 2, 123 do box.space.test:insert{k, k*k} end
---
...
box.snapshot()
---
- ok
...
-- replica join
test_run:cmd("deploy server replica")
---
- true
...
......@@ -180,9 +290,8 @@ test_run:cmd("stop server replica")
---
- true
...
test_run:cmd("cleanup server replica")
_ = test_run:cmd("cleanup server replica")
---
- true
...
space:drop()
---
......
......@@ -2,26 +2,64 @@ env = require('test_run')
test_run = env.new()
engine = test_run:get_cfg('engine')
index = test_run:get_cfg('index')
box.schema.user.grant('guest', 'read,write,execute', 'universe')
box.schema.user.grant('guest', 'replication')
space = box.schema.space.create('test', { id = 99999, engine = engine })
index = space:create_index('primary', { type = index})
for k = 1, 123 do space:insert{k, k*k} end
box.snapshot()
-- replica join
test_run:cmd("create server replica with rpl_master=default, script='replication/replica.lua'")
test_run:cmd("start server replica")
test_run:cmd('wait_lsn replica default')
test_run:cmd('switch replica')
box.space.test:select()
test_run:cmd('switch default')
test_run:cmd("stop server replica")
_ = test_run:cmd("cleanup server replica")
-- new data
_ = box.space.test:insert{1, 1}
-- replica join
test_run:cmd("deploy server replica")
test_run:cmd("start server replica")
test_run:cmd('wait_lsn replica default')
test_run:cmd('switch replica')
box.space.test:select()
test_run:cmd('switch default')
test_run:cmd("stop server replica")
_ = test_run:cmd("cleanup server replica")
-- add snapshot
box.snapshot()
-- replica join
test_run:cmd("deploy server replica")
test_run:cmd("start server replica")
test_run:cmd('wait_lsn replica default')
test_run:cmd('switch replica')
box.space.test:select()
test_run:cmd('switch default')
test_run:cmd("stop server replica")
_ = test_run:cmd("cleanup server replica")
-- new data
for k = 2, 123 do box.space.test:insert{k, k*k} end
box.snapshot()
-- replica join
test_run:cmd("deploy server replica")
test_run:cmd("start server replica")
test_run:cmd('wait_lsn replica default')
test_run:cmd('switch replica')
box.space.test:select()
test_run:cmd('switch default')
test_run:cmd("stop server replica")
test_run:cmd("cleanup server replica")
_ = test_run:cmd("cleanup server replica")
space:drop()
box.snapshot()
box.schema.user.revoke('guest', 'replication')
box.schema.user.revoke('guest', 'read,write,execute', 'universe')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment