summaryrefslogtreecommitdiff
path: root/ctdb/tests/complex
AgeCommit message (Collapse)AuthorFilesLines
2019-09-26ctdb-tests: Move complex tests to CLUSTER/ subdirectoryMartin Schwenke18-1689/+0
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-09-17ctdb-tests: Move NFS test functions to complex local scriptMartin Schwenke1-0/+32
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-05-14ctdb-tests: Make ctdb reloadips tests more reliableMartin Schwenke1-4/+31
ctdb reloadips will fail if it can't disable takover runs. The most likely reason for this is that there is already a takeover run in progress. We can't predict when this will happen, so retry if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-05-07ctdb-tests: Avoid bulk output in $out, prefer $outfileMartin Schwenke7-32/+16
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-11-06ctdb-tests: Drop passing of test arguments to ctdb_test_init()Martin Schwenke16-16/+16
Arguments are currently ignored anyway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-11-06ctdb-tests: Drop ctdb_restart_when_done()Martin Schwenke16-48/+0
This no longer does anything. Integration test cases now start and shut down the cluster. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-11-06ctdb-tests: Drop tests that only start and stop daemonsMartin Schwenke1-22/+0
Integration test cases now start and shut down the cluster. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-11-06ctdb-tests: Move enabling of event scripts to setup_ctdb()Martin Schwenke1-2/+0
This is for the real cluster case. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-11-06ctdb-tests: Drop use of confusing testfailures variableMartin Schwenke5-10/+5
Exit on first test failure instead of setting a variable. The bizarre logic in ctdb_test_exit() makes this worth dropping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-10-08ctdb-tests: Rename ctdb_start_all() -> ctdb_init()Martin Schwenke1-1/+1
There are too many functions to start/stop daemons. Simplify this. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-11ctdb-tests: Ensure some event scripts are enabled for cluster testsMartin Schwenke1-0/+24
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-02ctdb-tests: Switch 90_debug_hung_script.sh to be a simple testMartin Schwenke1-94/+0
This test only runs against local daemons. Configuration is done via script.options, which simplifies things quite a bit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-06-05ctdb-scripts: Event scripts must end with ".script" suffixMartin Schwenke1-1/+1
Preparation for recommending configuration for each script next to the actual script. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-06-05ctdb-scripts: Move event scripts to events/legacy/ directoryMartin Schwenke1-1/+1
This is the initial location that will be used by the new multi-component aware event daemon. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19ctdb-scripts: Drop CTDB_PUBLIC_ADDRESSES configuration optionMartin Schwenke1-1/+2
This option adds a lot of unnecessary complexity to scripts. Configuration should go in $CTDB_BASE, either directly or via a symlink, so simplify by using the default location. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-19ctdb-scripts: Drop 10.external event scriptMartin Schwenke1-102/+0
This was added for a vendor who decided not to use it. It is almost certainly unused by anyone. If anyone really needs it then it is in the git history. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-09ctdb-tests: Don't use nc -d or -w optionsMartin Schwenke6-6/+6
nmap-ncat is used in some distributions to replace netcat. It has a different meaning for these options. We can get the same effect as the current combination of -d and -w by piping a sleep process to nc. Subsequent use of $! works because it gets the last process in pipeline. Note that redirecting from /dev/null doesn't work with some versions of nc. They just exit when they get EOF. 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): Fri Mar 9 12:24:13 CET 2018 on sn-devel-144
2017-09-01ctdb-tests: Add tests to ensure reset of server end of connectionsMartin Schwenke2-0/+188
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-25ctdb-tests: Add functions to start/stop/restart ctdb on single nodeAmitay Isaacs1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12978 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-02-24ctdb-tests: Add synchronisation points in reload IPs testsMartin Schwenke1-0/+6
"ctdb reloadips" use of ipreallocate() can result in a spurious takeover runs. This can cause a subsequent "ctdb reloadips" to fail to disable takeover runs (due to there being one already in progress). There are various possible improvements but a proper fix probably requires a protocol change. That would mean receiving an ACK for a takeover run request to indicate that the request will be processes and then a broadcast to indicate a completed takeover run. There are various other partial fixes (e.g. de-duping queued takeover run requests against those in the in-progess queue) and workarounds (e.g. always do a double ipreallocate() in the tool, which should absorb the spurious takeover run). However, this is unlikely to be a real-world problem. Real use cases should not involve repeatedly reloading the IP configuration. Instead, work around the problem of flaky tests by manually adding "ctdb sync" commands to cause extra no-op takeover runs. These should not add spurious takeover runs and will create synchronisation points to help avoid the issue. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-18ctdb-daemon: Switch to using event daemonAmitay Isaacs1-3/+3
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18ctdb-tool: Drop disablescript, enablescript and eventscript commandsAmitay Isaacs2-7/+6
These commands are now replaced with ctdb event ... ctdb scriptstatus is maintained for backward compatibility. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-08-18ctdb-tests: Validate that TAKE_IP works with IP already on an interfaceMartin Schwenke1-0/+45
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): Thu Aug 18 02:50:16 CEST 2016 on sn-devel-144
2016-08-17ctdb-tests: Validate that unexpected IP on interface is properly releasedMartin Schwenke1-0/+59
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-28ctdb-daemon: Deletion of IPs is deferred until the next takeover runMartin Schwenke1-0/+1
This drastically simplifies the code. "ctdb reloadips" behaves the same, since it causes a takeover run immediately after IPs are deleted. "ctdb delip" now needs to be followed with an explicit "ctdb ipreallocate". Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-04-23ctdb-tests: Fix flakey test complex/18_ctdb_reloadips.shAmitay Isaacs1-1/+2
This test sets TakeoverTimeout=90 to avoid banning during takeover. However, the setting is done on the test node instead of the recovery master node. During "ctdb reloadips", the recovery master will used the default value of TakeoverTimeout. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-03-10ctdb-tests: Add a new NFS tickle test for the releasing nodeMartin Schwenke1-0/+69
Current NFS and CIFS tickle tests do not test the killtcp functionality on the releasing node. 2-way killing is done for NFS, so this test explicitly looks for packets from the releasing node. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-03-10ctdb-tests: Allow tcptickle_sniff_wait_show() to filter by MAC addressMartin Schwenke1-2/+19
tcpdump does not support filtering on MAC address when reading from a file. Therefore, this is implemented by conditionally using grep to filter the output of tcpdump. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-03-10ctdb-tests: Re-indent and re-format some functionsMartin Schwenke1-22/+25
This makes the next commit much easier to read. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-03-10ctdb-tests: Fix CIFS tickle testMartin Schwenke1-18/+12
There's a tiny chance that the connection information may not be transferred to other nodes quickly enough, so add an explicit wait. Also clean up the description and recognise that it is the takeover node that does the tickling. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-03-10ctdb-tests: Fix description of NFS tickle testMartin Schwenke1-15/+4
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-10-23ctdb-tests: Change "ctdb ip -n all" to "ctdb ip all"Martin Schwenke1-3/+3
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-13ctdb-tests: Add tickle test for external public address handlingMartin Schwenke1-0/+102
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-01-09ctdb-scripts: Don't use the GNU awk gensub() functionMartin Schwenke1-1/+1
This is a gawk extension and can't be used reliably if just running "awk". It is simple enough to switch to using the standard sub() and gsub() functions. The alternative is to switch to explicitly running "gawk". However, although the eventscripts aren't exactly portable, it is probably better to move closer to portability than further away. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
2015-01-09ctdb-tests: Fix tickle sniffing for IPv4Martin Schwenke1-1/+1
tcptickle_sniff_start() assumes that if $dst contains a ': then it should use the IPv6 sniffing code. However, $dst is a socket, so has a trailing ":<port>". Strip the trailing ":<port>" before checking for ':' as a marker for an IPv6 address. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
2014-12-05ctdb-tests: Need to drop public IPs in kill-failover testsMartin Schwenke2-3/+11
These tests simulate a dead node rather than a CTDB failure, so drop IP addresses when killing a "node" to avoid problems with duplicates. To cope with a CTDB failure a watchdog would be needed to ensure that the public IPs are dropped when CTDB dies. Let's not do that now. 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): Fri Dec 5 23:29:39 CET 2014 on sn-devel-104
2014-12-05ctdb-tests: More debug on SSH failureMartin Schwenke1-4/+9
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Make tcpdump output more verboseMartin Schwenke1-1/+1
This helps with debugging. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Use ip neigh command instead of arpMartin Schwenke3-11/+11
Extend select_test_node_and_ips() to set $test_prefix in addition to $test_ip. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Generalise the gratarp and tickle sniffing code for IPv6Martin Schwenke1-3/+77
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Match IPv6 connections in netstat outputMartin Schwenke1-1/+1
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Use ping_wrapper to do relevant ping or ping6Martin Schwenke3-3/+10
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Extend regexps to handle IPv6 address matchingMartin Schwenke1-2/+2
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)Martin Schwenke1-1/+1
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05ctdb-tests: Update integration tests to use ctdb -XMartin Schwenke2-4/+4
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-11-18ctdb-scripts: Fix stack dumping when debugging hung scriptsMartin Schwenke1-1/+1
There are parentheses missing that stop the default pattern from matching commands with trailing garbage (e.g. "exportfs.orig"). A careful check of POSIX (and running GNU sed with --posix) suggests that "\|" isn't a supported way of specifying alternation in a regular expression. Therefore, it is clearer to switch to extended regular expressions so that this has a chance of being portable (even though the point is to print /proc/<pid>/stack, which only works on Linux). 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 Nov 18 06:37:45 CET 2014 on sn-devel-104
2014-09-23ctdb-tests: Clean up some tests where IP movement is checkedMartin Schwenke1-71/+10
Some of this implements logic that exists in functions. Some of it is overly complicated and potentially failure-prone. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-03ctdb-tests: Fix racy test for debugging hung scriptsMartin Schwenke1-0/+4
Debugging can still be running when a monitor event times out and scriptstatus output changes. When debugging a hung script to a log file, write to a temporary file and move the temporary file over the log file when done. The test then waits for the log file to appear. 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): Thu Jul 3 08:19:23 CEST 2014 on sn-devel-104
2014-06-19ctdb-tests: Try harder to avoid failures due to repeated recoveriesMartin Schwenke1-1/+1
About a year ago a check was added to _cluster_is_healthy() to make sure that node 0 isn't in recovery. This was to avoid unexpected recoveries causing tests to fail. However, it was misguided because each test initially calls cluster_is_healthy() and will now fail if an unexpected recovery occurs. Instead, have cluster_is_healthy() warn if the cluster is in recovery. Also: * Rename wait_until_healthy() to wait_until_ready() because it waits until both healthy and out of recovery. * Change the post-recovery sleep in restart_ctdb() to 2 seconds and add a loop to wait (for 2 seconds at a time) if the cluster is back in recovery. The logic here is that the re-recovery timeout has been set to 1 second, so sleeping for just 1 second might race against the next recovery. * Use reverse logic in node_has_status() so that it works for "all". * Tweak wait_until() so that it can handle timeouts with a recheck-interval specified. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-28ctdb-tests: Add a new NFS tickle testMartin Schwenke1-0/+98
This one ensures that a newly started node gets an up-to-date tickle list. Tweak some of the integration test functions to accommodate this. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>