summaryrefslogtreecommitdiff
path: root/ctdb/tests
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Drop code for RECEIVE_RECORDS controlAmitay Isaacs2018-10-091-20/+0
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 83b3c5670d85c607c1cf1ab8cfc2c967d4d16721) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Oct 9 16:04:36 CEST 2018 on sn-devel-144
* ctdb-tests: Add recovery record resurrection test for volatile databasesMartin Schwenke2018-10-091-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> (cherry picked from commit dcc9935995a5a7b40df64653a605d1af89075bd1)
* ctdb-tests: Avoid segfault by initializing loggingAmitay Isaacs2018-07-101-0/+2
| | | | | | | | | | | | | | | This is in addition to af697008531. 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 15:22:16 CEST 2018 on sn-devel-144 (cherry picked from commit a30ac853ff9bca023c53ad98775eabb23156c566) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Jul 10 15:09:25 CEST 2018 on sn-devel-144
* ctdb-tests: Avoid segfault by initializing loggingAmitay Isaacs2018-07-1011-2/+32
| | | | | | | | | | | | | | Setting DEBUGLEVEL before calling debug_init() causes segmentation violation with gcc8. DEBUGLEVEL_CLASS is statically initialized to debug_class_list_initial which is defined as const. Only after debug_init() is called, DEBUGLEVEL_CLASS becomes a talloc'd array. So before modifying DEBUGLEVEL, ensure debug_init() is called via setup_logging(). (debug_init is a static function.) Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit af697008531bd74546656841dd3a1ed92522fc57)
* ctdb-tests: Switch fake_ctdbd to use ctdb_get_peer_pid()Martin Schwenke2018-07-101-8/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 05a908d71c4b7484ba0243fa51bc05c79c8fb357)
* ctdb: Fix build on AIXAmitay Isaacs2018-07-102-5/+5
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 40a8ab1ce0c1b291af7263da13c25c37cee69670)
* ctdb-tests: Add a simple test for database traversesMartin Schwenke2018-07-101-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> (cherry picked from commit ec72fadecd5233234947633360fe46a3a4053c07)
* ctdb-tests: Add check for non-lmaster node status in integration testsMartin Schwenke2018-07-101-0/+1
| | | | | | | | 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> (cherry picked from commit 4b008556d6b1f07fd5057af845526bf941497f18)
* ctdb-tests: Don't use nc -d or -w optionsMartin Schwenke2018-04-066-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. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13327 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 9e954bcbf43d67a18ee55f84cda0b09028f96b92)
* ctdb-tests: Set test timeout to an hourMartin Schwenke2018-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The current 10 minute timeout is causing autobuild failures in some environments. This timeout is simply meant to stop a test run from hanging indefinitely due to a broken test. A 1 hour timeout is better than no timeout. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Feb 8 04:42:56 CET 2018 on sn-devel-144 (cherry picked from commit a3485c41b826e307b31a1113abcea9843ca78540) The last 6 patches address https://bugzilla.samba.org/show_bug.cgi?id=13265 Autobuild-User(v4-8-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-8-test): Mon Feb 12 15:54:28 CET 2018 on sn-devel-144
* ctdb-tests: Fix a typoMartin Schwenke2018-02-121-1/+0
| | | | | | | | | | | | | | | | | This typo causes the script to be run with the default shell. If this is not bash then the shell will fail to parse integration.bash. This is a regression caused by commit c607989d91b64d837253aae794b1a3d6013eb3e0. Clearly nobody has run this test on Debian for a long time. :-( 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 Jan 24 10:28:52 CET 2018 on sn-devel-144 (cherry picked from commit 8b82d10856160d3b3f172bf7d45ac561002dbcac)
* ctdb-tests: Add a UNIT pseudo-test-suiteMartin Schwenke2018-02-121-5/+27
| | | | | | | | This runs all of the unit tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 50150d75814de6a1e2cb28fb7af72caa31d73e3c)
* ctdb-tests: Only use socket-wrapper for simple, local daemon testsMartin Schwenke2018-02-122-9/+10
| | | | | | | | | The run_tests.sh -S option now takes the path to the socker-wrapper shared library. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit e17d02d4039001563d189b33200c30e3906ce845)
* ctdb-tests: Add timeout for individual tests, default is 10 minutesMartin Schwenke2018-02-121-2/+7
| | | | | | | | | | This will cause a hung test to time out and fail rather than letting a test run hang indefinitely. Some tests can take 5 minutes to run, so 10 minutes should be plenty. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit da3aaf972ab5b339b51ba1e802329b69885ccfe4)
* ctdb-tests: Avoid race condition in sock_daemon test 5Amitay Isaacs2018-02-121-9/+17
| | | | | | | | | This test fails when it takes more than 10s to run. This can occur when the system is loaded and socket-wrapper is used. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 33c0f5599d93a34619c8f37945f79a6e399a1b5e)
* ctdb-tests: Make sure child processes are waited on after terminationAmitay Isaacs2017-11-241-2/+11
| | | | | | | | | Looks like the if a process holding fcntl lock (on pid file) is killed, then the lock is not released till the process is reaped using either wait() or waitpid(). Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add async version of shutdown in sock_daemonAmitay Isaacs2017-11-211-0/+40
| | | | | | | | 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): Tue Nov 21 08:58:45 CET 2017 on sn-devel-144
* ctdb-common: Add async version of reconfigure in sock_daemonAmitay Isaacs2017-11-212-0/+119
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Add async version of startup in sock_daemonAmitay Isaacs2017-11-212-0/+47
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Create sock_daemon_funcs per testAmitay Isaacs2017-11-211-30/+40
| | | | | | | This avoids defining sock_daemon functions that are not needed in the test. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Start listening to sockets only on successful startupAmitay Isaacs2017-11-212-30/+131
| | | | | | | | Fix tests to use wait_send() instead of startup() as a synchronization point to ensure that the socket is listening. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Start wait computation only after successful startupAmitay Isaacs2017-11-211-0/+1
| | | | | | | This orders the startup events in sock_daemon code. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-common: Return status from sock_daemon startup()/reconfigure()Amitay Isaacs2017-11-212-12/+56
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Fix some harmless CIDsMartin Schwenke2017-11-081-8/+6
| | | | | | | | | | | | | | | | | | CID 1420632: Resource leaks (RESOURCE LEAK) CID 1420631: Security best practices violations (TOCTOU) CID 1417432: Resource leaks (RESOURCE LEAK) CID 1417429: Security best practices violations (TOCTOU) CID 1417427: Resource leaks (RESOURCE LEAK) These are all in test code and constrained to the test environment, so can't result in privilege escape. No backport necessary. However, we might as well get them off the list. 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 Nov 8 11:28:40 CET 2017 on sn-devel-144
* ctdb-tests: Add sock_daemon test for stale socket handlingMartin Schwenke2017-11-072-0/+141
| | | | | | | | 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 7 07:51:02 CET 2017 on sn-devel-144
* ctdb-common: Fix stale socket removalAmitay Isaacs2017-11-072-8/+45
| | | | | | | | | | | Sockets need to be created from sock_daemon_run_send(). This means that stale socket removal can depend on the PID file context being initialised. Also fix associated test. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Have fake daemon log when it parses public IPsMartin Schwenke2017-11-071-1/+11
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Process-exists unit tests should wait until PID is registeredMartin Schwenke2017-10-263-0/+6
| | | | | | | | | | | | Otherwise the client registration can race with the check in the test. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097 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 Oct 26 13:32:24 CEST 2017 on sn-devel-144
* ctdb-tests: Wait for fake_ctdbd to start, fail if it doesn'tMartin Schwenke2017-10-261-1/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Skip starting fake_ctdbd when current node is disconnectedMartin Schwenke2017-10-262-12/+14
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Wait for ctdb_eventd to start, fail if it doesn'tMartin Schwenke2017-10-261-4/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Allow wait_until() to be used in unit testsMartin Schwenke2017-10-262-44/+44
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add tests for event scripts with multiple '.'sAmitay Isaacs2017-10-181-0/+21
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070 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): Wed Oct 18 10:19:48 CEST 2017 on sn-devel-144
* ctdb-tests: Check an unchecked return valueMartin Schwenke2017-10-161-2/+8
| | | | | | | | | | | This can't fail but check it for completeness... just in case Coverity decides to notice it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Oct 16 09:27:17 CEST 2017 on sn-devel-144
* ctdb-test: Fix CID 1419118 (Error handling issues)Martin Schwenke2017-10-161-1/+5
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tests: Strengthen some testsMartin Schwenke2017-10-161-3/+3
| | | | | | | Check for the expected result instead of just any failure. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tests: Add interactive test for tunnelsAmitay Isaacs2017-10-101-0/+199
| | | | | | | | 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): Tue Oct 10 15:50:04 CEST 2017 on sn-devel-144
* ctdb-tests: Add test for tunnelsAmitay Isaacs2017-10-102-0/+524
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add protocol marshalling for CTDB_REQ_TUNNELAmitay Isaacs2017-10-105-0/+110
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add protocol marshalling for tunnel controlsAmitay Isaacs2017-10-103-2/+28
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Replace parse_ip() -> ctdb_sock_addr_from_string()Martin Schwenke2017-10-052-7/+16
| | | | | | | ... and ctdb_sock_addr_set_port() where required. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Send broadcast to connected nodes, not configured nodesAmitay Isaacs2017-10-051-1/+1
| | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=13056 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add tests for client with multiple connectionsAmitay Isaacs2017-09-222-1/+27
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Sep 22 20:58:46 CEST 2017 on sn-devel-144
* ctdb-tests: Add support for multiple ctdb connections in dummy_clientAmitay Isaacs2017-09-221-7/+25
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tests: Check all connections from a process in CHECK_PID_SRVID controlAmitay Isaacs2017-09-221-19/+30
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tests: Add tests for PID with srvidAmitay Isaacs2017-09-212-1/+45
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 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 Sep 21 12:56:30 CEST 2017 on sn-devel-144
* ctdb-tests: Implement control CHECK_PID_SRVID in fake daemonAmitay Isaacs2017-09-211-3/+44
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Reimplement message handlers using srvid abstractionAmitay Isaacs2017-09-211-31/+19
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 This is required for CHECK_PID_SRVID control implementation. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add marshalling for control CHECK_PID_SRVIDAmitay Isaacs2017-09-213-2/+15
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add marshalling for struct ctdb_pid_srvidAmitay Isaacs2017-09-213-0/+19
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>