mariadb/mysql-test/lib
unknown f4d209b015 Partial fix for BUG#14106: IM: im_life_cycle and im_utils
tests fail on FreeBSD.

The patch contains of the following:
  - make Instance Manager, running in the daemon mode, dump
    the pid of angel-process in the special file;
  - default value of angel-pid-file-name is 'mysqlmanager.angel.pid';
  - if ordinary (IM) pid-file-name is specified in the configuration,
    angel-pid-file-name is updated according to the following
    rule: extension of the basename of pid-file-name is replaced by
    '.angel.pid.
    For example:
    - pid-file-name: /tmp/im.pid
      => angel-pid-file-name: /tmp/im.angel.pid
    - pid-file-name: /tmp/im.txt
      => angel-pid-file-name: /tmp/im.angel.pid
    - pid-file-name: /tmp/5.0/im
      => angel-pid-file-name: /tmp/5.0/im.angel.pid
  - add support for configuration option to customize angel
    pid file name;
  - fix test suite to use angel pid to kill Instance Manager
    by all means if something went wrong.

Background
----------

The problem is that on some OSes (FreeBSD for one) Instance
Manager does not get SIGTERM, so can not shutdown gracefully.
Test suite wasn't able to cope with it, so this leads to the
mess in test results.

The problem should be split into two:
  - fix signal handling;
  - fix test suite.

This patch fixes test suite so that it will be able to kill
uncooperative Instance Manager. In order to achieve this,
test suite needs to know PID of IM Angel process.


mysql-test/lib/mtr_process.pl:
  Added a function to send a signal to a process.
mysql-test/mysql-test-run.pl:
  Changed procedure of stopping Instance Manager.
  1. Try to stop IM normally (by sending SIGTERM);
  2. If one of IM-related processes is still alive,
  kill them all by SIGKILL and complain in the log.
server-tools/instance-manager/manager.cc:
  Made create_pid_file() available for the whole project.
server-tools/instance-manager/manager.h:
  Made create_pid_file() available for the whole project.
server-tools/instance-manager/mysqlmanager.cc:
  Dump PID of angel process into file.
server-tools/instance-manager/options.cc:
  Added an option to allow to customize angel pid file name.
server-tools/instance-manager/options.h:
  Added an option to allow to customize angel pid file name.
2006-05-06 13:57:56 +04:00
..
init_db.sql Change the "Password" column type for the Perl suite running the tests. bug#14023 2005-10-14 13:35:36 +02:00
mtr_cases.pl Merge 2006-03-09 00:40:52 +01:00
mtr_diff.pl mysql-test-run.pl: 2005-03-29 07:29:38 +02:00
mtr_gcov.pl Many files: 2004-12-30 16:34:01 +01:00
mtr_gprof.pl Many files: 2004-12-30 16:34:01 +01:00
mtr_io.pl mysql-test-run.pl: 2005-02-03 21:13:27 +01:00
mtr_match.pl Start cluster only for testcases that really needs it and stop it when 2006-02-09 09:40:48 +01:00
mtr_misc.pl Return empty string if file does not exist 2006-04-27 21:26:24 +02:00
mtr_process.pl Partial fix for BUG#14106: IM: im_life_cycle and im_utils 2006-05-06 13:57:56 +04:00
mtr_report.pl Dump result to .log file at test failure 2006-03-23 21:48:31 +01:00
mtr_stress.pl Start cluster only for testcases that really needs it and stop it when 2006-02-09 09:40:48 +01:00
mtr_timer.pl Fix bug in mysql-test-run.pl in ^C signal handler. 2006-03-16 11:21:18 +01:00