Commit 749a1f9a authored by joreland@mysql.com's avatar joreland@mysql.com

ndb - add support for mysql servers in autotest

parent 208e534a
...@@ -116,10 +116,7 @@ main(int argc, const char ** argv){ ...@@ -116,10 +116,7 @@ main(int argc, const char ** argv){
*/ */
if(restart){ if(restart){
g_logger.info("(Re)starting ndb processes"); g_logger.info("(Re)starting ndb processes");
if(!stop_processes(g_config, atrt_process::NDB_MGM)) if(!stop_processes(g_config, ~0))
goto end;
if(!stop_processes(g_config, atrt_process::NDB_DB))
goto end; goto end;
if(!start_processes(g_config, atrt_process::NDB_MGM)) if(!start_processes(g_config, atrt_process::NDB_MGM))
...@@ -142,6 +139,9 @@ main(int argc, const char ** argv){ ...@@ -142,6 +139,9 @@ main(int argc, const char ** argv){
goto end; goto end;
started: started:
if(!start_processes(g_config, p_servers))
goto end;
g_logger.info("Ndb start completed"); g_logger.info("Ndb start completed");
} }
...@@ -158,9 +158,6 @@ main(int argc, const char ** argv){ ...@@ -158,9 +158,6 @@ main(int argc, const char ** argv){
if(!setup_test_case(g_config, test_case)) if(!setup_test_case(g_config, test_case))
goto end; goto end;
if(!start_processes(g_config, p_servers))
goto end;
if(!start_processes(g_config, p_clients)) if(!start_processes(g_config, p_clients))
goto end; goto end;
...@@ -201,9 +198,6 @@ main(int argc, const char ** argv){ ...@@ -201,9 +198,6 @@ main(int argc, const char ** argv){
if(!stop_processes(g_config, p_clients)) if(!stop_processes(g_config, p_clients))
goto end; goto end;
if(!stop_processes(g_config, p_servers))
goto end;
if(!gather_result(g_config, &result)) if(!gather_result(g_config, &result))
goto end; goto end;
...@@ -476,21 +470,18 @@ setup_config(atrt_config& config){ ...@@ -476,21 +470,18 @@ setup_config(atrt_config& config){
proc.m_proc.m_path.assign(dir).append("/libexec/mysqld"); proc.m_proc.m_path.assign(dir).append("/libexec/mysqld");
proc.m_proc.m_args = "--core-file --ndbcluster"; proc.m_proc.m_args = "--core-file --ndbcluster";
proc.m_proc.m_cwd.appfmt("%d.mysqld", index); 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"){ } else if(split1[0] == "api"){
proc.m_type = atrt_process::NDB_API; proc.m_type = atrt_process::NDB_API;
proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api"); proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api");
proc.m_proc.m_path = ""; proc.m_proc.m_path = "";
proc.m_proc.m_args = ""; proc.m_proc.m_args = "";
proc.m_proc.m_cwd.appfmt("%d.ndb_api", index); proc.m_proc.m_cwd.appfmt("%d.ndb_api", index);
} else if(split1[0] == "mysql"){
proc.m_type = atrt_process::MYSQL_CLIENT;
proc.m_proc.m_name.assfmt("%d-%s", index, "mysql");
proc.m_proc.m_path = "";
proc.m_proc.m_args = "";
proc.m_proc.m_cwd.appfmt("%d.mysql", index);
} else { } else {
g_logger.critical("%s:%d: Unhandled process type: %s", g_logger.critical("%s:%d: Unhandled process type: %s",
g_process_config_filename, lineno, g_process_config_filename, lineno,
...@@ -913,6 +904,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){ ...@@ -913,6 +904,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){
tc.m_report= true; tc.m_report= true;
else else
tc.m_report= false; tc.m_report= false;
if(p.get("run-all", &mt) && strcmp(mt, "yes") == 0)
tc.m_run_all= true;
else
tc.m_run_all= false;
return true; return true;
} }
...@@ -928,16 +924,17 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){ ...@@ -928,16 +924,17 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){
size_t i = 0; size_t i = 0;
for(; i<config.m_processes.size(); i++){ for(; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i]; atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){ if(proc.m_type == atrt_process::NDB_API || proc.m_type == atrt_process::MYSQL_CLIENT){
proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(), proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(),
tc.m_command.c_str()); tc.m_command.c_str());
proc.m_proc.m_args.assign(tc.m_args); proc.m_proc.m_args.assign(tc.m_args);
break; if(!tc.m_run_all)
break;
} }
} }
for(i++; i<config.m_processes.size(); i++){ for(i++; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i]; atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){ if(proc.m_type == atrt_process::NDB_API || proc.m_type == atrt_process::MYSQL_CLIENT){
proc.m_proc.m_path.assign(""); proc.m_proc.m_path.assign("");
proc.m_proc.m_args.assign(""); proc.m_proc.m_args.assign("");
} }
......
...@@ -69,6 +69,7 @@ struct atrt_config { ...@@ -69,6 +69,7 @@ struct atrt_config {
struct atrt_testcase { struct atrt_testcase {
bool m_report; bool m_report;
bool m_run_all;
time_t m_max_time; time_t m_max_time;
BaseString m_command; BaseString m_command;
BaseString m_args; BaseString m_args;
......
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