summaryrefslogtreecommitdiffstats
path: root/ctdb/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* eventscripts: 60.nfs uses nfs_check_rpc_services() to check NFS RPC servicesMartin Schwenke2013-05-076-90/+17
| | | | | | | | | | | | | | | | | | | * New directory nfs-rpc-checks.d/ replaces hardcoded rules in 60.nfs * Installation and packaging additions to handle nfs-rpc-checks.d/ * Unit test updates, including deleting 1 test that sanity checked test infrastructure * Test infrastructure changes to use nfs-rpc-checks.d/ Note that this removes support for $CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK in 60.nfs. To get the equivalent behaviour, edit 20.nfsd.check and remove/comment all lines. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7e792d6768d9ca420ce3713cb122e63afd594b15)
* eventscripts: Clean up ctdb_check_command()Martin Schwenke2013-05-061-1/+1
| | | | | | | | | | * Command is now multiple arguments, preserving quoting * $service_name no longer printed, no longer an argument * Debug output from failed command Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9e25fb261447a196de05937052779b36e75e7215)
* eventscripts: Simplify handling of $service name in "managed" functionsMartin Schwenke2013-05-065-15/+25
| | | | | | | | | | | | | | | | | | | | Complicated argument handling was introduced to deal with multiple services per eventscript. This was a failure and we split 50.samba. This simplifies several functions to use global $service_name unconditionally instead of having an optional argument. $service_name is no automatically longer set in the functions file. This means it needs to be explicitly set in 13.per_ip_routing because this script uses ctdb_service_check_reconfigure(). Eventscript unit test infrastructure needs to set $service_name during fake service setup, and policy routing tests need to be updated accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 27aab8783898a50da8c4bc887b512d8f0c0d842c)
* scripts: Use $CTDB_SCRIPT_DEBUGLEVEL instead of something more complexMartin Schwenke2013-04-194-24/+3
| | | | | | | | | | | | | | | | | | | The current logic is horrible and creates an unnecessary file. Let's make the script debug level independent of ctddb's debug level. * Have debug() use $CTDB_SCRIPT_DEBUGLEVEL directly * Remove ctdb_set_current_debuglevel() * Remove the "getdebug" command from ctdb stub in eventscript unit tests * Update relevant eventscript unit tests to use $CTDB_SCRIPT_DEBUGLEVEL Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 85efa446c7f5c5af1c3a960001aa777775ae562f)
* 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)
* tests: Support waiting for "recovered" state in testsAmitay Isaacs2013-04-171-1/+4
| | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 2438f3a4944f7adbcae4cc1b9d5452714244afe7)
* tests: Fix typo in variable nameAmitay Isaacs2013-04-151-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 043e18a8324ccb2c8ddd7b323ebedb5b0de1298d)
* tests: Test portabilityMathieu Parent2013-01-221-0/+305
| | | | | | | | Curiously test_ctdb_sys_check_iface_exists fails on Linux Signed-off-by: Mathieu Parent <math.parent@gmail.com> (This used to be ctdb commit 109f428aa34f8f4cc0329880d2f4a5593a6cc6f3)
* tests: Add a test for recovery of persistent databasesAmitay Isaacs2013-01-091-0/+119
| | | | | | | | | | Ensure that RSN based recovery and __db_sequence_number__ based recovery methods for persistent databases work correctly. They should not cause corruption of the database. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 45d439a1ab093b420c27b1502ef109021833c7af)
* tests/simple: Add test to check recovery daemon IP verificationMartin Schwenke2013-01-082-6/+121
| | | | | | | | Also update ips_are_on_nodeglob() to handle negation. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 13a5944f8a27d43006acfffba76958693cae7702)
* tests/eventscripts: Ratchet down debug level for ctdb_takeover_testsMartin Schwenke2013-01-081-1/+2
| | | | | | | | | | | | | | The default IP allocation algorithm used by ctdb_takeover_tests changed from "non-deterministic IPs" to "LCP2". The latter generates a lot more debug output. ctdb_takeover_tests is used by the ctdb tool stub to calculate IP address changes for failovers. This resulted in unexpected debug output that caused tests to fail. Since eventscript tests don't care how IP allocations are arrived at, the best solution is to turn down the debug level. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3cc596d2b459d834f9785b3a98027e46431ff2b9)
* recoverd: Move failback retry loop into basic_failback() and lcp2_failback()Martin Schwenke2013-01-081-6/+3
| | | | | | | | | | | | | The retry loop is currently in ctdb_takeover_run_core(). Pushing it into each function will make it possible to put each algorithm into a separate top-level function. This will make the code much clearer and more maintainable. Also keep associated test code compatible. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f6ce18d011dd9043b04256690d826deb2640cd89)
* recoverd: Trying to failback more IPs no longer allocates unassigned IPsMartin Schwenke2013-01-081-18/+0
| | | | | | | | | | | | Neither basic_failback() nor lcp2_failback() unassign IPs anymore, so there's no point looping back that far. Also fix a unit test that now fails because looping back to handle unassigned IPs is no longer logged. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c09aeaecad7d3232b1c07bab826b96818756f5e0)
* tests/takeover: Add some LCP2 tests for case when no node are healthyMartin Schwenke2013-01-086-0/+189
| | | | | | | | | | 3 tests should assign IPs to all nodes. 3 tests set NoIPTakeoverOnDisabled=1 and should drop all IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit edda58a45915494027785608126b5da7c98fee85)
* tests/takeover: Initial tests for deterministic IPsMartin Schwenke2013-01-083-0/+90
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5c820b2398a42af0e94bc524854a1ad144a63f7b)
* tests/takeover: Do output filtering for deterministic IPs algorithm tooMartin Schwenke2013-01-081-1/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 98bd58a98d34ecca89c9042417d7527a18a5ecf9)
* tests/takeover: Support testing of NoIPTakeoverOnDisabledMartin Schwenke2013-01-081-0/+5
| | | | | | | | Via $CTDB_SET_NoIPTakeoverOnDisabled. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d357d52dbd533444a4af6151d04ba119a1533068)
* tests/takeover: IP allocation now selected via $CTDB_IP_ALGORITHMMartin Schwenke2013-01-082-16/+18
| | | | | | | | | Default to LCP2, like ctdbd. Also support "det" for deterministic IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 20631f5f29859920844dd8f410e24917aabd3dfd)
* tests/takeover: Support valgrinding the takeover codeMartin Schwenke2013-01-081-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 06ad6b8a19f830472b0ed65cb52e7c3ea74ed1dc)
* tests: new simple integration test for delip interface garbage collectionMartin Schwenke2013-01-071-0/+62
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 1a5410e8349cdb96fdc51aa5ecd4f5734f6798a5)
* tests: new function ip2ipmask() for integration testingMartin Schwenke2013-01-071-0/+7
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8164d9b29bf9080ccc76b1305fb6c07f1ed61d55)
* tests/complex: Add NFS test when CTDB is killed on one of the nodesAmitay Isaacs2013-01-071-0/+88
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit b849fb4923d6a34141fe19006a974de81508ceda)
* Eventscripts: Do not restart NFS on reconfigureMartin Schwenke2013-01-076-12/+0
| | | | | | | | | | | | | | | | | | | | It looks like this restart was accidentally reintroduced in commit fc0678d351187cfa4c71123f97c0f493aacd5d16 when $service_reconfigure became unset so the default action of restarting the service would occur. From there cleanups have explicitly reintroduced it and carried it through the code. Also update the unit tests affected by this change. The restart was originally removed in commit bc481c3f1a44c50648488c4f8a7f15ec395d446f. The default reconfigure action of restarting a service is clearly suboptimal and will be addressed in a separate patch. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 2629de72e1f37b5e46772c2ef8d8d0012fc4ed37)
* tests: Local daemons should use --listen instead of --node-ipMartin Schwenke2013-01-071-1/+1
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 3221fce9ee2f6fdd3bb17a5e1629ad52a32f90d6)
* tests: Do not check release suffix in ctdb version testAmitay Isaacs2012-10-311-1/+2
| | | | | | | | | release suffix added by RPM is to track packaging changes. Core CTDB version does not include the release suffix. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit aad1584da8a8425bc6f5163c95810e9d2390dc91)
* tests: Local daemons should use the logging ringbufferMartin Schwenke2012-10-221-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7547e011005f0dd5bd38e67572280126cf16e229)
* ctdbd: Replace lockwait with locking API and remove ctdb_lockwait.cAmitay Isaacs2012-10-201-1/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 2126795153dacb255e441abcb36ee05107b6282a)
* ctdbd_test: Include ctdb_lock.c code for test stubsAmitay Isaacs2012-10-201-0/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit caff197edf6f928494028ac6c993901954aaa36f)
* tests: Fix statistics test for new output lines from locking APIAmitay Isaacs2012-10-201-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1ee55c511b99e9f8a6fa4e34207267e953f09bae)
* Revert "Eventscripts - add facility to 10.interface to delete unmanaged IPs"Martin Schwenke2012-10-181-22/+0
| | | | | | | | | | This reverts commit 88f88d86b0d08240f749fb721b8c401c2eeb1099. This is dangerous and, on reflection, I can't see it being useful. There are often permanent IPs on interfaces that CTDB shares with its public IPs. (This used to be ctdb commit 16aba4eb620844626a1c71c58b51658caf44dea6)
* tests/eventscripts: add unit tests for policy routing reconfigureMartin Schwenke2012-10-114-0/+77
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bd4ff176387372b1c233373c0bc8ced523fc9670)
* tests/eventscripts: add extra infrastructure for policy routing testsMartin Schwenke2012-10-1116-317/+170
| | | | | | | | Less copying and pasting is a good thing... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7d4b8cce96f33fff647a0c9d259c121dfc8403e9)
* eventscripts: Auto-start/stop services in backgroundMartin Schwenke2012-10-036-23/+39
| | | | | | | | | | | If $CTDB_SERVICE_AUTOSTARTSTOP="yes" then service start/stop is done in the background with logging. Fix some unit tests for samba and winbind. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3a3dae4cb5ec8b4b8381a4013adda25b87641f3a)
* Eventscripts: split 50.samba into 49.winbind and 50.sambaMartin Schwenke2012-10-038-15/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | winbind and samba can be separately managed. This makes the service starting and stopping code way too complicated, and even adds a small amount of complexity to the monitoring code. The sensible option is to split this eventscript in two. There are two potentially backward incompatible changes here: * Functionality has been removed that allowed 50.samba to manage winbind when CTDB_MANAGES_WINBIND was unset but the smb.conf "security" parameter was set to "ADS" or "DOMAIN". Maintaining this functionality would have required moving the testparm-related code to the functions file, deciding where the cache file should go, and then calling it from both 49.winbind and 50.samba. This feature wasn't of great value and asking administrators to set an extra variable in exchange for code simplicity seems like a reasonable deal. * External code will need to be changed if it calls 50.samba directly with winbind-related expectations. This is fairly obvious! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 34535ae64420926b9a3bf7d453fed4e6f4c90115)
* tests/tool: New tests for natgwlist, getcapabilities, lvs, lvsmasterMartin Schwenke2012-09-2811-0/+353
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6bd4feff7039138d435428eeded51975c44e567c)
* tests/tool: New function setup_natgw() to setup $CTDB_NATGW_NODESMartin Schwenke2012-09-281-0/+20
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0f0aef21a1bb2d88a8c184ef70c718e0c91acdc3)
* tests: libctdb stubs initial ctdb_getcapabilities() implementationMartin Schwenke2012-09-281-0/+7
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 81af67c6959fdbe0566e3f1a00e2be58dd268dc6)
* tests: libctdb stubs must copy pointers rather than just returning themMartin Schwenke2012-09-281-6/+25
| | | | | | | | | Some code (e.g. NAT gateway code) modifies the returned result so was modifying the original. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a3f15d2828325bbfba5bc5c0a30429e2ce572a44)
* tests/eventscripts: New policy routing test with invalid table IDMartin Schwenke2012-09-111-0/+41
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 93c97c3ba3ff714dfa0d056a91ff45010a6e2d66)
* tests/eventscripts: Modify ip stub to simulate invalid table IDMartin Schwenke2012-09-111-15/+36
| | | | | | | | | | This involves refactoring ip_route_check_table() into a new function ip_check_table() which tables the operation type (i.e. rule/route) as an argument. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit acdaa04079a9827885f32a7bc078d3365c89b474)
* tests/eventscript: unit test for 13.per_ip_routing bogus route removalMartin Schwenke2012-09-111-0/+47
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6d41208074f0e9b56c585bca7eb39aaed653c4ca)
* tests/eventscripts: Add a policy routing unit test for "ip rule del" failureMartin Schwenke2012-09-111-0/+38
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0ce5b079f327aba55b62800ccb22d79976fac665)
* tests/eventscripts: Extra cases for policy routing missing config testMartin Schwenke2012-07-301-2/+5
| | | | | | | | Test the startup and monitor events too. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c29a943f9bbcfecb861e71d007c7698a53dc8773)
* tests/tool: Run ctdb_tool_* under $VALGRINDMartin Schwenke2012-07-261-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6616a5712b5d4db2b9ba6a88cec79378696c2184)
* tests/eventscripts: Rewrite the testparm stubMartin Schwenke2012-07-261-8/+23
| | | | | | | | | | It currently needs the real testparm command installed even though it only uses limited features. It is easy enough to fake up the functionality that 50.samba uses. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7ef9916bd95ff2472359a412eac5489f1aad2dce)
* tests/complex: Fix broken ctdb_test_check_real_cluster()Martin Schwenke2012-07-261-0/+3
| | | | | | | | It doesn't set $h at all... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3f268805c14c51f23024267916eae161bada8a0e)
* tests/simple: ctdb stop/continue tests weren't actually checking IPsMartin Schwenke2012-07-262-2/+2
| | | | | | | | The correct variable is $test_node_ips, not $ips. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8d17dacee415dd0b4268805a366a86f83e33f27c)
* tests: select_test_node_and_ips() should try to avoid failingMartin Schwenke2012-07-261-1/+19
| | | | | | | | | | | | Sometimes "ctdb sync" doesn't do its job, so we end up with unassigned IPs. If $test_node isn't set then this is bad. However, try a few times to ensure it is set. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 2fd0157382b42aa5c5212b8e743c6f589edc6662)
* tests: simple tests against local daemons should check $TEST_LOCAL_DEAMONSMartin Schwenke2012-07-263-4/+4
| | | | | | | | Note the old $CTDB_TEST_REAL_CLUSTER - it doesn't exist anymore... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 47180dc75d15f3d61470705603565b718491c9f8)