summaryrefslogtreecommitdiff
path: root/ctdb/tests/simple
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Fix logic error in simple ctdb reloadips testMartin Schwenke2019-05-141-17/+20
| | | | | | | | | | | | | | | There is a chance that restoring IP addresses to the test node will result in different IP addresses being assigned to that node. Removing a single IP address may then fail (or be a no-op) if it is done after the restore. So, swap the single IP address removal to happen first, then restore, then remove all IP addresses. 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>
* ctdb-tests: Make ctdb reloadips tests more reliableMartin Schwenke2019-05-141-3/+30
| | | | | | | | | | | | 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>
* ctdb-tests: Wait to allow database attach/detach to take effectMartin Schwenke2019-05-072-36/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes the detach test fails: Check detaching single test database detach_test1.tdb BAD: database detach_test1.tdb is still attached Number of databases:4 dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.0/db/volatile/detach_test4.tdb.0 dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.0/db/volatile/detach_test3.tdb.0 dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.0/db/volatile/detach_test2.tdb.0 dbid:0xc62491f4 name:detach_test1.tdb path:tests/var/simple/node.0/db/volatile/detach_test1.tdb.0 Number of databases:3 dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.1/db/volatile/detach_test4.tdb.1 dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.1/db/volatile/detach_test3.tdb.1 dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.1/db/volatile/detach_test2.tdb.1 Number of databases:4 dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.2/db/volatile/detach_test4.tdb.2 dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.2/db/volatile/detach_test3.tdb.2 dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.2/db/volatile/detach_test2.tdb.2 dbid:0xc62491f4 name:detach_test1.tdb path:tests/var/simple/node.2/db/volatile/detach_test1.tdb.2 *** TEST COMPLETED (RC=1) AT 2019-04-27 03:35:40, CLEANING UP... When issued from a client, the detach control re-broadcasts itself asynchronously to all nodes and then returns success. The controls to some nodes to do the actual detach may still be in flight when success is returned to the client. Therefore, the test should wait for a few seconds to allow the asynchronous controls to complete. The same is true for the attach control, so workaround the problem in the attach test too. An alternative is to make the attach and detach controls synchronous by avoiding the broadcast and waiting for the results of the individual controls sent to the nodes. However, a simple implementation would involve adding new nested event loops. 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>
* ctdb-tests: Avoid bulk output in $out, prefer $outfileMartin Schwenke2019-05-0730-127/+136
| | | | | | | 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>
* ctdb-tests: Change sanity_check_output() to internally use $outMartin Schwenke2019-05-0710-18/+13
| | | | | | | | | | | All callers are currently passed $out. Global variable $out is used in many other places so use it here to simplify the interface and make future changes simpler. 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>
* ctdb-tests: Extend test to cover ctdb rddumpmemoryMartin Schwenke2019-05-071-2/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13923 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add a test for version consistency checkingMartin Schwenke2019-03-151-0/+65
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
* ctdb-tests: Add a test for configuring the recovery lock as a commandMartin Schwenke2019-02-252-0/+31
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13800 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Force test failure if local daemon setup failsMartin Schwenke2019-02-251-0/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13800 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Minimise chances of test interfering with itselfMartin Schwenke2018-12-181-2/+3
| | | | | | | | | | Checking that the database contains 0 records cause a traverse. This may take a lock and cause vacuuming to fail (or be deferred for a particular record/chain). Minimise the chance of this happening by only checking for 0 records every 10 seconds. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Make the debug hung script test cope with unreadable stacksMartin Schwenke2018-11-151-3/+14
| | | | | | | | | | | | | | | | | | Ideally this would just involve using "test -r". However, operating system security features may mean that kernel stacks are not readable even though they appear to be. Instead, try reading that stack of a process on the test node. If that succeeds then so should reading the stack of the "stuck" sleep process in the test. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13684 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Tim Beale <timbeale@catalyst.net.nz> Autobuild-User(master): Tim Beale <timbeale@samba.org> Autobuild-Date(master): Thu Nov 15 08:15:32 CET 2018 on sn-devel-144
* ctdb-tests: Use local_daemons.sh in local_daemons.bashMartin Schwenke2018-11-063-236/+26
| | | | | | | | | The etc-ctdb/ subdirectory containing the event script moves into the top-level tests/ directory because the subdirectory is really now owned by local_daemons.sh instead of simple/. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Change all cluster setup to use ctdb_test_init()Martin Schwenke2018-11-062-27/+6
| | | | | | | | | | | ctdb_test_init() now passes any arguments to setup_ctdb(). Update tests that have custom local daemon configuration to call ctdb_test_init() directly. Remove the redundant, initial call to ctdb_test_init() to avoid starting the cluster an extra time. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop passing of test arguments to ctdb_test_init()Martin Schwenke2018-11-0649-49/+49
| | | | | | | Arguments are currently ignored anyway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop ctdb_restart_when_done()Martin Schwenke2018-11-0629-83/+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>
* ctdb-tests: Drop tests that only start and stop daemonsMartin Schwenke2018-11-062-58/+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>
* ctdb-tests: Move enabling of event scripts to setup_ctdb()Martin Schwenke2018-11-061-4/+0
| | | | | | | This is for the real cluster case. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop use of confusing testfailures variableMartin Schwenke2018-11-068-36/+22
| | | | | | | | 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>
* ctdb-tests: Drop useless "ctdb version" testMartin Schwenke2018-11-061-54/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Rationalise tunable simple testsMartin Schwenke2018-11-063-117/+24
| | | | | | | | These 3 tests duplicate various checks and can easily be handled as a single test. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Rationalise ctdb stop/continue/disable/enable simple testsMartin Schwenke2018-11-064-88/+2
| | | | | | | | The "continue" and "enable" tests are just extensions of the "stop" and "disable" tests, so drop the latter 2. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use wait_until_node_has_no_ips() in some testsMartin Schwenke2018-11-062-4/+2
| | | | | | | | This strengthens those tests to ensure that released IPs aren't replaced with others. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop setting of CTDB_SOCKET and CTDB_PIDFILEMartin Schwenke2018-11-061-3/+0
| | | | | | | | | The local daemons ssh stub doesn't need to do this because the ctdbd and the ctdb tool now only need CTDB_TEST_MODE and CTDB_BASE for local daemon tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use ctdb-path-like values for local daemons socket and PID fileMartin Schwenke2018-11-061-2/+2
| | | | | | | | | | | | | | However, don't use ctdb-path itself because some tests use nested instances of onnode. The outermost instance would set CTDB_SOCKET and any inner instance would pick up that value, regardless of CTDB_BASE. This is a temporary measure to avoid breaking testing while use of the path functions is added to ctdbd and the ctdb tool. When this is complete these variables can be removed altogether because the code will just depend on CTDB_TEST_MODE and CTDB_BASE. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add extra debug to large database recovery testMartin Schwenke2018-10-081-6/+26
| | | | | | | | | This test sometimes fails, probably because the test is flakey. Either the records aren't being added correctly or the counting of records loses records. Try to debug both possibilities. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Support closing of stdin in local daemons ssh stubMartin Schwenke2018-10-081-3/+8
| | | | | | | Not sure this is needed but this makes it behave the same as ssh. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Be more careful when building public IP addressesMartin Schwenke2018-10-081-7/+9
| | | | | | | | | | | | | | | | The goal is to allow more local daemons by expanding the address range rather than generating invalid addresses. For IPv6, use a separate address space instead of an offset for the 2nd address. For IPv4, use the last 2 octets with addresses starting at 192.168.100.1 and 192.168.200.1. Avoid addresses with 0 and 255 in the last octet by using a maximum of 100 addresses per "subnet" starting at .1. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Be more careful when building node addressesMartin Schwenke2018-10-081-5/+6
| | | | | | | | | | | | | | | | The goal is to allow more local daemons by expanding the address range rather than generating invalid addresses. For IPv6, use all 4 trailing hex digits. For IPv4, use the last 2 octets. Although 127.0.0.0 is a /8 network, avoid unexpected issues due to 0 and 255 in the last octet. Use a maximum of 100 addresses per "subnet" starting at .1. Keep the first group of addresses in 127.0.0.0/24 to continue to allow a reasonable number of nodes to be tested with socket-wrapper. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Don't format IPv4 octets as hex digitsMartin Schwenke2018-10-081-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Be more efficient about starting/stopping local daemonsMartin Schwenke2018-10-081-10/+4
| | | | | | | | | | | | | | | | Don't loop, just use onnode all. For shutting down, use onnode -p all. This results in a significant time saving for stopping many deamons because "ctdb shutdown" is now synchronous. onnode -p all can be used to start daemons directly because they daemonize. However, this does not work under valgrind because the valgrind process does not exit, so onnode will wait forever for it. In this case, use onnode without the -p option. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Do not use ctdbd_wrapper in local daemon testsMartin Schwenke2018-10-081-6/+2
| | | | | | | | | | | | | | | | | Run the daemon directly and shut it down using ctdb shutdown. The wrapper waits for ctdbd to reach >=FIRST_RECOVERY runstate within a timeout period and shuts ctdbd down if that doesn't happen. This is only really used to ensure that ctdbd doesn't exit early after an apparently successful start. There are no known cases where ctdbd will continue running but fail to reach >=FIRST_RECOVERY runstate. When ctdbd is started in tests, the test code will wait until ctdbd is in a healthy state on all nodes before proceeding, so there is effectively no change in behaviour. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Don't remove non-existent test database directoryMartin Schwenke2018-10-081-2/+0
| | | | | | | | This directory is no longer used. Lack of removal doesn't seem to cause a problem. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Drop unused function maybe_stop_ctdb()Martin Schwenke2018-10-081-5/+0
| | | | | | | 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>
* ctdb-tests: Explicitly check for local daemons when shutting downMartin Schwenke2018-10-081-3/+3
| | | | | | | | | This is clearer if the logic is explicit... and... 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>
* ctdb-tests: Drop functions daemons_start(), daemons_stop()Martin Schwenke2018-10-081-13/+3
| | | | | | | | | There are too many functions to start/stop daemons. Simplify this. Inline the functionality into ctdb_start_all() and ctdb_stop_all(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Don't used daemons_start()/daemons_stop() directly in testsMartin Schwenke2018-10-082-7/+7
| | | | | | | 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>
* ctdb-tests: Rename _ctdb_start_all() -> ctdb_start_all()Martin Schwenke2018-10-081-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>
* ctdb-tests: Rename ctdb_start_all() -> ctdb_init()Martin Schwenke2018-10-081-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>
* ctdb-tests: Drop ps_ctdbd()Martin Schwenke2018-10-083-14/+0
| | | | | | | | | This was used for debugging tests by ensuring that the arguments to ctdbd were as expected. It no longer outputs anything useful because ctdbd is now started without arguments. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add recovery record resurrection test for volatile databasesMartin Schwenke2018-10-081-0/+84
| | | | | | | | | | Ensure that deleted records and vacuumed records are not resurrected from recently inactive nodes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Use known install paths in local daemon testsMartin Schwenke2018-09-031-13/+10
| | | | | | | | | | | | | | The in-tree local daemons tests don't work from a top-level Samba compile. The simple test suite was the first test suite and things have generally worked, so it has been slow to adopt general test infrastructure changes. Instead of re-calculating script and helper locations, use the paths from script_install_paths.sh. The bin/ directory is already added to PATH in common.sh, so don't add it here. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Check that no IPs are assigned when failover is disabledMartin Schwenke2018-08-242-1/+31
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589 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): Fri Aug 24 14:13:12 CEST 2018 on sn-devel-144
* ctdb-tests: Drop DisableIPFailover simple testMartin Schwenke2018-08-241-28/+1
| | | | | | | | | | | This is about to become a config file option that can't be dynamically changed at run-time, so drop this test for now. This test will be added once the tunable becomes a config file option. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Loosen match against pstree output in simple testMartin Schwenke2018-07-181-1/+1
| | | | | | | | | | | | | | As per previous commit, pstree can truncate output if it gets too wide. Instead of matching against the script's full path and arguments, just match against the script name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13531 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): Wed Jul 18 14:53:39 CEST 2018 on sn-devel-144
* ctdb-tests: Ensure some event scripts are enabled for cluster testsMartin Schwenke2018-07-111-0/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Switch to using new event daemonAmitay Isaacs2018-07-051-3/+3
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Jul 5 09:39:33 CEST 2018 on sn-devel-144
* ctdb-tools: Switch to using new event daemon toolAmitay Isaacs2018-07-051-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add a simple test for database traversesMartin Schwenke2018-07-021-0/+94
| | | | | | | | | | This tests that volatile databases traverse correctly, including the case where a record was updated on a non-lmaster node. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Switch 90_debug_hung_script.sh to be a simple testMartin Schwenke2018-07-021-0/+83
| | | | | | | | 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>
* ctdb-tests: Enable event script debugging in local daemon testsMartin Schwenke2018-07-021-1/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>