Add tests from develop
Added tests from develop. The test results need to be modified for 2.0.
This commit is contained in:
53
maxscale-system-test/bug681.cpp
Normal file
53
maxscale-system-test/bug681.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/**
|
||||
* @file bug681.cpp - regression test for bug681 ("crash if max_slave_connections=10% and 4 or less backends are configured")
|
||||
*
|
||||
* - Configure RWSplit with max_slave_connections=10%
|
||||
* - check ReadConn master and ReadConn slave are alive and RWSplit is not started
|
||||
*/
|
||||
|
||||
/*
|
||||
Timofey Turenko 2015-01-05 11:33:29 UTC
|
||||
try to start MaxScale with max_slave_connections=10%
|
||||
|
||||
|
||||
Result:
|
||||
Program terminated with signal 8, Arithmetic exception.
|
||||
#0 0x00007ff0517fee3f in have_enough_servers (p_rses=0x7fff9ed17ed0, min_nsrv=1, router_nsrv=3, router=0x397c2b0)
|
||||
at /usr/local/skysql/maxscale/server/modules/routing/readwritesplit/readwritesplit.c:4668
|
||||
4668 LOGIF(LE, (skygw_log_write_flush(
|
||||
Comment 1 Markus Mäkelä 2015-01-05 11:59:38 UTC
|
||||
Added casts to floating point values when doing divisions.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "testconnections.h"
|
||||
#include "mariadb_func.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TestConnections * Test = new TestConnections(argc, argv);
|
||||
Test->set_timeout(20);
|
||||
|
||||
Test->connect_maxscale();
|
||||
|
||||
if (mysql_errno(Test->conn_rwsplit) == 0)
|
||||
{
|
||||
Test->add_result(1, "RWSplit services should fail, but it is started\n");
|
||||
}
|
||||
|
||||
Test->tprintf("Trying query to ReadConn master\n");
|
||||
Test->try_query(Test->conn_master, "show processlist;");
|
||||
Test->tprintf("Trying query to ReadConn slave\n");
|
||||
Test->try_query(Test->conn_slave, "show processlist;");
|
||||
|
||||
Test->close_maxscale_connections();
|
||||
|
||||
Test->check_log_err((char *)
|
||||
"Unable to start RW-Split-Router service. There are too few backend servers configured in", true);
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
return rval;
|
||||
}
|
Reference in New Issue
Block a user