コード例 #1
0
from __future__ import print_function

import os
import sys
import re
import yaml
from lib.tarantool_server import TarantoolServer

server = TarantoolServer(server.ini)
server.script = "long_run-py/lua/finalizers.lua"
server.vardir = os.path.join(server.vardir, "finalizers")
server.crash_expected = True
try:
    server.deploy()
except:
    print("Expected error:", sys.exc_info()[0])
else:
    print("Error! exception did not occur")
コード例 #2
0
replica.cleanup(True)

print '-------------------------------------------------------------'
print 'JOIN replica to read-only master'
print '-------------------------------------------------------------'

# master server
master = server
master.admin('box.cfg { read_only = true }')
#gh-1230 Assertion vclock_has on attempt to JOIN read-only master
failed = TarantoolServer(server.ini)
failed.script = 'replication-py/failed.lua'
failed.vardir = server.vardir
failed.rpl_master = master
failed.name = "failed"
failed.crash_expected = True
try:
    failed.deploy()
except Exception as e:
    line = "ER_READONLY"
    if failed.logfile_pos.seek_once(line) >= 0:
        print "'%s' exists in server log" % line

master.admin('box.cfg { read_only = false }')

print '-------------------------------------------------------------'
print 'JOIN replica with different replica set UUID'
print '-------------------------------------------------------------'

failed = TarantoolServer(server.ini)
failed.script = 'replication-py/uuid_mismatch.lua'
コード例 #3
0
ファイル: cluster.test.py プロジェクト: tarantool/tarantool
master.admin('box.space._cluster:delete{%d} ~= nil' % replica_id)

print '-------------------------------------------------------------'
print 'JOIN replica to read-only master'
print '-------------------------------------------------------------'

# master server
master = server
master.admin('box.cfg { read_only = true }')
#gh-1230 Assertion vclock_has on attempt to JOIN read-only master
failed = TarantoolServer(server.ini)
failed.script = 'replication-py/failed.lua'
failed.vardir = server.vardir
failed.rpl_master = master
failed.name = "failed"
failed.crash_expected = True
try:
    failed.deploy()
except Exception as e:
    line = "ER_READONLY"
    if failed.logfile_pos.seek_once(line) >= 0:
        print "'%s' exists in server log" % line

master.admin('box.cfg { read_only = false }')

print '-------------------------------------------------------------'
print 'JOIN replica with different replica set UUID'
print '-------------------------------------------------------------'

failed = TarantoolServer(server.ini)
failed.script = 'replication-py/uuid_mismatch.lua'
コード例 #4
0
server.stop()
replica = TarantoolServer(server.ini)
replica.script = "replication-py/replica.lua"
replica.vardir = server.vardir
replica.rpl_master = master
replica.deploy(wait=False)

print("waiting reconnect on JOIN...")
server.start()
try:
    # Replica may fail to start due connection issues may occur, check
    # gh-4949. Also the test should have the ability to be restarted by
    # test-run using fragile list and in this way 'crash_expected' flag
    # should be enabled to let the test fail with exception.
    replica.crash_expected = True
    replica.wait_until_started()
except TarantoolStartError:
    print("not ok - server failed to start")
else:
    print("ok")

replica.stop()
server.stop()

print("waiting reconnect on SUBSCRIBE...")
replica.start(wait=False)
server.start()
try:
    # Replica may fail to start due connection issues may occur, check
    # gh-4949. Also the test should have the ability to be restarted by
コード例 #5
0
import os
import sys
import re
import yaml
from lib.tarantool_server import TarantoolServer

server = TarantoolServer(server.ini)
server.script = 'long_run-py/lua/finalizers.lua'
server.vardir = os.path.join(server.vardir, 'finalizers')
server.crash_expected = True
try:
    server.deploy()
except:
    print "Expected error:", sys.exc_info()[0]
else:
    print "Error! exception did not occur"