1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/ctdb/tests/eventscripts
Martin Schwenke 2f2421bae1 ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes
Commit 4ee4925d41 forgot about
CTDB_NATGW_SLAVE_ONLY so it introduces an incorrect failure when this
is set, and CTDB_NATGW_PUBLIC_IFACE or CTDB_NATGW_PUBLIC_IP is unset.

Relax the sanity check to see if CTDB_NATGW_SLAVE_ONLY is set.

Update the documentation to explicitly state that
CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IP are optional and
unused if CTDB_NATGW_SLAVE_ONLY is set.  It would be possible to
insist that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IFACE should
be unset in that case.  However, it is more reasonable to allow
consistent configuration across nodes except with some nodes
configured slave-only.

Add tests, update infrastructure and fix a thinko in the stub's
"natgwlist" implementation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Apr 14 06:06:49 CEST 2014 on sn-devel-104
2014-04-14 06:06:49 +02:00
..
etc tests/eventscripts: Use a canned ctdb.sysconfig rather than a link 2012-04-27 15:42:43 +10:00
etc-ctdb ctdb-tests-eventscripts: Testing support for promote_secondaries 2014-02-13 02:03:24 +01:00
scripts ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
stubs ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
00.ctdb.init.001.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.002.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.003.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.004.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.005.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.006.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.007.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.008.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.021.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.022.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.init.023.sh tests/eventscripts: New tests for 00.ctdb "init" event 2013-06-20 13:01:10 +10:00
00.ctdb.monitor.001.sh tests/eventscripts: Tests for memory checking in 00.ctdb 2013-09-11 15:34:42 +10:00
00.ctdb.monitor.002.sh tests/eventscripts: Tests for memory checking in 00.ctdb 2013-09-11 15:34:42 +10:00
00.ctdb.monitor.003.sh tests/eventscripts: Tests for memory checking in 00.ctdb 2013-09-11 15:34:42 +10:00
00.ctdb.monitor.004.sh tests/eventscripts: Tests for memory checking in 00.ctdb 2013-09-11 15:34:42 +10:00
00.ctdb.monitor.005.sh tests/eventscripts: Tests for memory checking in 00.ctdb 2013-09-11 15:34:42 +10:00
10.interface.init.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.init.002.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.002.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.003.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.004.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.005.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.006.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.007.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.008.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.009.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.010.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.011.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.012.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.013.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.014.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.monitor.015.sh tests/eventscripts: Add tests for monitoring of missing interfaces 2013-07-19 15:37:14 +10:00
10.interface.monitor.016.sh tests/eventscripts: Add tests for monitoring of missing interfaces 2013-07-19 15:37:14 +10:00
10.interface.multi.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.releaseip.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.releaseip.002.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.releaseip.010.sh eventscripts: kill_tcp_connections() should send connections to stdin 2013-07-29 15:53:06 +10:00
10.interface.releaseip.011.sh ctdb/eventscripts: Print a count if killing TCP connections times out 2014-01-17 17:59:34 +11:00
10.interface.startup.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.startup.002.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.takeip.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.takeip.002.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
10.interface.takeip.003.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
11.natgw.001.sh ctdb-tests: Add some tests for 11.natgw eventscript 2014-03-26 04:21:41 +01:00
11.natgw.002.sh ctdb-tests: Add a test for NAT gateway sanity checking 2014-03-26 04:21:42 +01:00
11.natgw.003.sh ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
11.natgw.004.sh ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
11.natgw.005.sh ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
11.natgw.011.sh ctdb-tests: Add some tests for 11.natgw eventscript 2014-03-26 04:21:41 +01:00
11.natgw.012.sh ctdb-tests: Add some tests for 11.natgw eventscript 2014-03-26 04:21:41 +01:00
11.natgw.013.sh ctdb-tests: Add some tests for 11.natgw eventscript 2014-03-26 04:21:41 +01:00
11.natgw.014.sh ctdb-tests: Add some tests for 11.natgw eventscript 2014-03-26 04:21:41 +01:00
11.natgw.015.sh ctdb-tests: Add some tests for 11.natgw eventscript 2014-03-26 04:21:41 +01:00
11.natgw.021.sh ctdb-tests: Add NAT gateway eventscript unit tests for static routes 2014-03-26 06:24:01 +01:00
11.natgw.022.sh ctdb-tests: Add NAT gateway eventscript unit tests for static routes 2014-03-26 06:24:01 +01:00
11.natgw.023.sh ctdb-tests: Add NAT gateway eventscript unit tests for static routes 2014-03-26 06:24:01 +01:00
11.natgw.024.sh ctdb-tests: Add NAT gateway eventscript unit tests for static routes 2014-03-26 06:24:01 +01:00
11.natgw.025.sh ctdb-tests: Add NAT gateway eventscript unit tests for static routes 2014-03-26 06:24:01 +01:00
11.natgw.041.sh ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
11.natgw.042.sh ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes 2014-04-14 06:06:49 +02:00
13.per_ip_routing.001.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.002.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.003.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.004.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.005.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.006.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.007.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.008.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.009.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.010.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.011.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.012.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.013.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.014.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.015.sh tests/eventscripts: add extra infrastructure for policy routing tests 2012-10-11 12:10:45 +11:00
13.per_ip_routing.016.sh eventscripts: Simplify handling of $service name in "managed" functions 2013-05-06 15:45:10 +10:00
13.per_ip_routing.017.sh eventscripts: Simplify handling of $service name in "managed" functions 2013-05-06 15:45:10 +10:00
13.per_ip_routing.018.sh eventscripts: Simplify handling of $service name in "managed" functions 2013-05-06 15:45:10 +10:00
13.per_ip_routing.019.sh eventscripts: Simplify handling of $service name in "managed" functions 2013-05-06 15:45:10 +10:00
20.multipathd.monitor.001.sh tests/eventscripts: New tests for 20.multipathd 2013-10-22 14:34:04 +11:00
20.multipathd.monitor.002.sh tests/eventscripts: New tests for 20.multipathd 2013-10-22 14:34:04 +11:00
20.multipathd.monitor.003.sh tests/eventscripts: New tests for 20.multipathd 2013-10-22 14:34:04 +11:00
20.multipathd.monitor.004.sh tests/eventscripts: New tests for 20.multipathd 2013-10-22 14:34:04 +11:00
40.vsftpd.monitor.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
41.httpd.monitor.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
49.winbind.monitor.001.sh Eventscripts: split 50.samba into 49.winbind and 50.samba 2012-10-03 08:46:32 +10:00
49.winbind.monitor.050.sh tests/eventscripts: Override background_with_logging(), just prepend "&" 2013-08-14 15:57:03 +10:00
49.winbind.monitor.051.sh tests/eventscripts: Override background_with_logging(), just prepend "&" 2013-08-14 15:57:03 +10:00
49.winbind.monitor.101.sh Eventscripts: split 50.samba into 49.winbind and 50.samba 2012-10-03 08:46:32 +10:00
49.winbind.monitor.102.sh eventscripts: Clean up ctdb_check_command() 2013-05-06 15:45:10 +10:00
50.samba.monitor.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
50.samba.monitor.050.sh tests/eventscripts: Override background_with_logging(), just prepend "&" 2013-08-14 15:57:03 +10:00
50.samba.monitor.051.sh tests/eventscripts: Override background_with_logging(), just prepend "&" 2013-08-14 15:57:03 +10:00
50.samba.monitor.101.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
50.samba.monitor.103.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
50.samba.monitor.104.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
50.samba.monitor.105.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
50.samba.monitor.106.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
50.samba.monitor.107.sh scripts: Use $CTDB_SCRIPT_DEBUGLEVEL instead of something more complex 2013-04-19 13:13:36 +10:00
60.ganesha.monitor.101.sh tests/eventscripts: Add some rudimentary tests for 60.ganesha 2013-07-05 15:52:34 +10:00
60.ganesha.monitor.131.sh tests/eventscripts: Add some rudimentary tests for 60.ganesha 2013-07-05 15:52:34 +10:00
60.ganesha.monitor.141.sh eventscripts: Separate out RPC service restart code 2013-08-14 15:57:03 +10:00
60.nfs.monitor.001.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.101.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.102.sh tests/eventscripts: Add unit tests for $CTDB_MONITOR_NFS_THREAD_COUNT 2013-06-14 15:15:07 +10:00
60.nfs.monitor.103.sh tests/eventscripts: Add unit tests for $CTDB_MONITOR_NFS_THREAD_COUNT 2013-06-14 15:15:07 +10:00
60.nfs.monitor.104.sh tests/eventscripts: Add unit tests for $CTDB_MONITOR_NFS_THREAD_COUNT 2013-06-14 15:15:07 +10:00
60.nfs.monitor.111.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.112.sh eventscripts: Become unhealthy faster on nfsd failure 2013-08-14 16:10:30 +10:00
60.nfs.monitor.113.sh eventscripts: Become unhealthy faster on nfsd failure 2013-08-14 16:10:30 +10:00
60.nfs.monitor.114.sh eventscripts: Become unhealthy faster on nfsd failure 2013-08-14 16:10:30 +10:00
60.nfs.monitor.121.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.122.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.131.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.132.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.141.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.142.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.151.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.152.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.153.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.161.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.monitor.162.sh tests/eventscripts - Restructure according to new convention 2012-04-16 16:24:12 +10:00
60.nfs.multi.001.sh Eventscripts: Do not restart NFS on reconfigure 2013-01-07 10:35:39 +11:00
60.nfs.multi.002.sh ctdb/eventscripts: Do not reconfigure in "monitor" events 2013-12-17 06:32:35 +01:00
60.nfs.multi.003.sh ctdb/eventscripts: Reconfigure lock should be released quickly 2014-01-17 17:59:26 +11:00
60.nfs.multi.004.sh ctdb/eventscripts: Reconfigure lock should be released quickly 2014-01-17 17:59:26 +11:00
60.nfs.multi.005.sh ctdb/eventscripts: Reconfigure lock should be released quickly 2014-01-17 17:59:26 +11:00
60.nfs.multi.006.sh Eventscripts: Do not restart NFS on reconfigure 2013-01-07 10:35:39 +11:00
README tests: Update README files and add new README files where missing 2012-04-27 15:40:43 +10:00

