Separate test cleanup code in output and clean up ctdb restart code.
authorMartin Schwenke <martin@meltin.net>
Fri, 3 Jul 2009 07:40:16 +0000 (17:40 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 7 Jul 2009 23:40:11 +0000 (09:40 +1000)
commit56ece515e047a54f33e8b07726e52ba21a1d67e1
treea9a5cd360a104780364f29f0c17039edb52c6ecd
parentbebb21f18e3026cb78a306104e92ee005d1077b2
Separate test cleanup code in output and clean up ctdb restart code.

* ctdb_restart_when_done() now schedules a restart by setting an
  explicit variable that is respected in ctdb_test_exit(), rather than
  adding a restart to $ctdb_test_exit_hook.  This means that restarts
  are all done in one place.

* ctdb_test_exit() turns off "set -e" to make sure that all cleanup
  happens.

* ctdb_test_exit() now prints a clear message indicating where the
  test ends and the cleanup begins.  This message also includes the
  return code of the test.

* Add debug in cluster_is_healthy to try to capture information about
  unexpected unhealthiness when a test starts.

* Simplify simple/07_ctdb_process_exists.sh so that the exit code is
  generated more obviously.

* Remove redundant calls to ctdb_test_exit at the end of tests, since
  they're done automatically via a trap.  Also remove any preceding
  warnings of restarts or final hints about test success/failure.

* Allow multi-digit debug levels in simple/12_ctdb_getdebug.sh and
  simple/13_ctdb_setdebug.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>
36 files changed:
tests/scripts/ctdb_test_functions.bash
tests/simple/00_ctdb_init.sh
tests/simple/01_ctdb_version.sh
tests/simple/02_ctdb_listvars.sh
tests/simple/03_ctdb_getvar.sh
tests/simple/04_ctdb_setvar.sh
tests/simple/05_ctdb_listnodes.sh
tests/simple/06_ctdb_getpid.sh
tests/simple/07_ctdb_process_exists.sh
tests/simple/08_ctdb_isnotrecmaster.sh
tests/simple/09_ctdb_ping.sh
tests/simple/11_ctdb_ip.sh
tests/simple/12_ctdb_getdebug.sh
tests/simple/13_ctdb_setdebug.sh
tests/simple/14_ctdb_statistics.sh
tests/simple/15_ctdb_statisticsreset.sh
tests/simple/16_ctdb_config_add_ip.sh
tests/simple/17_ctdb_config_delete_ip.sh
tests/simple/18_ctdb_freeze.sh
tests/simple/19_ctdb_thaw.sh
tests/simple/20_ctdb_getmonmode.sh
tests/simple/21_ctdb_disablemonitor.sh
tests/simple/22_ctdb_enablemonitor.sh
tests/simple/23_ctdb_moveip.sh
tests/simple/24_ctdb_getdbmap.sh
tests/simple/25_dumpmemory.sh
tests/simple/26_ctdb_config_check_error_on_unreachable_ctdb.sh
tests/simple/31_ctdb_disable.sh
tests/simple/32_ctdb_enable.sh
tests/simple/41_ctdb_ban.sh
tests/simple/42_ctdb_unban.sh
tests/simple/51_ctdb_bench.sh
tests/simple/52_ctdb_fetch.sh
tests/simple/53_ctdb_transaction.sh
tests/simple/61_ctdb_persistent_safe.sh
tests/simple/62_ctdb_persistent_unsafe.sh