summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/tool
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Make the fake log timestamp string easy to modifyMartin Schwenke2014-10-066-9/+9
| | | | | | | | | Use a variable to allow easy change of this string in case future logging changes modify the timestamp format or do not support timestamping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tools-ctdb: Make natgwlist and lvsmaster more resilientMartin Schwenke2014-05-292-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes have caused these commands to attempt to get capabilities from all nodes before doing further filtering. This means that capabilities are unnecessarily fetched from nodes that are unlikely to be the master. If such a node does not answer the control then many nodes can fail to calculate the master node. In the case of natgwlist this will cause "monitor" events to fail resulting in unhealthy nodes. Restore the behaviour where capabilities are only fetched for a node that will be the master if it has the desired flags. Although this masks a problem where a connected node is not replying, it can help to avoid an outage in some cases. Add supporting tests and infrastructure. Infrastructure just lets a timeout be faked - just for ctdb_ctrl_getcapabilities_stub() so far. First test checks that this infrastructure works if the first node times out in natgwlist. Second test checks the case worked around by the above fix - that is, no failure when a node with PNN beyond the NATGW master can time out. 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 May 29 05:59:37 CEST 2014 on sn-devel-104
* ctdb-tools-ctdb: Drop disconnected nodes when filtering by capabilityMartin Schwenke2014-04-141-0/+37
| | | | | | | | | | | | | | | | | | | | | Commit ba69742ccd822562ca2135d2466e09bf1216644b missed the point of filtering disconnected nodes while limiting the nodemap to those in the NAT gateway group. It was really to avoid trying to fetch capabilities from disconnected nodes. This should be explicitly done in filter_nodemap_by_capabilities(), otherwise "ctdb natgwlist" simply fails when there is a disconnected node. Note that the alternate solution where filter_nodemap_by_flags() is called before filter_nodemap_by_capabilities() would not be not correct. Filtering on flags first can produce a "healthier" set of nodes where none of them have the NAT gateway capability. Also extend stub for ctdb_ctrl_getcapabilities() to fail when trying to get capabilities from a disconnected node and add a corresponding test to confirm that "ctdb natgwlist" is no longer broken. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub testsMartin Schwenke2014-03-236-0/+115
| | | | | | | | | | | | | | | Tests for xpnn need to implement a stub for ctdb_sys_have_ip(). The cheapest way of doing this is to read a fake nodemap using the existing code and check if the IP of the "current" node is the one being asked about. However, the fake state initialisation isn't currently available to without_daemon commands because it is meant to represent daemon state. However, it can be made available by moving the relevant code into a new stub for tevent_context_init(). The stub still needs to initialise a tevent context - this can be done by calling a lower level function. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: New natgwlist tests where nodes capability not setMartin Schwenke2014-03-232-0/+74
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Update ctdb stub LVS tests and add some new onesMartin Schwenke2014-03-2310-5/+194
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Support fake capabilities in CTDB tool stubMartin Schwenke2014-03-231-0/+57
| | | | | | | ... and add a test to make sure it works. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove old, unused copy of a CTDB tool unit testMartin Schwenke2014-03-231-34/+0
| | | | | | | | This looks to have got left behind a long time ago when things got moved around... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests: Rework unit test result filteringMartin Schwenke2013-11-271-6/+0
| | | | | | | Using a variable is too fragile, so use a function instead. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* tests/tool: Remove references in libctdb in file and function namesMartin Schwenke2013-10-042-8/+6
| | | | | | | | | | | | | | | | | Main changes are: libctdb_test.c -> ctdb_test_stubs.c ctdb_tool_libctdb.c -> ctdb_functest.c ctdb_tool_stubby.c is gone, replaced with existing ctdb_test.c. Functions starting with "libctdb_test_" now start with "ctdb_test_stubs_". Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 6182bd0c19f215a997efe5272e633b1b1bd0c882)
* tests/tool: Fix some comment typosMartin Schwenke2013-10-042-2/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 59bd4ede15a5958b87e0d253461eb9111885bd2f)
* 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/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: Update README files and add new README files where missingMartin Schwenke2012-04-271-0/+19
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bef03b32f8ec114a64c55b25951aeeb939d87b33)
* tests: Programs run by tests should be found in $PATHMartin Schwenke2012-04-271-4/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b5308142d03332d6d4e0c3b77283c772462fbb23)
* Merge remote branch 'martins/master'Ronnie Sahlberg2012-04-1813-123/+81
|\ | | | | | | (This used to be ctdb commit abe7ebe6c531f912efe4ebc1daade4d2af67574c)
| * tests: More unit test factoring/rationalisation and bug fixesMartin Schwenke2012-04-181-35/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move some options from eventscripts/run_tests.sh to scripts/run_tests. Remove the former. Move some functions from eventscripts/scripts/local.sh to scripts/unit.sh. Both of these are modified during move so they are no longer eventscript-specific. Tweak */local.sh so that the new functions in unit.sh are used. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7ff485687891732074c9fc9998502ca197663d02)
| * tests/tool - Restructure according to new conventionMartin Schwenke2012-04-1612-57/+13
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 89571585d87b391ff79647cd1f0f6ac193079e72)
| * tests/tool: New nodestatus testAmitay Isaacs2012-04-161-0/+34
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ca9e75eaea9c9b02bb44ca338e28fdae0c8d582c)
| * tests/tool: Fix the nodestatus testAmitay Isaacs2012-04-161-1/+4
| | | | | | | | | | | | | | | | | | Although not obvious, when asking each node for nodestatus, it will report each node is the current node. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a65ba7211ec7f102b32060b173606a61fb5c20a9)
* | tests/tool: New nodestatus testAmitay Isaacs2012-04-131-0/+34
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 902d8a4709e7a269d2a75522a998f9a60ae13d78)
* | tests/tool: Fix the nodestatus testAmitay Isaacs2012-04-131-1/+4
|/ | | | | | | | | Although not obvious, when asking each node for nodestatus, it will report each node is the current node. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 261258c1a4268230b2559bc5d8664b1197b22450)
* Tests - ctdb tool - add verbose option and output filteringMartin Schwenke2012-02-062-2/+14
| | | | | | | | Need to filter dates before comparing... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6127515ea62173ff1574d1217129ec05a8fbeb3f)
* Tests - ctdb tool - fix "ctdb status" testMartin Schwenke2012-02-061-6/+6
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 47e86c33d768816d03817124481bb6aa967bf2a6)
* Tests: initial ctdb tool testcasesMartin Schwenke2012-02-0611-0/+341
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 47e9975fa75a7bb2628a751dc19d35e2c5c57ce3)