From 574b107a5704575d0353ac2771286be97a0ff597 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 4 Nov 2012 22:11:34 +0100 Subject: mtr.pl - improve the logic that decides when ndbcluster should be enabled and the extra test suites for MySQL Cluster should be added. Should be consistent and logical now ;) --- mysql-test/lib/mtr_cases.pm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'mysql-test/lib') diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index af059af7121..b3bc2a83b92 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -963,18 +963,11 @@ sub collect_one_test_case { if ( $tinfo->{'ndb_test'} ) { # This is a NDB test - if ( $::opt_skip_ndbcluster == 2 ) + if ( $::ndbcluster_enabled == 0) { - # Ndb is not supported, skip it + # ndbcluster is disabled $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "No ndbcluster support or ndb tests not enabled"; - return $tinfo; - } - elsif ( $::opt_skip_ndbcluster ) - { - # All ndb test's should be skipped - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)"; + $tinfo->{'comment'}= "ndbcluster disabled"; return $tinfo; } } -- cgit v1.2.1 From fe1bb698622e707b2443758711cba48f81a28d4d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Nov 2012 15:33:45 +0530 Subject: BUG #15895810 - REQUIRE ADDITIONAL INFORMATION WITH THE --RESULT-FILE OPTION OF MTR --- mysql-test/lib/mtr_report.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mysql-test/lib') diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index f6b3cf6bda5..af5b32ed939 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -27,7 +27,7 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line mtr_warning mtr_error mtr_debug mtr_verbose mtr_verbose_restart mtr_report_test_passed mtr_report_test_skipped mtr_print - mtr_report_test); + mtr_report_test isotime); use mtr_match; use My::Platform; @@ -109,6 +109,8 @@ sub mtr_report_test_passed ($) { $tinfo->{'result'}= 'MTR_RES_PASSED'; mtr_report_test($tinfo); + + resfile_global("endtime ", isotime (time)); } @@ -534,4 +536,12 @@ sub mtr_verbose_restart (@) { } +# Used by --result-file for for formatting times + +sub isotime($) { + my ($sec,$min,$hr,$day,$mon,$yr)= gmtime($_[0]); + return sprintf "%d-%02d-%02dT%02d:%02d:%02dZ", + $yr+1900, $mon+1, $day, $hr, $min, $sec; +} + 1; -- cgit v1.2.1 From 0e01efc036af4c1fea14fe424cfd6e169ba917b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Nov 2012 16:09:18 +0530 Subject: Bug #14757120 - SAFE_PROCESS.CC/SAFE_PROCESS.PL SHOULD NOT KILL MYSQLD ON SIGSTOP/SIGCONT --- mysql-test/lib/My/SafeProcess/safe_process.cc | 15 ++- mysql-test/lib/My/SafeProcess/safe_process.pl | 166 -------------------------- 2 files changed, 11 insertions(+), 170 deletions(-) delete mode 100644 mysql-test/lib/My/SafeProcess/safe_process.pl (limited to 'mysql-test/lib') diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index 2f906f3763b..3abda6e7f67 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -153,12 +153,19 @@ int main(int argc, char* const argv[] ) pid_t own_pid= getpid(); pid_t parent_pid= getppid(); bool nocore = false; + struct sigaction sa,sa_abort; + sa.sa_handler= handle_signal; + sa.sa_flags= SA_NOCLDSTOP; + sigemptyset(&sa.sa_mask); + + sa_abort.sa_handler= handle_abort; + sigemptyset(&sa_abort.sa_mask); /* Install signal handlers */ - signal(SIGTERM, handle_signal); - signal(SIGINT, handle_signal); - signal(SIGCHLD, handle_signal); - signal(SIGABRT, handle_abort); + sigaction(SIGTERM, &sa,NULL); + sigaction(SIGINT, &sa,NULL); + sigaction(SIGCHLD, &sa,NULL); + sigaction(SIGABRT, &sa_abort,NULL); sprintf(safe_process_name, "safe_process[%ld]", (long) own_pid); diff --git a/mysql-test/lib/My/SafeProcess/safe_process.pl b/mysql-test/lib/My/SafeProcess/safe_process.pl deleted file mode 100644 index 1b3c0aa9a5f..00000000000 --- a/mysql-test/lib/My/SafeProcess/safe_process.pl +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/perl -# -*- cperl -*- - -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -# -# 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. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -use strict; -use warnings; - -use lib 'lib'; -use My::SafeProcess::Base; -use POSIX qw(WNOHANG); - -########################################################################### -# Util functions -########################################################################### - -# -#Print message to stderr -# -my $verbose= 0; -sub message { - if ($verbose > 0){ - use Time::localtime; - my $tm= localtime(); - my $timestamp= sprintf("%02d%02d%02d %2d:%02d:%02d", - $tm->year % 100, $tm->mon+1, $tm->mday, - $tm->hour, $tm->min, $tm->sec); - print STDERR $timestamp, " monitor[$$]: ", @_, "\n"; - } -} - - -########################################################################### -# Main program -########################################################################### - -my $terminated= 0; - -# Protect against being killed in the middle -# of child creation, just set the terminated flag -# to make sure the child will be killed off -# when program is ready to do that -$SIG{TERM}= sub { message("!Got signal @_"); $terminated= 1; }; -$SIG{INT}= sub { message("!Got signal @_"); $terminated= 1; }; - -my $parent_pid= getppid(); - -my $found_double_dash= 0; -while (my $arg= shift(@ARGV)){ - - if ($arg =~ /^--$/){ - $found_double_dash= 1; - last; - } - elsif ($arg =~ /^--verbose$/){ - $verbose= 1; - } - else { - die "Unknown option: $arg"; - } -} - -my $path= shift(@ARGV); # Executable - -die "usage:\n" . - " safe_process.pl [opts] -- [ [...]]" - unless defined $path || $found_double_dash; - - -message("started"); -#message("path: '$path'"); -message("parent: $parent_pid"); - -# Start process to monitor -my $child_pid= - create_process( - path => $path, - args => \@ARGV, - setpgrp => 1, - ); -message("Started child $child_pid"); - -eval { - sub handle_signal { - $terminated= 1; - message("Got signal @_"); - - # Ignore all signals - foreach my $name (keys %SIG){ - $SIG{$name}= 'IGNORE'; - } - - die "signaled\n"; - }; - local $SIG{TERM}= \&handle_signal; - local $SIG{INT}= \&handle_signal; - local $SIG{CHLD}= sub { - message("Got signal @_"); - kill('KILL', -$child_pid); - my $ret= waitpid($child_pid, 0); - if ($? & 127){ - exit(65); # Killed by signal - } - exit($? >> 8); - }; - - # Monitoring loop - while(!$terminated) { - - # Check if parent is still alive - if (kill(0, $parent_pid) < 1){ - message("Parent is not alive anymore"); - last; - } - - # Wait for child to terminate but wakeup every - # second to also check that parent is still alive - my $ret_pid; - $ret_pid= waitpid($child_pid, &WNOHANG); - if ($ret_pid == $child_pid) { - # Process has exited, collect return status - my $ret_code= $? >> 8; - message("Child exit: $ret_code"); - # Exit with exit status of the child - exit ($ret_code); - } - sleep(1); - } -}; -if ( $@ ) { - # The monitoring loop should have been - # broken by handle_signal - warn "Unexpected: $@" unless ( $@ =~ /signaled/ ); -} - -# Use negative pid in order to kill the whole -# process group -# -my $ret= kill('KILL', -$child_pid); -message("Killed child: $child_pid, ret: $ret"); -if ($ret > 0) { - message("Killed child: $child_pid"); - # Wait blocking for the child to return - my $ret_pid= waitpid($child_pid, 0); - if ($ret_pid != $child_pid){ - message("unexpected pid $ret_pid returned from waitpid($child_pid)"); - } -} - -message("DONE!"); -exit (1); - - -- cgit v1.2.1 From 80fa4f58094affcfb13b454955ee372a2a61ea6c Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Mon, 26 Nov 2012 15:14:26 +0100 Subject: Reinstate install of mysql-test/lib/My/SafeProcess/Base.pm, removed by mistake --- mysql-test/lib/My/SafeProcess/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/lib') diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index c26256f5a9a..95e23756c30 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -29,3 +29,4 @@ INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/Safe IF(WIN32) INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) ENDIF() +INSTALL(FILES Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) -- cgit v1.2.1 From e7036ec1a287b2b2bac0cbf309ae0baf73320fb0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Apr 2013 14:51:16 +0200 Subject: mtr bug: files outside of both the suite dir and the overlay dir, were treated as coming from the overlay. (example: archive suite, test_sql_discovery overlay, mysql-test/include/have_archive.inc) --- mysql-test/lib/mtr_cases.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/lib') diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 32ec24da492..a82e3ee10b7 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -968,6 +968,8 @@ sub get_tags_from_file($$) { } elsif ($over and $file =~ m@^$pdir/(.*)$@) { $suffix = $1; @prefix = map { "$_/" } $sdir, $pdir; + } else { + $over = 0; # file neither in $sdir nor in $pdir } while (my $line= <$F>) -- cgit v1.2.1