Remove Python tests
The tests are not very good and require custom Python modules to be installed. In addition, they were written for Python2 which is no longer available on all modern systems.
This commit is contained in:
parent
454e9aca14
commit
3003ad6385
@ -410,12 +410,6 @@ add_test_executable(mxs548_short_session_change_user.cpp mxs548_short_session_ch
|
||||
# Playing with blocking and unblocking Master under load
|
||||
add_test_executable(mxs559_block_master.cpp mxs559_block_master mxs559 LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# Executes simple queries from python script in the loop
|
||||
add_test_script(mxs585.py mxs585.py replication LABELS readwritesplit readconnroute UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Simple transactions in the loop from python script with client SSL on
|
||||
add_test_script(mxs598.py mxs598.py ssl LABELS MySQLProtocol UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug "MaxScale fails to start silently if config file is not readable"
|
||||
add_test_executable(mxs621_unreadable_cnf.cpp mxs621_unreadable_cnf replication LABELS maxscale REPL_BACKEND)
|
||||
|
||||
|
@ -1,93 +0,0 @@
|
||||
[maxscale]
|
||||
threads=###threads###
|
||||
log_warning=1
|
||||
|
||||
[MySQL-Monitor]
|
||||
type=monitor
|
||||
module=mysqlmon
|
||||
servers=server1, server2, server3, server4
|
||||
user=maxskysql
|
||||
password=skysql
|
||||
monitor_interval=1000
|
||||
|
||||
[RW-Split-Router]
|
||||
type=service
|
||||
router=readwritesplit
|
||||
servers=server1, server2, server3, server4
|
||||
user=maxskysql
|
||||
password=skysql
|
||||
filters=nsfilter
|
||||
|
||||
[nsfilter]
|
||||
type=filter
|
||||
module=namedserverfilter
|
||||
match=test
|
||||
server=server1
|
||||
|
||||
[Read-Connection-Router-Slave]
|
||||
type=service
|
||||
router=readconnroute
|
||||
router_options=slave
|
||||
servers=server1, server2, server3, server4
|
||||
user=maxskysql
|
||||
password=skysql
|
||||
|
||||
[Read-Connection-Router-Master]
|
||||
type=service
|
||||
router=readconnroute
|
||||
router_options=master
|
||||
servers=server1, server2, server3, server4
|
||||
user=maxskysql
|
||||
password=skysql
|
||||
|
||||
[RW-Split-Listener]
|
||||
type=listener
|
||||
service=RW-Split-Router
|
||||
protocol=MySQLClient
|
||||
port=4006
|
||||
|
||||
[Read-Connection-Listener-Slave]
|
||||
type=listener
|
||||
service=Read-Connection-Router-Slave
|
||||
protocol=MySQLClient
|
||||
port=4009
|
||||
|
||||
[Read-Connection-Listener-Master]
|
||||
type=listener
|
||||
service=Read-Connection-Router-Master
|
||||
protocol=MySQLClient
|
||||
port=4008
|
||||
|
||||
[CLI]
|
||||
type=service
|
||||
router=cli
|
||||
|
||||
[CLI-Listener]
|
||||
type=listener
|
||||
service=CLI
|
||||
protocol=maxscaled
|
||||
socket=default
|
||||
|
||||
[server1]
|
||||
type=server
|
||||
address=###node_server_IP_1###
|
||||
port=###node_server_port_1###
|
||||
protocol=MySQLBackend
|
||||
|
||||
[server2]
|
||||
type=server
|
||||
address=###node_server_IP_2###
|
||||
port=###node_server_port_2###
|
||||
protocol=MySQLBackend
|
||||
|
||||
[server3]
|
||||
type=server
|
||||
address=###node_server_IP_3###
|
||||
port=###node_server_port_3###
|
||||
protocol=MySQLBackend
|
||||
|
||||
[server4]
|
||||
type=server
|
||||
address=###node_server_IP_4###
|
||||
port=###node_server_port_4###
|
||||
protocol=MySQLBackend
|
@ -1,89 +0,0 @@
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import os
|
||||
import time
|
||||
import jaydebeapi
|
||||
|
||||
# Abstract SQL connection
|
||||
class SQLConnection:
|
||||
def __init__(self, port = '3306', host = '127.0.0.1', user = 'root', password = ''):
|
||||
self.host = str(host)
|
||||
self.port = str(port)
|
||||
self.user = str(user)
|
||||
self.password = str(password)
|
||||
|
||||
# Connect to a server
|
||||
def connect(self, options = ""):
|
||||
try:
|
||||
self.conn = jaydebeapi.connect("org.mariadb.jdbc.Driver", ["jdbc:mariadb://" + self.host + ":" + self.port + "/test?" + options, self.user, self.password],"./maxscale/java/mariadb-java-client-1.3.3.jar")
|
||||
except Exception as ex:
|
||||
print("Failed to connect to " + self.host + ":" + self.port + " as " + self.user + ":" + self.password)
|
||||
print(unicode(ex))
|
||||
exit(1)
|
||||
|
||||
# Start a transaction
|
||||
def begin(self):
|
||||
curs = self.conn.cursor()
|
||||
curs.execute("BEGIN")
|
||||
curs.close()
|
||||
# Commit a transaction
|
||||
def commit(self):
|
||||
curs = self.conn.cursor()
|
||||
curs.execute("COMMIT")
|
||||
curs.close()
|
||||
|
||||
# Query and test if the result matches the expected value if one is provided
|
||||
def query(self, query, compare = None, column = 0):
|
||||
curs = self.conn.cursor()
|
||||
curs.execute(query)
|
||||
return curs.fetchall()
|
||||
|
||||
def query_and_compare(self, query, column):
|
||||
data = self.query(query)
|
||||
for row in data:
|
||||
if str(row[column]) == compare:
|
||||
return True
|
||||
return False
|
||||
|
||||
def disconnect(self):
|
||||
self.conn.close()
|
||||
|
||||
def query_and_close(self, query):
|
||||
self.connect()
|
||||
self.query(query)
|
||||
self.disconnect()
|
||||
|
||||
# Test environment abstraction
|
||||
class MaxScaleTest:
|
||||
def __init__(self, testname = "python_test"):
|
||||
|
||||
self.testname = testname
|
||||
# prepare_test(testname)
|
||||
|
||||
# MaxScale connections
|
||||
self.maxscale = dict()
|
||||
self.maxscale['rwsplit'] = SQLConnection(host = os.getenv("maxscale_000_network"), port = "4006", user = os.getenv("maxscale_user"), password = os.getenv("maxscale_password"))
|
||||
self.maxscale['rcmaster'] = SQLConnection(host = os.getenv("maxscale_000_network"), port = "4008", user = os.getenv("maxscale_user"), password = os.getenv("maxscale_password"))
|
||||
self.maxscale['rcslave'] = SQLConnection(host = os.getenv("maxscale_000_network"), port = "4009", user = os.getenv("maxscale_user"), password = os.getenv("maxscale_password"))
|
||||
|
||||
# Master-Slave nodes
|
||||
self.repl = dict()
|
||||
self.repl['node0'] = SQLConnection(host = os.getenv("node_000_network"), port = os.getenv("node_000_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
self.repl['node1'] = SQLConnection(host = os.getenv("node_001_network"), port = os.getenv("node_001_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
self.repl['node2'] = SQLConnection(host = os.getenv("node_002_network"), port = os.getenv("node_002_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
self.repl['node3'] = SQLConnection(host = os.getenv("node_003_network"), port = os.getenv("node_003_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
|
||||
# Galera nodes
|
||||
self.galera = dict()
|
||||
self.galera['node0'] = SQLConnection(host = os.getenv("galera_000_network"), port = os.getenv("galera_000_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
self.galera['node1'] = SQLConnection(host = os.getenv("galera_001_network"), port = os.getenv("galera_001_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
self.galera['node2'] = SQLConnection(host = os.getenv("galera_002_network"), port = os.getenv("galera_002_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
self.galera['node3'] = SQLConnection(host = os.getenv("galera_003_network"), port = os.getenv("galera_003_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
|
||||
# def __del__(self):
|
||||
# subprocess.call(os.getcwd() + "/copy_logs.sh " + str(self.testname), shell=True)
|
||||
|
||||
# Read test environment variables
|
||||
#def prepare_test(testname = "replication"):
|
||||
# subprocess.call(os.getcwd() + "/non_native_setup " + str(testname), shell=True)
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
###
|
||||
## @file mxs585.py Regression case for MXS-585 "Intermittent connection failure with MaxScale 1.2/1.3 using MariaDB/J 1.3"
|
||||
## - open connection, execute simple query and close connection in the loop
|
||||
|
||||
import maxpython
|
||||
|
||||
test1 = maxpython.MaxScaleTest("mxs585.py1")
|
||||
|
||||
for i in range(0,100):
|
||||
if i % 10 == 0:
|
||||
print(str(i))
|
||||
test1.maxscale['rwsplit'].query_and_close("select 1")
|
||||
test1.maxscale['rcmaster'].query_and_close("select 1")
|
||||
test1.maxscale['rcslave'].query_and_close("select 1")
|
@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
|
||||
###
|
||||
## @file mxs598.py Regression case for MXS-598 "SSL RW Router / JDBC Exception"
|
||||
## - use SSL for Maxscale client connection
|
||||
## - simple transactions in the loop
|
||||
|
||||
import maxpython
|
||||
|
||||
test1 = maxpython.MaxScaleTest("mxs598.py")
|
||||
|
||||
print("Connecting to MaxScale")
|
||||
for i in test1.maxscale.values():
|
||||
i.connect("useSSL=true&requireSSL=true&verifyServerCert=false")
|
||||
|
||||
print("Trying 100 simple transactions on all services")
|
||||
for i in range(0,100):
|
||||
for x in test1.maxscale.values():
|
||||
x.begin()
|
||||
x.query("insert into test.t1 values (1)")
|
||||
x.query("select * from test.t1")
|
||||
x.commit()
|
||||
|
||||
print("Closing connections")
|
||||
for i in test1.maxscale.values():
|
||||
i.disconnect()
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import maxpython
|
||||
|
||||
test = maxpython.MaxScaleTest("nsfilter")
|
||||
|
||||
server_id = []
|
||||
|
||||
for conn in test.repl:
|
||||
server_id[conn] = conn.query("SELECT @@server_id")
|
||||
|
||||
nomatch = test.maxscale['rwsplit'].query("SELECT @@server_id")
|
||||
match = test.maxscale['rwsplit'].query("SELECT \"test\", @@server_id")
|
||||
|
||||
print(nomatch)
|
||||
print(match)
|
Loading…
x
Reference in New Issue
Block a user