summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmysql-test/mysql-test-run.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 8f5d5d4014c..db86108483d 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -294,6 +294,7 @@ my $exe_ndbd;
my $exe_ndbmtd;
my $exe_ndb_mgmd;
my $exe_ndb_waiter;
+my $exe_ndb_mgm;
our $debug_compiled_binaries;
@@ -1839,6 +1840,11 @@ sub executable_setup () {
["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"],
"ndb_mgmd");
+ $exe_ndb_mgm=
+ my_find_bin($bindir,
+ ["storage/ndb/src/mgmclient", "bin"],
+ "ndb_mgm");
+
$exe_ndb_waiter=
my_find_bin($bindir,
["storage/ndb/tools/", "bin"],
@@ -2644,6 +2650,27 @@ sub ndb_mgmd_wait_started($) {
return 1;
}
+sub ndb_mgmd_stop{
+ my $ndb_mgmd= shift or die "usage: ndb_mgmd_stop(<ndb_mgmd>)";
+
+ my $host=$ndb_mgmd->value('HostName');
+ my $port=$ndb_mgmd->value('PortNumber');
+ mtr_verbose("Stopping cluster '$host:$port'");
+
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--ndb-connectstring=%s:%s", $host,$port);
+ mtr_add_arg($args, "-e");
+ mtr_add_arg($args, "shutdown");
+
+ My::SafeProcess->run
+ (
+ name => "ndb_mgm shutdown $host:$port",
+ path => $exe_ndb_mgm,
+ args => \$args,
+ output => "/dev/null",
+ );
+}
sub ndb_mgmd_start ($$) {
my ($cluster, $ndb_mgmd)= @_;
@@ -2671,6 +2698,7 @@ sub ndb_mgmd_start ($$) {
error => $path_ndb_mgmd_log,
append => 1,
verbose => $opt_verbose,
+ shutdown => sub { ndb_mgmd_stop($ndb_mgmd) },
);
mtr_verbose("Started $ndb_mgmd->{proc}");
@@ -2686,6 +2714,11 @@ sub ndb_mgmd_start ($$) {
return 0;
}
+sub ndbd_stop {
+ # Intentionally left empty, ndbd nodes will be shutdown
+ # by sending "shutdown" to ndb_mgmd
+}
+
my $exe_ndbmtd_counter= 0;
sub ndbd_start {
@@ -2721,6 +2754,7 @@ sub ndbd_start {
error => $path_ndbd_log,
append => 1,
verbose => $opt_verbose,
+ shutdown => sub { ndbd_stop($ndbd) },
);
mtr_verbose("Started $proc");