Commit 58fec904 authored by unknown's avatar unknown

wl1858

1) update atrt to support mysqld
2) add example
3) add our current basic tests
parent d29a5100
run-test/README
This document describes how atrt works and how to use it.
atrt is a test program driver.
atrt supports fully distributed test and utilizes ndb_cpcd.
=================================
atrt has the following main loop:
/**
* Psuedo code for atrt
*/
read config file (default d.txt)
contact each ndb_cpcd
start each ndb_mgmd
connect to each ndb_mgmd
for each read(test case)
do
if previous test failed (or is first test)
stop each ndbd
start each ndbd
wait for ndbd to get started
start each mysqld
start each test prg
wait while all is running and max time not elapsed
stop each mysqld
stop each test prg
gather result
done
/**
* End of psuedo code
*/
=================================
# BASIC FUNCTIONALITY
max-time: 500
cmd: testBasic
args: -n PkRead
max-time: 500
cmd: testBasic
args: -n PkUpdate
max-time: 500
cmd: testBasic
args: -n PkDelete
max-time: 500
cmd: testBasic
args: -n PkInsert
max-time: 600
cmd: testBasic
args: -n UpdateAndRead
max-time: 500
cmd: testBasic
args: -n PkReadAndLocker T6
max-time: 500
cmd: testBasic
args: -n PkReadAndLocker2 T6
max-time: 500
cmd: testBasic
args: -n PkReadUpdateAndLocker T6
max-time: 500
cmd: testBasic
args: -n ReadWithLocksAndInserts T6
max-time: 500
cmd: testBasic
args: -n PkInsertTwice T1 T6 T10
max-time: 1500
cmd: testBasic
args: -n Fill T1
max-time: 1500
cmd: testBasic
args: -n Fill T6
max-time: 500
cmd: testBasic
args: -n NoCommitSleep T6
max-time: 500
cmd: testBasic
args: -n NoCommit626 T6
max-time: 500
cmd: testBasic
args: -n NoCommitAndClose T6
max-time: 500
cmd: testBasic
args: -n Commit626 T6
max-time: 500
cmd: testBasic
args: -n CommitTry626 T6
max-time: 500
cmd: testBasic
args: -n CommitAsMuch626 T6
max-time: 500
cmd: testBasic
args: -n NoCommit626 T6
max-time: 500
cmd: testBasic
args: -n NoCommitRollback626 T1 T6
max-time: 500
cmd: testBasic
args: -n Commit630 T1 T6
max-time: 500
cmd: testBasic
args: -n CommitTry630 T1 T6
max-time: 500
cmd: testBasic
args: -n CommitAsMuch630 T1 T6
max-time: 500
cmd: testBasic
args: -n NoCommit630 T1 T6
max-time: 500
cmd: testBasic
args: -n NoCommitRollback630 T1 T6
max-time: 500
cmd: testBasic
args: -n NoCommitAndClose T1 T6
max-time: 500
cmd: testBasic
args: -n RollbackUpdate T1 T6
max-time: 500
cmd: testBasic
args: -n RollbackDeleteMultiple T1 T6
max-time: 500
cmd: testBasic
args: -n ImplicitRollbackDelete T1 T6
max-time: 500
cmd: testBasic
args: -n CommitDelete T1 T6
max-time: 500
cmd: testBasic
args: -n RollbackNothing T1 T6
max-time: 500
cmd: testBasicAsynch
args: -n PkInsertAsynch
max-time: 500
cmd: testBasicAsynch
args: -n PkReadAsynch
max-time: 500
cmd: testBasicAsynch
args: -n PkUpdateAsynch
max-time: 500
cmd: testBasicAsynch
args: -n PkDeleteAsynch
max-time: 500
cmd: testBasic
args: -n MassiveRollback T1 T6 T13
max-time: 500
cmd: testBasic
args: -n MassiveRollback2 T1 T6 T13
#-m 500 1: testBasic -n ReadConsistency T6
cmd: testTimeout
args: -n DontTimeoutTransaction T1
cmd: testTimeout
args: -n DontTimeoutTransaction5 T1
cmd: testTimeout
args: -n TimeoutTransaction T1
cmd: testTimeout
args: -n TimeoutTransaction5 T1
cmd: testTimeout
args: -n BuddyTransNoTimeout T1
cmd: testTimeout
args: -n BuddyTransNoTimeout5 T1
#
# SCAN TESTS
#
max-time: 500
cmd: testScan
args: -n ScanRead16
max-time: 500
cmd: testScan
args: -n ScanRead240
max-time: 500
cmd: testScan
args: -n ScanReadCommitted240
max-time: 500
cmd: testScan
args: -n ScanUpdate
max-time: 500
cmd: testScan
args: -n ScanUpdate2 T6
max-time: 500
cmd: testScan
args: -n ScanDelete
max-time: 500
cmd: testScan
args: -n ScanDelete2 T10
max-time: 500
cmd: testScan
args: -n ScanUpdateAndScanRead T6
max-time: 500
cmd: testScan
args: -n ScanReadAndLocker T6
max-time: 500
cmd: testScan
args: -n ScanReadAndPkRead T6
max-time: 500
cmd: testScan
args: -n ScanRead488 -l 10 T6
max-time: 600
cmd: testScan
args: -n ScanRead40 -l 100 T2
max-time: 1800
cmd: testScan
args: -n ScanRead100 -l 100 T1
max-time: 600
cmd: testScan
args: -n ScanRead40 -l 100 T1
max-time: 1800
cmd: testScan
args: -n ScanRead40RandomTable -l 100 T1
max-time: 3600
cmd: testScan
args: -n ScanRead40RandomTable -l 1000 T2
max-time: 500
cmd: testScan
args: -n ScanWithLocksAndInserts T6
max-time: 500
cmd: testScan
args: -n ScanReadAbort T6
max-time: 500
cmd: testScan
args: -n ScanReadAbort15 T6
max-time: 500
cmd: testScan
args: -n ScanReadAbort240 T6
max-time: 500
cmd: testScan
args: -n ScanUpdateAbort16 T6
max-time: 3600
cmd: testScan
args: -n ScanReadRestart T1 T6 T13
max-time: 500
cmd: testScan
args: -n ScanUpdateRestart T6
max-time: 500
cmd: testScan
args: -n CheckGetValue T6
max-time: 500
cmd: testScan
args: -n CloseWithoutStop T6
max-time: 500
cmd: testScan
args: -n NextScanWhenNoMore T6
max-time: 500
cmd: testScan
args: -n ExecuteScanWithoutOpenScan T6
max-time: 500
cmd: testScan
args: -n OnlyOpenScanOnce T6
max-time: 500
cmd: testScan
args: -n OnlyOneOpInScanTrans T6
max-time: 500
cmd: testScan
args: -n OnlyOneOpBeforeOpenScan T6
max-time: 500
cmd: testScan
args: -n OnlyOneScanPerTrans T6
max-time: 500
cmd: testScan
args: -n NoCloseTransaction T6
max-time: 500
cmd: testScan
args: -n CheckInactivityTimeOut T6
max-time: 500
cmd: testScan
args: -n CheckInactivityBeforeClose T6
max-time: 500
cmd: testScan
args: -n CheckAfterTerror T6
max-time: 500
cmd: testScan
args: -n ScanReadError5021 T1
max-time: 500
cmd: testScan
args: -n ScanReaderror5022 T1
max-time: 500
cmd: testScan
args: -n ScanReadError5023 T1
max-time: 500
cmd: testScan
args: -n ScanReadError5024 T1
max-time: 500
cmd: testScan
args: -n ScanReadError5025 T1
max-time: 500
cmd: testScan
args: -n ScanReadError5030 T1
# OLD FLEX
max-time: 500
cmd: flexBench
args: -c 25 -t 10
max-time: 500
cmd: flexHammer
args: -r 5 -t 32
#
# DICT TESTS
max-time: 1500
cmd: testDict
args: -n CreateAndDrop
max-time: 1500
cmd: testDict
args: -n CreateAndDropWithData
max-time: 1500
cmd: testDict
args: -n CreateAndDropDuring T6 T10
max-time: 1500
cmd: testDict
args: -n CreateInvalidTables
max-time: 1500
cmd: testDict
args: -n CreateTableWhenDbIsFull T6
max-time: 1500
cmd: testDict
args: -n CreateMaxTables T6
max-time: 500
cmd: testDict
args: -n FragmentTypeSingle T1
max-time: 1500
cmd: testDict
args: -n FragmentTypeAll T1 T6 T7 T8
max-time: 1500
cmd: testDict
args: -n FragmentTypeAllLarge T1 T6 T7 T8
max-time: 1500
cmd: testDict
args: -n TemporaryTables T1 T6 T7 T8
#
# TEST NDBAPI
#
max-time: 500
cmd: testDataBuffers
args:
# Testsuite: testNdbApi
# Number of tests: 5
max-time: 500
cmd: testNdbApi
args: -n MaxNdb T6
max-time: 500
cmd: testNdbApi
args: -n MaxTransactions T1 T6 T7 T8 T13
max-time: 500
cmd: testNdbApi
args: -n MaxOperations T1 T6 T7 T8 T13
max-time: 500
cmd: testNdbApi
args: -n MaxGetValue T1 T6 T7 T8 T13
max-time: 500
cmd: testNdbApi
args: -n MaxEqual
max-time: 500
cmd: testNdbApi
args: -n DeleteNdb T1 T6
max-time: 500
cmd: testNdbApi
args: -n WaitUntilReady T1 T6 T7 T8 T13
max-time: 500
cmd: testNdbApi
args: -n GetOperationNoTab T6
max-time: 500
cmd: testNdbApi
args: -n NdbErrorOperation T6
max-time: 500
cmd: testNdbApi
args: -n MissingOperation T6
max-time: 500
cmd: testNdbApi
args: -n GetValueInUpdate T6
max-time: 500
cmd: testNdbApi
args: -n UpdateWithoutKeys T6
max-time: 500
cmd: testNdbApi
args: -n UpdateWithoutValues T6
max-time: 500
cmd: testInterpreter
args: T1
max-time: 1500
cmd: testOperations
args: -n ReadRead
max-time: 1500
cmd: testOperations
args: -n ReadReadEx
max-time: 1500
cmd: testOperations
args: -n ReadInsert
max-time: 1500
cmd: testOperations
args: -n ReadUpdate
max-time: 1500
cmd: testOperations
args: -n ReadDelete
max-time: 1500
cmd: testOperations
args: -n FReadRead
max-time: 1500
cmd: testOperations
args: -n FReadReadEx
max-time: 1500
cmd: testOperations
args: -n FReadInsert
max-time: 1500
cmd: testOperations
args: -n FReadUpdate
max-time: 1500
cmd: testOperations
args: -n FReadDelete
max-time: 1500
cmd: testOperations
args: -n ReadExRead
max-time: 1500
cmd: testOperations
args: -n ReadExReadEx
max-time: 1500
cmd: testOperations
args: -n ReadExInsert
max-time: 1500
cmd: testOperations
args: -n ReadExUpdate
max-time: 1500
cmd: testOperations
args: -n ReadExDelete
max-time: 1500
cmd: testOperations
args: -n InsertRead
max-time: 1500
cmd: testOperations
args: -n InsertReadEx
max-time: 1500
cmd: testOperations
args: -n InsertInsert
max-time: 1500
cmd: testOperations
args: -n InsertUpdate
max-time: 1500
cmd: testOperations
args: -n InsertDelete
max-time: 1500
cmd: testOperations
args: -n UpdateRead
max-time: 1500
cmd: testOperations
args: -n UpdateReadEx
max-time: 1500
cmd: testOperations
args: -n UpdateInsert
max-time: 1500
cmd: testOperations
args: -n UpdateUpdate
max-time: 1500
cmd: testOperations
args: -n UpdateDelete
max-time: 1500
cmd: testOperations
args: -n DeleteRead
max-time: 1500
cmd: testOperations
args: -n DeleteReadEx
max-time: 1500
cmd: testOperations
args: -n DeleteInsert
max-time: 1500
cmd: testOperations
args: -n DeleteUpdate
max-time: 1500
cmd: testOperations
args: -n DeleteDelete
max-time: 1500
cmd: testOperations
args: -n ReadSimpleRead
max-time: 1500
cmd: testOperations
args: -n ReadDirtyRead
max-time: 1500
cmd: testOperations
args: -n FReadSimpleRead
max-time: 1500
cmd: testOperations
args: -n FReadDirtyRead
max-time: 1500
cmd: testOperations
args: -n ReadExSimpleRead
max-time: 1500
cmd: testOperations
args: -n ReadExDirtyRead
max-time: 1500
cmd: testOperations
args: -n InsertSimpleRead
max-time: 1500
cmd: testOperations
args: -n InsertDirtyRead
max-time: 1500
cmd: testOperations
args: -n UpdateSimpleRead
max-time: 1500
cmd: testOperations
args: -n UpdateDirtyRead
max-time: 1500
cmd: testOperations
args: -n DeleteSimpleRead
max-time: 1500
cmd: testOperations
args: -n DeleteDirtyRead
max-time: 1500
cmd: testTransactions
args: -n ReadRead
max-time: 1500
cmd: testTransactions
args: -n ReadReadEx
max-time: 1500
cmd: testTransactions
args: -n ReadInsert
max-time: 1500
cmd: testTransactions
args: -n ReadUpdate
max-time: 1500
cmd: testTransactions
args: -n ReadDelete
max-time: 1500
cmd: testTransactions
args: -n ReadExRead
max-time: 1500
cmd: testTransactions
args: -n ReadExReadEx
max-time: 1500
cmd: testTransactions
args: -n ReadExInsert
max-time: 1500
cmd: testTransactions
args: -n ReadExUpdate
max-time: 1500
cmd: testTransactions
args: -n ReadExDelete
max-time: 1500
cmd: testTransactions
args: -n InsertRead
max-time: 1500
cmd: testTransactions
args: -n InsertReadEx
max-time: 1500
cmd: testTransactions
args: -n InsertInsert
max-time: 1500
cmd: testTransactions
args: -n InsertUpdate
max-time: 1500
cmd: testTransactions
args: -n InsertDelete
max-time: 1500
cmd: testTransactions
args: -n UpdateRead
max-time: 1500
cmd: testTransactions
args: -n UpdateReadEx
max-time: 1500
cmd: testTransactions
args: -n UpdateInsert
max-time: 1500
cmd: testTransactions
args: -n UpdateUpdate
max-time: 1500
cmd: testTransactions
args: -n UpdateDelete
max-time: 1500
cmd: testTransactions
args: -n DeleteRead
max-time: 1500
cmd: testTransactions
args: -n DeleteReadEx
max-time: 1500
cmd: testTransactions
args: -n DeleteInsert
max-time: 1500
cmd: testTransactions
args: -n DeleteUpdate
max-time: 1500
cmd: testTransactions
args: -n DeleteDelete
max-time: 1500
cmd: testTransactions
args: -n ReadSimpleRead
max-time: 1500
cmd: testTransactions
args: -n ReadDirtyRead
max-time: 1500
cmd: testTransactions
args: -n ReadExSimpleRead
max-time: 1500
cmd: testTransactions
args: -n ReadExDirtyRead
max-time: 1500
cmd: testTransactions
args: -n InsertSimpleRead
max-time: 1500
cmd: testTransactions
args: -n InsertDirtyRead
max-time: 1500
cmd: testTransactions
args: -n UpdateSimpleRead
max-time: 1500
cmd: testTransactions
args: -n UpdateDirtyRead
max-time: 1500
cmd: testTransactions
args: -n DeleteSimpleRead
max-time: 1500
cmd: testTransactions
args: -n DeleteDirtyRead
max-time: 1500
cmd: testRestartGci
args: T6
......@@ -30,35 +30,6 @@
#include <mgmapi.h>
#include "CpcClient.hpp"
/**
psuedo code for run-test.bin
define autotest_wrapper process at each host
start ndb-processes
for each testcase
do
start mysqld processes
start replication processes
start test programs
wait until test program finished or max time passed
stop test program
stop replication processes
stop mysqld processes
write report data-file
if test failed and ! last test
restart ndb processes
drop all tables created by test
done
stop ndb processes
undefined wrapper processes
*/
/** Global variables */
static const char progname[] = "ndb_atrt";
static const char * g_gather_progname = "atrt-gather-result.sh";
......@@ -75,6 +46,7 @@ static const char * g_report_filename = 0;
static const char * g_default_user = 0;
static const char * g_default_base_dir = 0;
static int g_default_base_port = 0;
static int g_mysqld_use_base = 1;
static int g_report = 0;
static int g_verbosity = 0;
......@@ -385,6 +357,7 @@ setup_config(atrt_config& config){
int lineno = 0;
char buf[2048];
BaseString connect_string;
int mysql_port_offset = 0;
while(fgets(buf, 2048, f)){
lineno++;
......@@ -416,6 +389,11 @@ setup_config(atrt_config& config){
continue;
}
if(split1[0].trim() == "mysqld-use-base" && split1[1].trim() == "no"){
g_mysqld_use_base = 0;
continue;
}
Vector<BaseString> hosts;
if(split1[1].trim().split(hosts) <= 0){
g_logger.warning("Invalid line %d in %s - ignoring",
......@@ -490,6 +468,21 @@ setup_config(atrt_config& config){
proc.m_proc.m_path.assign(dir).append("/libexec/ndbd");
proc.m_proc.m_args = "-i -n";
proc.m_proc.m_cwd.appfmt("%d.ndbd", index);
} else if(split1[0] == "mysqld"){
proc.m_type = atrt_process::MYSQL_SERVER;
proc.m_proc.m_name.assfmt("%d-%s", index, "mysqld");
proc.m_proc.m_path.assign(dir).append("/libexec/mysqld");
proc.m_proc.m_args = "--core-file --ndbcluster";
proc.m_proc.m_cwd.appfmt("%d.mysqld", index);
if(mysql_port_offset > 0 || g_mysqld_use_base){
// setup mysql specific stuff
const char * basedir = proc.m_proc.m_cwd.c_str();
proc.m_proc.m_args.appfmt("--datadir=%s", basedir);
proc.m_proc.m_args.appfmt("--pid-file=%s/mysql.pid", basedir);
proc.m_proc.m_args.appfmt("--socket=%s/mysql.sock", basedir);
proc.m_proc.m_args.appfmt("--port=%d",
g_default_base_port-(++mysql_port_offset));
}
} else if(split1[0] == "api"){
proc.m_type = atrt_process::NDB_API;
proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api");
......@@ -714,7 +707,7 @@ bool
start_processes(atrt_config& config, int types){
for(size_t i = 0; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
if((types & proc.m_type) != 0){
if((types & proc.m_type) != 0 && proc.m_proc.m_path != ""){
if(!start_process(proc)){
return false;
}
......@@ -782,18 +775,24 @@ update_status(atrt_config& config, int){
for(size_t i = 0; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
Vector<SimpleCpcClient::Process> & h_procs = m_procs[proc.m_host->m_index];
bool found = false;
for(size_t j = 0; j<h_procs.size(); j++){
if(proc.m_proc.m_id == h_procs[j].m_id){
found = true;
proc.m_proc.m_status = h_procs[j].m_status;
break;
if(proc.m_proc.m_id != -1){
Vector<SimpleCpcClient::Process> &h_procs= m_procs[proc.m_host->m_index];
bool found = false;
for(size_t j = 0; j<h_procs.size(); j++){
if(proc.m_proc.m_id == h_procs[j].m_id){
found = true;
proc.m_proc.m_status = h_procs[j].m_status;
break;
}
}
if(!found){
g_logger.error("update_status: not found");
g_logger.error("id: %d host: %s cmd: %s",
proc.m_proc.m_id,
proc.m_hostname.c_str(),
proc.m_proc.m_path.c_str());
return false;
}
}
if(!found){
g_logger.error("update_status: not found");
return false;
}
}
return true;
......@@ -900,16 +899,24 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){
return false;
}
for(size_t i = 0; i<config.m_processes.size(); i++){
size_t i = 0;
for(; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){
proc.m_proc.m_path.assign(proc.m_host->m_base_dir).append("/bin/").append(tc.m_command);
proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(),
tc.m_command.c_str());
proc.m_proc.m_args.assign(tc.m_args);
return true;
break;
}
}
return false;
for(i++; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){
proc.m_proc.m_path.assign("");
proc.m_proc.m_args.assign("");
}
}
return true;
}
bool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment