summaryrefslogtreecommitdiff
path: root/ctdb/tests/eventscripts
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Add 31.clamd eventscript unit testsMartin Schwenke2017-09-124-0/+50
| | | | | | | | | | These test that ctdb_check_unix_socket() is working. 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): Tue Sep 12 16:14:12 CEST 2017 on sn-devel-144
* ctdb-tests: Enhance ss stub to check for listening Unix domain socketsMartin Schwenke2017-09-121-36/+141
| | | | | | | | | Generalise command-line parsing, taking hints from old netstat stub, and use FAKE_NETSTAT_UNIX_LISTEN to specify listening Unix domain sockets. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Improve releaseip connection resetting testsMartin Schwenke2017-09-014-8/+12
| | | | | | | | Make the tests more general by setting up the IP address using a "takeip" event. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add event script startup/shutdown testsMartin Schwenke2017-07-2313-15/+155
| | | | | | | | | | | For vsftpd, httpd, winbind. These should help to catch typo regressions. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Sun Jul 23 19:31:08 CEST 2017 on sn-devel-144
* ctdb-scripts: Compact server-end TCP connection killing outputMartin Schwenke2017-06-136-44/+127
| | | | | | | | | | | | | | | | | | | | When thousands of connections are being killed the logs are flooded with information about connections that should be killed. When some connections are not killed then the number not killed is printed. This is the wrong way around! When debugging "fail-back" problems, it is important to know details of connections that were *not* killed. It is almost never important to know the full list of all connections that were *supposed* to be killed. Instead, print a summary showing how many connections of the total were killed. If any were not killed then print a list of remaining connections. Update unit tests: infrastructure for fake TCP connections, existing, test cases, add new test cases. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add more NFS eventscript tests for call-out failuresMartin Schwenke2017-06-1313-0/+156
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12837 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop calls to ctdb_service_managed and ctdb_service_unmanagedAmitay Isaacs2017-01-201-12/+0
| | | | | | | | These functions have been removed as part of dropping CTDB_SERVICE_AUTOSTARTSTOP functionality. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add "13.per_ip_routing shutdown" testMartin Schwenke2017-01-171-0/+31
| | | | | | | | | | | | Ensure that it doesn't mangle the rt_tables file. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jan 17 06:02:23 CET 2017 on sn-devel-144
* ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"Martin Schwenke2017-01-171-1/+1
| | | | | | | | | | | | | This changed to "ctdb gratarp" some time ago but the scripts were never updated. Fix the documentation for the ctdb tool too. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12512 Reported-by: Ralph Böhme <slow@samba.org> Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Simplify TCP port checkingMartin Schwenke2017-01-164-21/+4
| | | | | | | | | | | | | | | Commit 86792724a2a911da9cd3e75622d35084c88eb8ce added complications on top of the multiple TCP port checking methods that used to exist. Life is simpler now and the cause of any failures is obvious. So just print a simple message if the port check fails. Tweak tests to match changes. Drop one test that becomes a duplicate. Temporarily tweak ctdb_check_command() so that it passes shellcheck tests. It will be removed anyway in a subsequent commit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop configuration variable CTDB_SERVICE_AUTOSTARTSTOPMartin Schwenke2017-01-164-66/+0
| | | | | | | | | | | | | | | | | | | | | | This has bit-rotted, at least for NFS. It can be fixed but it is better to remove it because it adds a lot of unnecessary complexity. Variable event_name becomes unused so remove it. Also remove associated tests. To continue to manage/unmanage services while CTDB is running: * Start service by hand and then flag it as managed * Mark service as unmanaged and shut it down by hand In some cases CTDB does something fancy - e.g. start Samba under "nice", so care is needed. One technique is to disable the eventscript, mark as managed, run the startup event by hand and then re-enable the eventscript. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop some tests for "reconfigure" event and monitor replayMartin Schwenke2016-12-164-97/+0
| | | | | | | | These features are going away. There is nothing to reconfigure for NFS anyway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Update CTDB_SCRIPT_DEBUGLEVEL to be symbolicMartin Schwenke2016-12-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use symbolic debug levels in eventscript testsMartin Schwenke2016-12-051-1/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add tests for updated Debian style Samba start/stopMartin Schwenke2016-11-074-3/+33
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12371 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Nov 7 08:01:28 CET 2016 on sn-devel-144
* ctdb-scripts: Dump stack traces of smbd processes after shutdownMartin Schwenke2016-10-104-6/+61
| | | | | | | | | | | | | | If any processes remain then they may be stuck in D state and this might tell us why. Update tests: tweak pidof stub, add support for smbd stack traces and add some new tests for the shutdown event. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Oct 10 12:54:24 CEST 2016 on sn-devel-144
* ctdb-tests: Allow "addtickle" and "deltickle" stubs to read from stdinMartin Schwenke2016-09-081-16/+52
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Stop cross-talk between reclock testsMartin Schwenke2016-08-011-0/+11
| | | | | | | | | | | | | | On a busy system the backgrounded counter reset can survive into the next test and interfere with its result. To avoid this, wait until all forks of 01.reclock exit before continuing on to the next test. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Aug 1 17:53:27 CEST 2016 on sn-devel-144
* ctdb-tests: Avoid division by zero in NFS eventscript unit testMartin Schwenke2016-07-281-1/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Simplify "ctdb pnn" output formatMartin Schwenke2016-07-251-4/+3
| | | | | | | | | Just print the PNN. Update dependent code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Drop use of ctdb_check_counter from reclock event scriptMartin Schwenke2016-07-212-3/+2
| | | | | | | | | | This makes the logic more obvious. Fix the (probably) accidental fall-through to the regular monitor failure. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New event script test for corrupt TDB checkingMartin Schwenke2016-07-211-0/+59
| | | | | | | | Ensures that backups of corrupt TDB files are correctly limited in number. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add new httpd event script testMartin Schwenke2016-07-211-0/+31
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add new vsftpd event script testMartin Schwenke2016-07-211-0/+20
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add reclock event script testsMartin Schwenke2016-07-218-9/+94
| | | | | | | Tweak eventscript unit test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: make sure scripts using $CTDB called by test find ctdbMichael Adam2016-06-111-0/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb:tests: timedout->timed out in 60.nfs.multi.004 testMichael Adam2016-06-011-1/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 1 04:30:36 CEST 2016 on sn-devel-144
* ctdb-tests: Drop no-op functions and add an ip6tables stubMartin Schwenke2016-05-262-5/+5
| | | | | | | | | | | Stub scripts are more obvious. rc.local should only be used when strictly necessary. iptables_wrapper doesn't need to be no-op-ed, provided flock is installed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Use ss instead of netstat for finding TCP connectionsMartin Schwenke2016-04-171-0/+88
| | | | | | | | | ss with a filter is much faster than post-processing output from netstat. CTDB already has a hard dependency on iproute2 for IP address handling, so depending on ss is no big deal. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Simplify "ctdb lvs ..." outputMartin Schwenke2016-04-151-3/+2
| | | | | | | | | | For "master", if there is a master then print the PNN, otherwise print nothing. For "list", print the PNN and IP addresses without a colon in between. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add monitoring of CTDB_LVS_PUBLIC_IFACEMartin Schwenke2016-04-153-0/+47
| | | | | | | ... and unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Call out to ctdb_lvs helper from 91.lvsMartin Schwenke2016-04-153-35/+65
| | | | | | | | | | | | | | | | | | | | To keep this commit comprehensible, 91.lvs and the CTDB CLI tool are temporarily inconsistent. The tool will be made consistent in a subsequent commit. LVS now uses a configuration file specified by CTDB_LVS_NODES and supports the same slave-only syntax as CTDB_NATGW_NODES. LVS also uses new variable CTDB_LVS_PUBLIC_IFACE instead of CTDB_PUBLIC_INTERFACE. Update unit tests and documentation. Note that the --lvs and --single-public-ip daemon options are no longer used. These will be removed and relevant documentation updated in a subsequent commit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add unit tests for LVS eventscriptMartin Schwenke2016-04-1510-0/+268
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: LVS support for ctdb tool stubMartin Schwenke2016-04-151-0/+24
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add ipvsadm test stubMartin Schwenke2016-04-151-0/+126
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add 32-bit netmask support to "ip addr show" stubMartin Schwenke2016-04-151-8/+6
| | | | | | | In this case do not show broadcast address. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add loopback support for "ip link show" stubMartin Schwenke2016-04-151-3/+15
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Allow scope to be specified in "ip addr add" stubMartin Schwenke2016-04-151-6/+10
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop "ctdb killtcp" commandMartin Schwenke2016-04-011-8/+0
| | | | | | | It is now handled by a standalone helper. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Use ctdb_killtcp helper to kill connectionsMartin Schwenke2016-04-012-4/+10
| | | | | | | | | | | ctdb_killtcp will take up to 5 seconds to kill connections, so don't wait in a loop. Just check if there are remaining connections on completion and log a message either way. Also add a test stub. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Install helpers under libexecdirMartin Schwenke2016-02-121-0/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andreas Schneider <asn@samba.org>
* ctdb-tools: Drop support for setting and viewing NAT gateway capabilityMartin Schwenke2016-01-251-8/+0
| | | | | | | This is no longer used. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: No longer set the NAT gateway capabilityMartin Schwenke2016-01-252-4/+0
| | | | | | | | | | Nothing checks it anymore. This means that the NAT gateway capability in the daemon is now unused. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Call out to ctdb_natgw helper from 11.natgwMartin Schwenke2016-01-254-62/+49
| | | | | | | | | | | | | | To keep this commit comprehensible, 11.natgw and the CTDB CLI tool are temporarily inconsistent. The tool will be made consistent in a subsequent commit. ctdb_natgw_slave_only() is reimplemented to check for the option in the appropriate line in $CTDB_NATGW_NODES. Update unit tests and documentation. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: NAT gateway slave-only changesMartin Schwenke2016-01-252-53/+37
| | | | | | | | | | | | Handle the "slave-only" option in the unit test setup. Reindent function while touching it. Also drop a test that no longer makes sense. Specifying both "master" and "slave-only' is now much more obvious, since they need to be on the same line, and is now punishable by undefined behaviour. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Tests for monitoring of CTDB_NATGW_PUBLIC_IFACEMartin Schwenke2016-01-254-0/+76
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Refactor function interface_monitor() to monitor one interfaceMartin Schwenke2016-01-252-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-ipalloc: Rename ctdb_takeover_run_core() to ipalloc()Martin Schwenke2015-12-041-1/+1
| | | | | | | It just does IP allocation... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add exportfs cache to NFS Linux kernel calloutMartin Schwenke2015-12-041-0/+3
| | | | | | | | | | | exportfs can hang when, for example, DNS is flakey. Given that exports don't change much, it makes sense to cache them. Don't try to add error handling when exportfs fails but do print a warning. Proper error handling can be added separately. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Rename variable CTDB_ETCDIR to CTDB_SYS_ETCDIRMartin Schwenke2015-09-154-8/+8
| | | | | | | | | | | | This variable points to /etc/ by default. This distinguishes it from the different variable from wscript, which points to /etc/ctdb/. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Jose A. Rivera <jarrpa@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>