diff --git a/test/replication/sophia_join.result b/test/replication/sophia_join.result new file mode 100644 index 0000000000000000000000000000000000000000..ece1d73df3c21f82774c65f606769df2cabd4b6f --- /dev/null +++ b/test/replication/sophia_join.result @@ -0,0 +1,162 @@ +box.schema.user.grant('guest', 'replication') +--- +... +space = box.schema.space.create('test', { id = 99999, engine = "sophia" }) +--- +... +index = space:create_index('primary', { type = 'tree'}) +--- +... +for k = 1, 123 do space:insert{k, k*k} end +--- +... +box.snapshot() +--- +- ok +... +------------------------------------------------------------- +replica JOIN +------------------------------------------------------------- +box.space.test:select() +--- +- - [1, 1] + - [2, 4] + - [3, 9] + - [4, 16] + - [5, 25] + - [6, 36] + - [7, 49] + - [8, 64] + - [9, 81] + - [10, 100] + - [11, 121] + - [12, 144] + - [13, 169] + - [14, 196] + - [15, 225] + - [16, 256] + - [17, 289] + - [18, 324] + - [19, 361] + - [20, 400] + - [21, 441] + - [22, 484] + - [23, 529] + - [24, 576] + - [25, 625] + - [26, 676] + - [27, 729] + - [28, 784] + - [29, 841] + - [30, 900] + - [31, 961] + - [32, 1024] + - [33, 1089] + - [34, 1156] + - [35, 1225] + - [36, 1296] + - [37, 1369] + - [38, 1444] + - [39, 1521] + - [40, 1600] + - [41, 1681] + - [42, 1764] + - [43, 1849] + - [44, 1936] + - [45, 2025] + - [46, 2116] + - [47, 2209] + - [48, 2304] + - [49, 2401] + - [50, 2500] + - [51, 2601] + - [52, 2704] + - [53, 2809] + - [54, 2916] + - [55, 3025] + - [56, 3136] + - [57, 3249] + - [58, 3364] + - [59, 3481] + - [60, 3600] + - [61, 3721] + - [62, 3844] + - [63, 3969] + - [64, 4096] + - [65, 4225] + - [66, 4356] + - [67, 4489] + - [68, 4624] + - [69, 4761] + - [70, 4900] + - [71, 5041] + - [72, 5184] + - [73, 5329] + - [74, 5476] + - [75, 5625] + - [76, 5776] + - [77, 5929] + - [78, 6084] + - [79, 6241] + - [80, 6400] + - [81, 6561] + - [82, 6724] + - [83, 6889] + - [84, 7056] + - [85, 7225] + - [86, 7396] + - [87, 7569] + - [88, 7744] + - [89, 7921] + - [90, 8100] + - [91, 8281] + - [92, 8464] + - [93, 8649] + - [94, 8836] + - [95, 9025] + - [96, 9216] + - [97, 9409] + - [98, 9604] + - [99, 9801] + - [100, 10000] + - [101, 10201] + - [102, 10404] + - [103, 10609] + - [104, 10816] + - [105, 11025] + - [106, 11236] + - [107, 11449] + - [108, 11664] + - [109, 11881] + - [110, 12100] + - [111, 12321] + - [112, 12544] + - [113, 12769] + - [114, 12996] + - [115, 13225] + - [116, 13456] + - [117, 13689] + - [118, 13924] + - [119, 14161] + - [120, 14400] + - [121, 14641] + - [122, 14884] + - [123, 15129] +... +space:drop() +--- +... +box.snapshot() +--- +- ok +... +ffi = require('ffi') +--- +... +ffi.cdef("int sophia_schedule(void);") +--- +... +ffi.C.sophia_schedule() >= 0 +--- +- true +... diff --git a/test/replication/sophia_join.test.py b/test/replication/sophia_join.test.py new file mode 100644 index 0000000000000000000000000000000000000000..945c8e397ae205305ecddf2ea1d89ebab3499cad --- /dev/null +++ b/test/replication/sophia_join.test.py @@ -0,0 +1,37 @@ +import os +import glob +from lib.tarantool_server import TarantoolServer + +# master server +master = server +master_id = master.get_param('server')['id'] + +master.admin("box.schema.user.grant('guest', 'replication')") +master.admin("space = box.schema.space.create('test', { id = 99999, engine = \"sophia\" })") +master.admin("index = space:create_index('primary', { type = 'tree'})") +master.admin('for k = 1, 123 do space:insert{k, k*k} end') +master.admin('box.snapshot()') +lsn = master.get_lsn(master_id) + +print '-------------------------------------------------------------' +print 'replica JOIN' +print '-------------------------------------------------------------' + +# replica server +replica = TarantoolServer(server.ini) +replica.script = 'replication/replica.lua' +replica.vardir = os.path.join(server.vardir, 'replica') +replica.rpl_master = master +replica.deploy() +replica.wait_lsn(master_id, lsn) +replica.admin('box.space.test:select()') + +replica.stop() +replica.cleanup(True) + +# remove space +master.admin("space:drop()") +master.admin('box.snapshot()') +master.admin("ffi = require('ffi')") +master.admin("ffi.cdef(\"int sophia_schedule(void);\")") +master.admin("ffi.C.sophia_schedule() >= 0")