Skip to content
Snippets Groups Projects
Commit 96cdc78a authored by bigbes's avatar bigbes
Browse files

Move replication/status.test -> replication/status.test.py, redo format

of test from 1.5 to 1.6

Closes #239
parent 4ac0eadb
No related branches found
No related tags found
No related merge requests found
# encoding: tarantool
import os
import time
import re
import time
from lib.tarantool_server import TarantoolServer
# master server
master = server
# replica server
replica = TarantoolServer()
replica.deploy("replication/cfg/replica.cfg",
replica.find_exe(self.args.builddir),
os.path.join(self.args.vardir, "replica"))
replica.script = "replication/replica.lua"
replica.rpl_master = master
replica.vardir = os.path.join(master.vardir, 'replica')
replica.deploy()
replica.get_param("lsn")
status = replica.admin.execute_no_reconnect("lua box.info.status", True)
cycles = 0
status = replica.admin.execute_no_reconnect("box.info.status", True)
while (re.search(r'replica/.*/(connecting|connected)\n', status) == None and cycles < 500):
time.sleep(0.01)
status = replica.admin.execute_no_reconnect("box.info.status", True)
cycles += 1
print(re.search(r'replica/.*/(connecting|connected)\n', status) != None)
server.stop()
status = replica.admin.execute_no_reconnect("lua box.info.status", True)
master.stop()
cycles = 0
while (re.search(r'replica/.*/(connecting|failed)\n', status) == None and cycles < 500):
time.sleep(0.01)
status = replica.admin.execute_no_reconnect("box.info.status", True)
cycles += 1
print(re.search(r'replica/.*/(connecting|failed)\n', status) != None)
# Cleanup.
replica.stop()
replica.cleanup(True)
server.deploy(self.suite_ini["config"])
# vim: syntax=python
master.deploy()
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