Mxs 2226 long test (#186)
* add possibility to run named test * remove sysbench_dir * remove unsupported in 1.0 sysbench options * exculed ReadConnRouter sysbench test * fix sysbench table name
This commit is contained in:
parent
0b67a22add
commit
038f4d63e1
@ -25,33 +25,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
Test->tprintf("Connecting to RWSplit %s\n", Test->maxscales->IP[0]);
|
||||
|
||||
sprintf(&sys1[0], sysbench_prepare, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0]);
|
||||
sprintf(&sys1[0], SYSBENCH_PREPARE, Test->maxscales->IP[0]);
|
||||
|
||||
Test->tprintf("Preparing sysbench tables\n%s\n", sys1);
|
||||
Test->set_timeout(10000);
|
||||
Test->add_result(system(sys1), "Error executing sysbench prepare\n");
|
||||
|
||||
char *readonly;
|
||||
char *ro_on = (char *) "on";
|
||||
char *ro_off = (char *) "off";
|
||||
|
||||
Test->stop_timeout();
|
||||
|
||||
current_port = port[0];
|
||||
|
||||
Test->tprintf("Trying test with port %d\n", current_port);
|
||||
|
||||
if (current_port == Test->maxscales->readconn_slave_port[0] )
|
||||
{
|
||||
readonly = ro_on;
|
||||
}
|
||||
else
|
||||
{
|
||||
readonly = ro_off;
|
||||
}
|
||||
|
||||
sprintf(&sys1[0], sysbench_command_long, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0],
|
||||
current_port, readonly);
|
||||
sprintf(&sys1[0], SYSBENCH_COMMAND_LONG, Test->maxscales->IP[0],
|
||||
current_port);
|
||||
Test->set_log_copy_interval(300);
|
||||
Test->tprintf("Executing sysbench \n%s\n", sys1);
|
||||
if (system(sys1) != 0)
|
||||
@ -64,6 +51,7 @@ int main(int argc, char *argv[])
|
||||
printf("Dropping sysbanch tables!\n");
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest1");
|
||||
if (!Test->smoke)
|
||||
{
|
||||
@ -71,8 +59,9 @@ int main(int argc, char *argv[])
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest3");
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest4");
|
||||
}
|
||||
*/
|
||||
|
||||
//global_result += execute_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest");
|
||||
Test->global_result += execute_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest1");
|
||||
|
||||
printf("closing connections to MaxScale!\n");
|
||||
fflush(stdout);
|
||||
|
@ -68,6 +68,11 @@ if [ $res == 0 ] ; then
|
||||
mkdir build && cd build
|
||||
cmake .. -DBUILDNAME=$name -DCMAKE_BUILD_TYPE=Debug
|
||||
make
|
||||
set -x
|
||||
echo ${test_set} | grep "NAME#"
|
||||
if [ $? == 0 ] ; then
|
||||
named_test=`echo ${test_set} | sed "s/NAME#//" | sed "s/ //g"`
|
||||
fi
|
||||
|
||||
if [ ! -z "${named_test}" ] ; then
|
||||
./${named_test}
|
||||
|
@ -74,7 +74,9 @@ export maxscale_IP=$maxscale_network
|
||||
export maxscale_access_user=$maxscale_whoami
|
||||
|
||||
# Sysbench directory (should be sysbench >= 0.5)
|
||||
export sysbench_dir=${sysbench_dir:-"$HOME/sysbench_deb7/sysbench/"}
|
||||
sb=`which sysbench`
|
||||
export sysbench_dir=$(dirname ${sb})
|
||||
#export sysbench_dir=${sysbench_dir:-""}
|
||||
|
||||
export ssl=true
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
|
||||
#include "testconnections.h"
|
||||
#include "sysbench_commands.h"
|
||||
#include "sql_t1.h"
|
||||
#include "get_com_select_insert.h"
|
||||
|
||||
|
@ -1,71 +1,77 @@
|
||||
#ifndef SYSBENCH_COMMANDS_H
|
||||
#define SYSBENCH_COMMANDS_H
|
||||
|
||||
/*const char * sysbench_prepare =
|
||||
"sysbench --test=oltp \
|
||||
--oltp-table-size=1000000 --mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
/*const char * SYSBENCH_PREPARE =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s prepare";
|
||||
|
||||
|
||||
|
||||
const char * sysbench_command =
|
||||
"sysbench --test=oltp \
|
||||
const char * SYSBENCH_COMMAND =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test --mysql-table-engine=innodb \
|
||||
--num-threads=32 --oltp-table-size=1000000 --oltp-read-only=off \
|
||||
--mysql-db=test \
|
||||
--num-threads=32 \
|
||||
--oltp-dist-type=uniform --oltp-skip-trx=off --init-rng=on --oltp-test-mode=complex \
|
||||
--max-requests=0 --max-time=600 run";*/
|
||||
--max-requests=0 --time=600 run";*/
|
||||
|
||||
const char * sysbench_prepare =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
--oltp-table-size=1000000 --mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s --oltp-tables-count=4 prepare";
|
||||
const char * SYSBENCH_PREPARE =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s prepare";
|
||||
|
||||
const char * sysbench_command =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
const char * SYSBENCH_COMMAND =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test --mysql-table-engine=innodb --mysql-ignore-duplicates=on \
|
||||
--num-threads=32 --oltp-table-size=1000000 --oltp-tables-count=2 --oltp-read-only=%s \
|
||||
--oltp-dist-type=uniform --oltp-skip-trx=off --init-rng=on --oltp-test-mode=complex \
|
||||
--max-requests=0 --report-interval=5 --max-time=100 run";
|
||||
--mysql-db=test \
|
||||
--threads=32 \
|
||||
--max-requests=0 --report-interval=5 --time=100 run";
|
||||
|
||||
const char * SYSBENCH_PREPARE_RO =
|
||||
"sysbench oltp_read_only \
|
||||
--mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s prepare";
|
||||
|
||||
const char * sysbench_prepare1 =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
--oltp-table-size=1000 --mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s --oltp-tables-count=1 prepare";
|
||||
|
||||
const char * sysbench_command1 =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test --mysql-table-engine=innodb --mysql-ignore-duplicates=on \
|
||||
--num-threads=32 --oltp-table-size=1000 --oltp-tables-count=1 --oltp-read-only=%s \
|
||||
--oltp-dist-type=uniform --oltp-skip-trx=off --init-rng=on --oltp-test-mode=complex \
|
||||
--max-requests=0 --report-interval=5 --max-time=100 run";
|
||||
|
||||
|
||||
const char * sysbench_command_long =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
const char * SYSBENCH_COMMAND_RO =
|
||||
"sysbench oltp_read_only \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test --mysql-table-engine=innodb --mysql-ignore-duplicates=on \
|
||||
--num-threads=32 --oltp-table-size=1000000 --oltp-tables-count=2 --oltp-read-only=%s \
|
||||
--oltp-dist-type=uniform --oltp-skip-trx=off --init-rng=on --oltp-test-mode=complex \
|
||||
--max-requests=0 --report-interval=5 --max-time=2592000 run";
|
||||
--mysql-db=test \
|
||||
--threads=32 \
|
||||
--max-requests=0 --report-interval=5 --time=100 run";
|
||||
|
||||
|
||||
const char * sysbench_prepare_short =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
--oltp-table-size=10000 --mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s --oltp-tables-count=4 prepare";
|
||||
const char * SYSBENCH_PREPARE1 =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s prepare";
|
||||
|
||||
const char * sysbench_command_short =
|
||||
"%s/sysbench --test=%s/tests/db/oltp.lua \
|
||||
const char * SYSBENCH_COMMAND1 =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test \
|
||||
--threads=32 \
|
||||
--max-requests=0 --report-interval=5 --time=100 run";
|
||||
|
||||
|
||||
const char * SYSBENCH_COMMAND_LONG =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test \
|
||||
--threads=32 \
|
||||
--max-requests=0 --report-interval=5 --time=2592000 run";
|
||||
|
||||
|
||||
const char * SYSBENCH_PREPARE_SHORT =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-db=test --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-port=4006 --mysql-host=%s prepare";
|
||||
|
||||
const char * SYSBENCH_COMMAND_SHORT =
|
||||
"sysbench oltp_read_write \
|
||||
--mysql-host=%s --mysql-port=%d --mysql-user=skysql --mysql-password=skysql \
|
||||
--mysql-db=test --mysql-table-engine=innodb --mysql-ignore-duplicates=on \
|
||||
--num-threads=32 --oltp-table-size=10000 --oltp-tables-count=2 --oltp-read-only=%s \
|
||||
--oltp-dist-type=uniform --oltp-skip-trx=off --init-rng=on --oltp-test-mode=complex \
|
||||
--max-requests=0 --report-interval=5 --max-time=300 run";
|
||||
|
||||
|
||||
--mysql-db=test \
|
||||
--threads=32 \
|
||||
--max-requests=0 --report-interval=5 --time=300 run";
|
||||
|
||||
#endif // SYSBENCH_COMMANDS_H
|
||||
|
@ -21,7 +21,7 @@ int main(int argc, char *argv[])
|
||||
fflush(stdout);
|
||||
Test->tprintf("Connecting to RWSplit %s\n", Test->maxscales->IP[0]);
|
||||
|
||||
sprintf(&sys1[0], sysbench_prepare_short, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0]);
|
||||
sprintf(&sys1[0], SYSBENCH_PREPARE_SHORT, Test->maxscales->IP[0]);
|
||||
|
||||
Test->tprintf("Preparing sysbench tables\n%s\n", sys1);
|
||||
Test->set_timeout(10000);
|
||||
@ -29,8 +29,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
Test->stop_timeout();
|
||||
|
||||
sprintf(&sys1[0], sysbench_command_short, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0],
|
||||
Test->maxscales->rwsplit_port[0], "off");
|
||||
sprintf(&sys1[0], SYSBENCH_COMMAND_SHORT, Test->maxscales->IP[0],
|
||||
Test->maxscales->rwsplit_port[0]);
|
||||
Test->set_log_copy_interval(300);
|
||||
Test->tprintf("Executing sysbench \n%s\n", sys1);
|
||||
if (system(sys1) != 0)
|
||||
@ -43,6 +43,7 @@ int main(int argc, char *argv[])
|
||||
printf("Dropping sysbanch tables!\n");
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest1");
|
||||
if (!Test->smoke)
|
||||
{
|
||||
@ -50,8 +51,9 @@ int main(int argc, char *argv[])
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest3");
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest4");
|
||||
}
|
||||
*/
|
||||
|
||||
//global_result += execute_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest");
|
||||
Test->global_result += execute_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest1");
|
||||
|
||||
printf("closing connections to MaxScale!\n");
|
||||
fflush(stdout);
|
||||
|
@ -28,49 +28,36 @@ int main(int argc, char *argv[])
|
||||
|
||||
port[0] = Test->maxscales->rwsplit_port[0];
|
||||
port[1] = Test->maxscales->readconn_master_port[0];
|
||||
port[2] = Test->maxscales->readconn_slave_port[0];
|
||||
//port[2] = Test->maxscales->readconn_slave_port[0];
|
||||
|
||||
Test->tprintf("Connecting to RWSplit %s\n", Test->maxscales->IP[0]);
|
||||
|
||||
if (Test->smoke)
|
||||
{
|
||||
sprintf(&sys1[0], sysbench_prepare1, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0]);
|
||||
sprintf(&sys1[0], SYSBENCH_PREPARE1, Test->maxscales->IP[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(&sys1[0], sysbench_prepare, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0]);
|
||||
sprintf(&sys1[0], SYSBENCH_PREPARE, Test->maxscales->IP[0]);
|
||||
}
|
||||
|
||||
Test->tprintf("Preparing sysbench tables\n%s\n", sys1);
|
||||
Test->set_timeout(5000);
|
||||
Test->add_result(system(sys1), "Error executing sysbench prepare\n");
|
||||
|
||||
char *readonly;
|
||||
char *ro_on = (char *) "on";
|
||||
char *ro_off = (char *) "off";
|
||||
Test->set_timeout(2000);
|
||||
for (int k = 0; k < 3; k++)
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
Test->tprintf("Trying test with port %d\n", port[k]);
|
||||
pthread_create( &kill_vm_thread1, NULL, kill_vm_thread, NULL);
|
||||
|
||||
if (port[k] == Test->maxscales->readconn_slave_port[0] )
|
||||
{
|
||||
readonly = ro_on;
|
||||
}
|
||||
else
|
||||
{
|
||||
readonly = ro_off;
|
||||
}
|
||||
if (Test->smoke)
|
||||
{
|
||||
sprintf(&sys1[0], sysbench_command1, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0], port[k],
|
||||
readonly);
|
||||
sprintf(&sys1[0], SYSBENCH_COMMAND1, Test->maxscales->IP[0], port[k]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(&sys1[0], sysbench_command, Test->sysbench_dir, Test->sysbench_dir, Test->maxscales->IP[0], port[k],
|
||||
readonly);
|
||||
sprintf(&sys1[0], SYSBENCH_COMMAND, Test->maxscales->IP[0], port[k]);
|
||||
}
|
||||
Test->tprintf("Executing sysbench tables\n%s\n", sys1);
|
||||
if (system(sys1) != 0)
|
||||
@ -94,6 +81,7 @@ int main(int argc, char *argv[])
|
||||
printf("Dropping sysbanch tables!\n");
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest1");
|
||||
if (!Test->smoke)
|
||||
{
|
||||
@ -101,6 +89,8 @@ int main(int argc, char *argv[])
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest3");
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest4");
|
||||
}
|
||||
*/
|
||||
Test->global_result += execute_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP TABLE sbtest1");
|
||||
|
||||
printf("closing connections to MaxScale!\n");
|
||||
fflush(stdout);
|
||||
|
@ -431,12 +431,6 @@ void TestConnections::read_env()
|
||||
|
||||
//env = getenv("get_logs_command"); if (env != NULL) {sprintf(get_logs_command, "%s", env);}
|
||||
|
||||
env = getenv("sysbench_dir");
|
||||
if (env != NULL)
|
||||
{
|
||||
sprintf(sysbench_dir, "%s", env);
|
||||
}
|
||||
|
||||
//env = getenv("test_dir"); if (env != NULL) {sprintf(test_dir, "%s", env);}
|
||||
|
||||
ssl = false;
|
||||
|
@ -27,7 +27,6 @@ typedef std::set<std::string> StringSet;
|
||||
* - KillVMCommand - Command to kill a node (should handle one parameter: IP address of virtual machine to kill)
|
||||
* - StartVMCommand - Command to restart virtual machine (should handle one parameter: IP address of virtual machine to kill)
|
||||
* - GetLogsCommand - Command to copy log files from node virtual machines (should handle one parameter: IP address of virtual machine to kill)
|
||||
* - SysbenchDir - path to SysBench directory (sysbanch should be >= 0.5)
|
||||
* - node_N - Number of Master/Slave setup nodes
|
||||
* - node_NNN - IP address of node NNN (NNN - 3 digits node index starting from 000)
|
||||
* - node_port_NNN - MariaDB port for node NNN
|
||||
@ -117,11 +116,6 @@ public:
|
||||
*/
|
||||
bool use_snapshots;
|
||||
|
||||
/**
|
||||
* @brief SysbenchDir path to SysBench directory (sysbanch should be >= 0.5)
|
||||
*/
|
||||
char sysbench_dir[4096];
|
||||
|
||||
/**
|
||||
* @brief copy_mariadb_logs copies MariaDB logs from backend
|
||||
* @param repl Mariadb_nodes object
|
||||
|
Loading…
x
Reference in New Issue
Block a user