Commit 72d0ba1b authored by unknown's avatar unknown
Browse files

Merge localhost:/home/jonas/src/51-work

into  eel.(none):/home/jonas/src/51-work

parents ef7effc4 28fd0d04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ LDADD_LOC = \
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_util.mk.am

ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@
ndb_cpcd_LDFLAGS = -static @ndb_bin_am_ldflags@

# Don't update the files from bitkeeper
%::SCCS/s.%
+1 −1
Original line number Diff line number Diff line
@@ -836,7 +836,7 @@ InitConfigFileParser::parse_mycnf()
    opt.arg_type = REQUIRED_ARG;
    options.push_back(opt);

    opt.name = "api";
    opt.name = "ndbapi";
    opt.id = 256;
    opt.value = (gptr*)malloc(sizeof(char*));
    opt.var_type = GET_STR;
+14 −8
Original line number Diff line number Diff line
@@ -18,20 +18,18 @@ testdir=$(prefix)/mysql-test/ndb
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_util.mk.am
include $(top_srcdir)/storage/ndb/config/type_mgmapiclient.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapitools.mk.am

test_PROGRAMS = atrt
test_DATA=daily-basic-tests.txt daily-devel-tests.txt 16node-tests.txt \
          conf-daily-basic-ndb08.txt \
          conf-daily-devel-ndb08.txt \
          conf-daily-sql-ndb08.txt \
          conf-ndbmaster.txt \
          conf-shark.txt \
          conf-dl145a.txt
          conf-ndbmaster.cnf \
          conf-dl145a.cnf test-tests.txt

test_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
          atrt-clear-result.sh autotest-run.sh

atrt_SOURCES = main.cpp setup.cpp files.cpp

atrt_SOURCES = main.cpp run-test.hpp
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/test/include
LDADD_LOC = $(top_builddir)/storage/ndb/test/src/libNDBT.a \
	    $(top_builddir)/storage/ndb/src/libndbclient.la \
@@ -39,6 +37,14 @@ LDADD_LOC = $(top_builddir)/storage/ndb/test/src/libNDBT.a \
            $(top_builddir)/mysys/libmysys.a \
            $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@

atrt_CXXFLAGS = -I$(top_srcdir)/ndb/src/mgmapi \
                      -I$(top_srcdir)/ndb/src/mgmsrv \
                      -I$(top_srcdir)/ndb/include/mgmcommon \
                      -DMYSQLCLUSTERDIR="\"\"" \
                 -DDEFAULT_PREFIX="\"$(prefix)\""

atrt_LDFLAGS = -static @ndb_bin_am_ldflags@

wrappersdir=$(prefix)/bin
wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run

+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ rm -rf *

while [ $# -gt 0 ]
do
  rsync -a "$1" .
  rsync -a --exclude='ndb_*_fs/*' "$1" .
  shift
done

+161 −0
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2 of the License.
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,68 +17,112 @@
#ifndef atrt_config_hpp
#define atrt_config_hpp

#include <getarg.h>
#include <ndb_global.h>
#include <Vector.hpp>
#include <BaseString.hpp>
#include <Logger.hpp>
#include <mgmapi.h>
#include <CpcClient.hpp>
#include <Properties.hpp>

#undef MYSQL_CLIENT

enum ErrorCodes {
enum ErrorCodes 
{
  ERR_OK = 0,
  ERR_NDB_FAILED = 101,
  ERR_SERVERS_FAILED = 102,
  ERR_MAX_TIME_ELAPSED = 103
};

struct atrt_host {
struct atrt_host 
{
  size_t m_index;
  BaseString m_user;
  BaseString m_base_dir;
  BaseString m_basedir;
  BaseString m_hostname;
  SimpleCpcClient * m_cpcd;
  Vector<struct atrt_process*> m_processes;
};

struct atrt_options
{
  enum Feature {
    AO_REPLICATION = 1,
    AO_NDBCLUSTER = 2
  };
  
struct atrt_process {
  int m_features;
  Properties m_loaded;
  Properties m_generated;
};

struct atrt_process 
{
  size_t m_index;
  BaseString m_hostname;
  struct atrt_host * m_host;
  struct atrt_cluster * m_cluster;

  enum Type {
    ALL = 255,
    NDB_DB = 1,
    NDB_API = 2,
    NDB_MGM = 4,
    NDB_REP = 8,
    MYSQL_SERVER = 16,
    MYSQL_CLIENT = 32
    AP_ALL          = 255
    ,AP_NDBD         = 1
    ,AP_NDB_API      = 2
    ,AP_NDB_MGMD     = 4
    ,AP_MYSQLD       = 16
    ,AP_CLIENT       = 32
    ,AP_CLUSTER      = 256 // Used for options parsing for "cluster" options
  } m_type;

  SimpleCpcClient::Process m_proc;
  short m_ndb_mgm_port;
  
  NdbMgmHandle m_ndb_mgm_handle;   // if type == ndb_mgm
  atrt_process * m_mysqld;         // if type == client
  atrt_process * m_rep_src;        // if type == mysqld
  Vector<atrt_process*> m_rep_dst; // if type == mysqld
  
  atrt_options m_options;
};

struct atrt_cluster
{
  BaseString m_name;
  BaseString m_dir;
  Vector<atrt_process*> m_processes;
  atrt_options m_options;
};

struct atrt_config {
struct atrt_config 
{
  bool m_generated;
  BaseString m_key;
  Vector<atrt_host> m_hosts;
  Vector<atrt_process> m_processes;
  BaseString m_replication;
  Vector<atrt_host*> m_hosts;
  Vector<atrt_cluster*> m_clusters;
  Vector<atrt_process*> m_processes;
};

struct atrt_testcase {
struct atrt_testcase 
{
  bool m_report;
  bool m_run_all;
  time_t m_max_time;
  BaseString m_command;
  BaseString m_args;
  BaseString m_name;
};

extern Logger g_logger;

bool parse_args(int argc, const char** argv);
void require(bool x);
bool parse_args(int argc, char** argv);
bool setup_config(atrt_config&);
bool configure(atrt_config&, int setup);
bool setup_directories(atrt_config&, int setup);
bool setup_files(atrt_config&, int setup, int sshx);

bool deploy(atrt_config&);
bool sshx(atrt_config&, unsigned procmask);
bool start(atrt_config&, unsigned procmask);

bool remove_dir(const char *, bool incl = true);
bool connect_hosts(atrt_config&);
bool connect_ndb_mgm(atrt_config&);
bool wait_ndb(atrt_config&, int ndb_mgm_node_status);
@@ -92,4 +137,25 @@ bool setup_test_case(atrt_config&, const atrt_testcase&);

bool setup_hosts(atrt_config&);

/**
 * Global variables...
 */
extern Logger g_logger;
extern atrt_config g_config;

extern const char * g_cwd;
extern const char * g_my_cnf;
extern const char * g_user;
extern const char * g_basedir;
extern const char * g_prefix;
extern int          g_baseport;
extern int          g_fqpn;
extern int          g_default_ports;

extern const char * g_clusters;

extern const char *save_file;
extern const char *save_group_suffix;
extern char *save_extra_file;

#endif
Loading