diff options
Diffstat (limited to 'ndb/test/run-test')
-rw-r--r-- | ndb/test/run-test/Makefile.am | 18 | ||||
-rw-r--r-- | ndb/test/run-test/Makefile_old (renamed from ndb/test/run-test/Makefile) | 0 | ||||
-rw-r--r-- | ndb/test/run-test/README | 43 | ||||
-rw-r--r-- | ndb/test/run-test/atrt-example.tgz | bin | 0 -> 2196 bytes | |||
-rw-r--r-- | ndb/test/run-test/basic.txt | 763 | ||||
-rw-r--r-- | ndb/test/run-test/main.cpp | 150 | ||||
-rwxr-xr-x | ndb/test/run-test/make-html-reports.sh | 406 |
7 files changed, 993 insertions, 387 deletions
diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am new file mode 100644 index 00000000000..3dd9632ce4b --- /dev/null +++ b/ndb/test/run-test/Makefile.am @@ -0,0 +1,18 @@ + +ndbtest_PROGRAMS = atrt + +atrt_SOURCES = main.cpp + +ndbtest_SCRIPTS = atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ + atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh +EXTRA_DIST = $(ndbtest_SCRIPTS) + +INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient +LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o $(top_builddir)/ndb/src/libndbclient.la + +include $(top_srcdir)/ndb/config/common.mk.am +include $(top_srcdir)/ndb/config/type_util.mk.am +include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/test/run-test/Makefile b/ndb/test/run-test/Makefile_old index 6b4689b2dbb..6b4689b2dbb 100644 --- a/ndb/test/run-test/Makefile +++ b/ndb/test/run-test/Makefile_old diff --git a/ndb/test/run-test/README b/ndb/test/run-test/README new file mode 100644 index 00000000000..d5da8f05c17 --- /dev/null +++ b/ndb/test/run-test/README @@ -0,0 +1,43 @@ +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 + */ + +================================= + diff --git a/ndb/test/run-test/atrt-example.tgz b/ndb/test/run-test/atrt-example.tgz Binary files differnew file mode 100644 index 00000000000..8455b2eb00d --- /dev/null +++ b/ndb/test/run-test/atrt-example.tgz diff --git a/ndb/test/run-test/basic.txt b/ndb/test/run-test/basic.txt new file mode 100644 index 00000000000..a952320db08 --- /dev/null +++ b/ndb/test/run-test/basic.txt @@ -0,0 +1,763 @@ +# 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 + diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index eb8a626dc2b..9e318b0219e 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -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; @@ -158,10 +130,17 @@ main(int argc, const char ** argv){ if(!start_processes(g_config, atrt_process::NDB_DB)) goto end; - - if(!wait_ndb(g_config, NDB_MGM_NODE_STATUS_STARTED)) - goto end; - + + if(!wait_ndb(g_config, NDB_MGM_NODE_STATUS_NOT_STARTED)) + goto end; + + for(Uint32 i = 0; i<3; i++) + if(wait_ndb(g_config, NDB_MGM_NODE_STATUS_STARTED)) + goto started; + + goto end; + +started: g_logger.info("Ndb start completed"); } @@ -347,7 +326,7 @@ parse_args(int argc, const char** argv){ return false; } - g_default_user = strdup(getenv("USER")); + g_default_user = strdup(getenv("LOGNAME")); return true; } @@ -377,6 +356,8 @@ 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++; @@ -408,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", @@ -449,8 +435,10 @@ setup_config(atrt_config& config){ for(size_t i = 0; i<hosts.size(); i++){ BaseString & tmp = hosts[i]; atrt_host * host = find(tmp, config.m_hosts); + BaseString & dir = host->m_base_dir; const int index = config.m_processes.size() + 1; + atrt_process proc; proc.m_index = index; proc.m_host = host; @@ -458,8 +446,8 @@ setup_config(atrt_config& config){ proc.m_proc.m_type = "temporary"; proc.m_proc.m_owner = "atrt"; proc.m_proc.m_group = "group"; - proc.m_proc.m_cwd.assign(host->m_base_dir).append("/run/"); - proc.m_proc.m_env.assign("LD_LIBRARY_PATH=").append(host->m_base_dir).append("/lib"); + proc.m_proc.m_cwd.assign(dir).append("/run/"); + proc.m_proc.m_env.assfmt("LD_LIBRARY_PATH=%s/lib/mysql", dir.c_str()); proc.m_proc.m_stdout = "log.out"; proc.m_proc.m_stderr = "2>&1"; proc.m_proc.m_runas = proc.m_host->m_user; @@ -468,16 +456,33 @@ setup_config(atrt_config& config){ proc.m_ndb_mgm_port = g_default_base_port; if(split1[0] == "mgm"){ proc.m_type = atrt_process::NDB_MGM; - proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgm"); - proc.m_proc.m_path.assign(host->m_base_dir).append("/bin/mgmtsrvr"); + proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgmd"); + proc.m_proc.m_path.assign(dir).append("/libexec/ndb_mgmd"); proc.m_proc.m_args = "-n -c initconfig.txt"; - proc.m_proc.m_cwd.appfmt("%d.ndb_mgm", index); + proc.m_proc.m_cwd.appfmt("%d.ndb_mgmd", index); + connect_string.appfmt(";host=%s:%d", + proc.m_hostname.c_str(), proc.m_ndb_mgm_port); } else if(split1[0] == "ndb"){ proc.m_type = atrt_process::NDB_DB; - proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_db"); - proc.m_proc.m_path.assign(host->m_base_dir).append("/bin/ndb"); + proc.m_proc.m_name.assfmt("%d-%s", index, "ndbd"); + proc.m_proc.m_path.assign(dir).append("/libexec/ndbd"); proc.m_proc.m_args = "-i -n"; - proc.m_proc.m_cwd.appfmt("%d.ndb_db", index); + 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"); @@ -494,7 +499,13 @@ setup_config(atrt_config& config){ config.m_processes.push_back(proc); } } - + + // Setup connect string + for(size_t i = 0; i<config.m_processes.size(); i++){ + config.m_processes[i].m_proc.m_env.appfmt(" NDB_CONNECTSTRING=nodeid=%d%s", + i+1, connect_string.c_str()); + } + end: fclose(f); return result; @@ -622,6 +633,11 @@ wait_ndb(atrt_config& config, int goal){ g_logger.critical("Strange DB status during start: %d %d", i, min2); return false; } + + if(min2 < min){ + g_logger.critical("wait ndb failed node: %d %d %d %d", + state->node_states[i].node_id, min, min2, goal); + } } } @@ -691,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; } @@ -759,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; @@ -877,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 diff --git a/ndb/test/run-test/make-html-reports.sh b/ndb/test/run-test/make-html-reports.sh index 079650a729f..89f13a4b62a 100755 --- a/ndb/test/run-test/make-html-reports.sh +++ b/ndb/test/run-test/make-html-reports.sh @@ -1,106 +1,23 @@ #!/bin/sh -# NAME -# make-html-reports.sh -# -# SYNOPSIS -# make-html-reports.sh [-q] [ -R <YYYY-MM-DD> ] [ -s <src dir> ] [ -d <dst dir> ] [ -c <conf dir> ] -# -# DESCRIPTION -# -# OPTIONS -# -# EXAMPLES -# -# -# ENVIRONMENT -# NDB_PROJ_HOME Home dir for ndb -# -# FILES -# $NDB_PROJ_HOME/lib/funcs.sh general shell script functions -# -# -# SEE ALSO -# -# DIAGNOSTICTS -# -# VERSION -# 1.0 -# -# AUTHOR -# Jonas Oreland -# - -progname=`basename $0` -synopsis="make-html-reports.sh [ -R <YYYY-MM-DD> ] [ -s <src dir> ] [ -d <dst dir> ] [ -c <conf dir> ]" - -: ${NDB_PROJ_HOME:?} # If undefined, exit with error message - -: ${NDB_LOCAL_BUILD_OPTIONS:=--} # If undef, set to --. Keeps getopts happy. - # You may have to experiment a bit - # to get quoting right (if you need it). - - -. $NDB_PROJ_HOME/lib/funcs.sh # Load some good stuff - -# defaults for options related variables -# - - -src_dir=`pwd` -dst_dir=`pwd` -conf_dir=`pwd` -report_date=`date '+%Y-%m-%d'` -uniq_id=$$.$$ -verbose=yes - -# used if error when parsing the options environment variable -# -env_opterr="options environment variable: <<$options>>" - -# Option parsing, for the options variable as well as the command line. -# -# We want to be able to set options in an environment variable, -# as well as on the command line. In order not to have to repeat -# the same getopts information twice, we loop two times over the -# getopts while loop. The first time, we process options from -# the options environment variable, the second time we process -# options from the command line. -# -# The things to change are the actual options and what they do. -# -# - -for optstring in "$options" "" # 1. options variable 2. cmd line -do - - while getopts q:s:R:d:c: i $optstring # optstring empty => no arg => cmd line - do - case $i in - - q) verbose="";; # echo important things - d) dst_dir=$OPTARG;; # Destination directory - s) src_dir=$OPTARG;; # Destination directory - c) conf_dir=$OPTARG;; # - R) report_date=$OPTARG;; # - \?) syndie $env_opterr;; # print synopsis and exit - - esac - done - - [ -n "$optstring" ] && OPTIND=1 # Reset for round 2, cmdline options - env_opterr= # Round 2 should not use the value +src_dir=$1 +run=$2 +date=$3 +src_file=$src_dir/report.txt -done -shift `expr $OPTIND - 1` - -src_dir=`abspath $src_dir` -dst_dir=`abspath $dst_dir` -conf_dir=`abspath $conf_dir` +if [ ! -f $src_dir/report.txt ] +then + echo "$src_dir/report.txt is missing" + exit 1 +fi ### # # General html functions +trim(){ + echo $* +} + header(){ cat <<EOF <html><head><title>$*</title></head> @@ -166,64 +83,7 @@ hr(){ EOF } -# --- option parsing done --- - # -- Verify -trace "Verifying arguments" -summary_file=$src_dir/reports/summary.$report_date - -if [ ! -r $summary_file ] -then - syndie "Invalid src directory or report date: $summary_file not found" -fi - -if [ ! -d $conf_dir/configurations ] -then - syndie "Invalid src directory: $conf_dir/configurations not found" -fi - -if [ ! -d $conf_dir/testcases ] -then - syndie "Invalid src directory: $conf_dir/testcases not found" -fi - -if [ ! -d $dst_dir ] -then - syndie "Invalid dst dir..." -fi - -# --- option verifying done --- - -trace "src_dir: $src_dir" -trace "dst_dir: $dst_dir" -trace "conf_dir: $conf_dir" -trace "report date: $report_date" - -### -config_spec(){ - cat <<EOF -<a href=#$1>$1</a> -EOF -} - -config_spec_include(){ - # Print the $1 file to the file we are generating - cat <<EOF -<a name=$1><pre> -EOF - if [ -r $conf_dir/configurations/$1 ] - then - cat -E $conf_dir/configurations/$1 | sed 's/\$/<BR>/g' - else - cat <<EOF - Config spec $1 not found -EOF - fi -cat <<EOF -</pre></a> -EOF -} - time_spec(){ # $1 - secs _ts_tmp=$1 @@ -232,8 +92,14 @@ time_spec(){ _ts_tmp=`expr $_ts_tmp / 60` _ts_m=`expr $_ts_tmp % 60` - _ts_tmp=`expr $_ts_tmp / 60` + if [ $_ts_tmp -ge 60 ] + then + _ts_tmp=`expr $_ts_tmp / 60` + else + _ts_tmp=0 + fi + a=3 _ts_h=$_ts_tmp if [ $_ts_h -gt 0 ] @@ -247,191 +113,77 @@ time_spec(){ echo $ret } -log_spec(){ - _ff_=$src_dir/log/$report_date/$1.$2/test.$3.out - if [ -r $_ff_ ] && [ -s $_ff_ ] - then - _f2_=$dst_dir/log.$report_date.$1.$2.$3.out.gz - if [ -r $_f2_ ] - then - rm $_f2_ - fi - cp $_ff_ $dst_dir/log.$report_date.$1.$2.$3.out - gzip $dst_dir/log.$report_date.$1.$2.$3.out - rm -f $dst_dir/log.$report_date.$1.$2.$3.out - echo "<a href=log.$report_date.$1.$2.$3.out.gz>Log file</a>" - else - echo "-" - fi -} +### Main -err_spec(){ - _ff_=$src_dir/log/$report_date/$1.$2/test.$3.err.tar - if [ -r $_ff_ ] && [ -s $_ff_ ] - then - cp $_ff_ $dst_dir/err.$report_date.$1.$2.$3.err.tar - gzip $dst_dir/err.$report_date.$1.$2.$3.err.tar - rm -f $dst_dir/err.$report_date.$1.$2.$3.err.tar - echo "<a href=err.$report_date.$1.$2.$3.err.tar.gz>Error tarball</a>" - else - echo "-" - fi -} +report_file=$src_dir/report.html +summary_file=$src_dir/summary.html -command_spec(){ - echo $* | sed 's/;/<BR>/g' -} +passed=0 +failed=0 +total=0 -### Main +pass(){ + passed=`expr $passed + 1` +} -html_summary_file=$dst_dir/summary.$report_date.html +fail(){ + failed=`expr $failed + 1` +} -trace "Creating summary" ( - eval `grep "TOTAL" $summary_file | awk -F";" '{ printf("test_file=\"%s\"; elapsed=\"%s\"; started=\"%s\"; stopped=\"%s\"", $2, $3, $4, $5); }'` - - header "Autotest summary $report_date" - heading 1 "Autotest summary $report_date" - table - row ; column `bold test file: `; column $test_file ; end_row - row ; column `bold Started:` ; column "$started "; end_row - row ; column `bold Stopped:` ; column "$stopped "; end_row - row ; column `bold Elapsed:` ; column "`time_spec $elapsed secs`" ; end_row - end_table - hr - - table "border=1" - row - c_column `bold Report` - c_column `bold Tag` - c_column `bold Version` - c_column `bold Distr-Config` - c_column `bold Db-Config` - c_column `bold Type` - c_column `bold Test file` - c_column `bold Make` - c_column `bold Config` - c_column `bold Test time` - c_column `bold Passed` - c_column `bold Failed` - end_row - - grep -v "^#" $summary_file | grep -v TOTAL | sed 's/;/ /g' | \ - while read tag version config template type test_file make_res make_time conf_res conf_time test_time passed failed - do + header Report $run $date + table "border=1" row - if [ -r $src_dir/reports/report.$tag.$version.$config.$template.$type.$test_file.$report_date ] - then - column "<a href=\"report.$tag.$version.$config.$template.$type.$test_file.$report_date.html\">report</a>" - else - column "-" - fi - - column $tag - column $version - column $config - column $template - column $type - column $test_file - column "$make_res(`time_spec $make_time`)" - column "$conf_res(`time_spec $conf_time`)" - c_column "`time_spec $test_time`" - c_column `bold $passed` - c_column `bold $failed` + column `bold Test case` + column `bold Result` + column `bold Elapsed` + column `bold Log` end_row - done - end_table +) > $report_file - footer -) > $html_summary_file - -for i in $src_dir/reports/report.*.$report_date +cat $src_file | while read line do - f=`basename $i` - trace "Creating report: $f" - eval `echo $f | awk -F"." '{printf("tag=%s;version=%s;config=%s;template=%s;type=%s;test_file=%s", $2, $3, $4, $5, $6, $7);}'` - - ( - header "Autotest report $report_date" - heading 1 "Autotest report $report_date" - table #"border=1" - row ; column `bold Tag:`; column $tag ; end_row - row ; column `bold Version:` ; column $version ; end_row - row ; column `bold Configuration:` ; column `config_spec $config`; end_row - row ; column `bold Template:` ; column `config_spec $template`; end_row - row ; column `bold Type:` ; column $type ; end_row - row ; column `bold Test file:` ; column $test_file; end_row - end_table - hr - - table "border=1" - row - c_column `bold Test case` - c_column `bold Result` - c_column `bold Test time` - c_column `bold Logfile` - c_column `bold Error tarfile` - end_row - - grep -v "^#" $i | sed 's/;/ /g' | \ - while read test_no test_res test_time cmd - do - row - column "`command_spec $cmd`" - case "$test_res" in - 0) - column "PASSED";; - 1001) - column "API error";; - 1002) - column "Max time expired";; - 1003) - column "Mgm port busy";; - *) - column "Unknown: $test_res";; - esac - - column "`time_spec $test_time`" - - column "`log_spec $tag $version $test_no`" - column "`err_spec $tag $version $test_no`" - end_row - done - end_table - - # Last on page we include spec - # of used machines and template for config - # for future reference - hr - table "border=1" - row; column `bold Configuration:` $config; end_row - row; column `config_spec_include $config`; end_row - end_table - hr - table "border=1" - row; column `bold Template:` $template; end_row - row; column `config_spec_include $template`; end_row - end_table - - footer - - ) > $dst_dir/$f.html + eval `echo $line | awk -F";" '{ printf("prg=\"%s\"; no=\"%s\"; res=\"%s\"; time=\"%s\"", $1, $2, $3, $4); }'` + + prg=`trim $prg` + no=`trim $no` + res=`trim $res` + time=`trim $time` + res_dir="<a href=\"result.$no/\">log</a>" + + ts=`time_spec $time` + res_txt="" + case $res in + 0) pass; res_txt="PASSED"; res_dir=" ";; + *) fail; res_txt="FAILED";; + esac + total=`expr $total + $time` + + ( + row + column $prg + column $res_txt + column $ts + column $res_dir + end_row + ) >> $report_file + + ( + row + column $run + column $date + column $passed + column $failed + column `time_spec $total` + column "<a href=\"result-$run/$date/report.html\">report</a>" + column "<a href=\"result-$run/$date/log.txt\">log.txt</a>" + end_row + ) > $summary_file done -# Re creating index -trace "Recreating index" ( - header "Autotest super-duper index" - heading 1 "<center>Autotest super-duper index</center>" - hr - for i in `ls $dst_dir/summary.*.html | sort -r -n` - do - f=`basename $i` - cat <<EOF -<p><a href=$f>$f</a></p> -EOF - done - footer -) > $dst_dir/index.html + end_table + footer +) >> $report_file exit 0 |