summaryrefslogtreecommitdiff
path: root/ctdb/tests/simple
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Run transaction tests with externally imposed timeoutMartin Schwenke2015-07-012-6/+16
| | | | | | | | | This works around cases where ctdb_transaction gets stuck - this still needs to be debugged. However, this change will at least cause individual tests to fail rather than having whole test runs time out. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add new "ctdb setreclock" testMartin Schwenke2015-02-041-0/+117
| | | | | | | | 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 Feb 4 05:40:55 CET 2015 on sn-devel-104
* ctdb-tests: Try to handle IPv6 addresses for local daemonsMartin Schwenke2014-12-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | If CTDB_USE_IPV6 is set then use IPv6 addresses for nodes and public IPs. This can be useful for some simple tests. However, the node address actually needs to be on lo so that ctdbd can bind to the port on that address, so they actually need to be added as root before running tests, like this: for i in $(seq 1 10) ; do ip addr add "fc00:10::${i}/64" dev lo ; done IPv4 127.0.0.0/8 addresses are somehow magic and only one needs to be on lo so that many can be bound to. Also change the IPv4 node addresses to be (slightly) more exotic. For both IPv4 and IPv6, choose addresses that are compatible with socket wrapper. Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Amitay Isaacs <amitay@gmail.com> (socket wrapper fixes) Reviewed-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (socket wrapper fixes)
* ctdb-tests: Extend regexp to match IPv6 addressesMartin Schwenke2014-12-051-1/+3
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Update integration tests to use ctdb -XMartin Schwenke2014-12-055-22/+22
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOGMartin Schwenke2014-10-281-1/+1
| | | | | | | | | | | | Remove --logfile and --syslog daemon options and replace with --logging. Modularise and clean up logging initialisation code. The initialisation API includes an app_name argument that is currently unused - this will be used in extensions to the syslog backend. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRITMartin Schwenke2014-10-281-1/+1
| | | | | | | | | | | | | | Internally map them to DEBUG_ERR to limit code churn. This reduces the unwieldy number of debug levels used by CTDB. ALERT and CRIT aren't of much use as separate errors, since everything from ERR up should always be logged. In future just ERR can be used. This also improves compatibility with Samba's debug.c system priority mapping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove DEBUG_EMERGMartin Schwenke2014-10-281-28/+14
| | | | | | | | | | It isn't used and shouldn't be. CTDB can't make the system unusable. Update associated test to ensure that EMERG isn't attempted. Actually test all remaining debug levels and modernise the test a bit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove log ringbufferMartin Schwenke2014-10-061-1/+1
| | | | | | | | | | | As far as we know, nobody uses this and it just complicates the logging subsystem. Remove all ringbuffer code and documentation. Update the local daemons startup code correspondingly. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tests: Clean up some tests where IP movement is checkedMartin Schwenke2014-09-237-338/+72
| | | | | | | | 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>
* ctdb-tests: Remove dependency on log ringbuffer from missing IP testMartin Schwenke2014-09-231-28/+14
| | | | | | | | | | | | The log ringbuffer will probably be removed. The test can be implemented just as reliably by checking IP assignments using "ctdb ip". Update wait_until_ips_are_on_node() to print a more useful log message. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Factor out new function get_test_ip_mask_and_iface()Martin Schwenke2014-09-231-13/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Simplify and rename wait_until_ips_are_on_nodeglob()Martin Schwenke2014-09-237-9/+9
| | | | | | | | | The glob functionality is unsed so simplify the code by removing it. Rename this function to wait_until_ips_are_on_node(). Update all calls. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Do not expect real-time priority when running local daemonsAmitay Isaacs2014-09-121-1/+1
| | | | | | | Local daemons are started mainly for testing and usually not as root. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Do not run ip command if running against local daemonsAmitay Isaacs2014-07-081-3/+6
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jul 8 12:48:06 CEST 2014 on sn-devel-104
* ctdb-tests: Add a test for ctdb restoredbAmitay Isaacs2014-07-071-0/+118
| | | | | | | | 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): Mon Jul 7 16:06:39 CEST 2014 on sn-devel-104
* ctdb-tests: Check that ctdb wipedb cleans the databaseAmitay Isaacs2014-07-071-0/+10
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Fix the tests for waf buildAmitay Isaacs2014-06-201-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Add test for re-attaching detached databaseAmitay Isaacs2014-04-231-0/+33
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Update "ctdb detach" testMartin Schwenke2014-04-231-15/+56
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Add a simple test for "ctdb detach"Amitay Isaacs2014-04-141-0/+85
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Fix and extend read-only records testMartin Schwenke2014-03-281-93/+123
| | | | | | | | | | | | | This test currently counts the number of read-only-enabled databases and expects there to only be 1. It fails when there are existing databases with read-only already enabled. Instead, check just the test database. Clean up the test by adding some functions to check for precisely the read-only flags that should be set on a node after each operation. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Handle interactions with monitor eventsMartin Schwenke2014-02-131-7/+3
| | | | | | | | | | | | | | | In the first case, reconfiguration can longer happen in a monitor event, so this is no longer a problem. Drop it. Running a monitor event by hand no longer cancels the existing monitor event. Instead the hand-run event fails. So do this differently and just wait for a monitor event before continuing. 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 Feb 13 04:05:57 CET 2014 on sn-devel-104
* ctdb-tests: Set CTDB_EVENT_HELPER when running with local daemonsAmitay Isaacs2014-01-161-0/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb/tests/integration: Decentralise the daemon restart codeMartin Schwenke2013-12-051-0/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Update daemons shutdown pseudo-testMartin Schwenke2013-12-052-3/+10
| | | | | | | | Don't scatter the TEST_LOCAL_DAEMONS logic around the code. Limit it to the local daemons file. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/simple: Local daemons version of setup_ctdb() overridesMartin Schwenke2013-12-051-1/+1
| | | | | | | | setup_ctdb() doesn't need to do anything on a cluster. To avoid a conditional, just override it for local daemons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Remove the time logging codeMartin Schwenke2013-12-051-9/+0
| | | | | | | | This hasn't been required for a long time and is probably broken. If it is needed in future then we know where to find it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/simple: Move the local daemons code to its own fileMartin Schwenke2013-12-052-0/+125
| | | | | | | This is just a straight move. The clever stuff will follow. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests:76_ctdb_pdb_recovery: change from using ctdb pstore to ctdb ptrans.Michael Adam2013-11-281-4/+2
| | | | | | | | | | This removes the requirement to create a temporary file and hence makes this test runnable against local daemons and against a real cluster without further changes. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a messageMichael Adam2013-11-281-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests:76_ctdb_pdb_recovery: fix a typo in a messageMichael Adam2013-11-281-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests/simple: Nobody looks at /tmp/recloop.out so use /dev/null insteadMartin Schwenke2013-11-271-1/+1
| | | | | | | | | | | Otherwise this should use mktemp, something should look at the output and the file should be removed. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Nov 27 20:39:00 CET 2013 on sn-devel-104
* ctdb-tests/integration: Neaten up some of the persistent database testsMartin Schwenke2013-11-273-150/+135
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/simple: User sleep_for() instead of sleepMartin Schwenke2013-11-271-2/+2
| | | | | | | Progress... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/simple: Update persistent DB testsMartin Schwenke2013-11-273-13/+13
| | | | | | | | | | | * Low level DB checks should ignore the sequence number record. * A restart is needed after messing with the RecoverPDBBySeqNum tunable. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: New ptrans commandMartin Schwenke2013-11-271-0/+127
| | | | | | | | Also add test. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: CTDB tool should always be invoked as $CTDB instad of ctdbAmitay Isaacs2013-11-277-92/+92
| | | | | | | | $CTDB_TEST_WRAPPER is required only to run test functions or test binaries on remote nodes. For running ctdb command, $CTDB is sufficient. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: No need to run onnode in parallel for single nodeAmitay Isaacs2013-11-273-6/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Remove -q option to try_command_on_nodeAmitay Isaacs2013-11-2712-99/+99
| | | | | | | This option is always passed to onnode by default. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Fix calling of ctdb tool from testAmitay Isaacs2013-11-071-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9381c33dfd40192b7532d942059c2959dfae059d)
* tests: No need to set sequence number when modifying persistent databaseAmitay Isaacs2013-10-041-10/+2
| | | | | | | | | With the new persistent transaction code, sequence numbers will be automatically updated whenever a record is updated. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 961dd5d0acbb971756944ea9f69992020ea7d9fc)
* tests: Add a simple test to test cluster wide database traverseAmitay Isaacs2013-09-261-0/+73
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 713c9ecc791e3319a2d109838471833de5a158c8)
* tests/simple: Fix the reloadips test to cope with changes to reloadipsMartin Schwenke2013-09-191-3/+3
| | | | | | | | Specifying nodes to reload no longer uses -n. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d921b2756d5f1c4ad7a35fe120f6fda9f5bf5686)
* tests/simple: Minimise the chance of a monitor event being cancelledMartin Schwenke2013-08-221-0/+4
| | | | | | | | | | | | | | A monitor event following a "ctdb delip" might reconfigure services. If the monitor event is cancelled then a service might be stopped but not yet restarted and this could result in the subsequent monitor events failing. This obviously needs to be fixed in CTDB itself. This will happen by making "ctdb reloadips" the supported way of reconfiguring IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 618ea3660e36e7bd92b686e1ca8728cf63c3c068)
* tests/simple: Unreachable node test should wait for recovery to completeMartin Schwenke2013-08-141-0/+2
| | | | | | | | | This should minimise the chances of a control timing out. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 63be516673c5d9c0d543617bf1bb8bca919956a8)
* tests/simple: Fix the missing IP testMartin Schwenke2013-08-141-6/+8
| | | | | | | | | | | | | | | Update the missing IP test to wait until restarts are complete. Otherwise a service restart can collide with the following monitor event and cause chaos. Also, do not disable 10.interface until it matters. Disabling it too early can cause even more chaos if something goes wrong with the monitor step. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 4e3bd06916bd3adac213fb18c7c2a24854b02d45)
* tests/simple: Add -p in onnode test to help show groups of connectionsMartin Schwenke2013-07-221-1/+1
| | | | | | | | | | | Change the command from "true" to "hostname" since the former won't produce any output when used in combination with "onnode -p". This could just be changed to "echo" but the hostname might actually be useful. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ae3c03d80264e997b7da9f3279d7810e18b8a1df)
* tests: add a comment to recovery db corruption testMichael Adam2013-04-171-0/+7
| | | | | | | | | The comment explains that we use "ctdb stop" and "ctdb continue" but we should use "ctdb setcrecmasterrole off". Signed-off-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 06ac62f890299021220214327f1b611c3cf00145)
* tests: Add a test for subsequent recoveries corrupting databasesAmitay Isaacs2013-04-171-0/+126
| | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit b1577a11d548479ff1a05702d106af9465921ad4)