eventscript unit tests
======================

This directory contains some eventscript unit tests for CTDB.  These
tests can be run as a non-privileged user.  There are a lot of stub
implementations of commands (located in stubs/) used to make the
eventscripts think they're running against a real system.

Test case filenames look like:

  <eventscript>.<event>.NNN.sh

The test helper functions will run <eventscript> with specified
options.  If using the simple_test() or iterate_test() helper
functions then the 1st <event> argument is automatically passed.  When
simple_test_event() is used the event name must be explicitly passed
as the 1st argument - this is more flexible and supports multiple
events per test.

Examples:

* ../run_tests.sh .

  Run all tests, displaying minimal output.

* ../run_tests.sh -s .

  Run all tests, displaying minimal output and a summary.

* ../run_tests.sh -s ./10.interface.*.sh

  Run all the tests against the 10.interface eventscript.

* ../run_tests.sh -v -s .

  Run all tests, displaying extra output and a summary.

* ../run_tests.sh -sq .

  Run all tests, displaying only a summary.

* ../run_tests.sh -X ./10.interface.startup.002.sh

  Run a test and have the eventscript itself run with "sh -x".  This
  will usually make a test fail because the (undesirable) trace output
  will be included with the output of the eventscript.  However, this
  is useful for finding out why a test might be failing.