summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/stubs
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodesMartin Schwenke2014-04-141-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 4ee4925d416a86341bd76c11fa99ec9173682a1d forgot about CTDB_NATGW_SLAVE_ONLY so it introduces an incorrect failure when this is set, and CTDB_NATGW_PUBLIC_IFACE or CTDB_NATGW_PUBLIC_IP is unset. Relax the sanity check to see if CTDB_NATGW_SLAVE_ONLY is set. Update the documentation to explicitly state that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IP are optional and unused if CTDB_NATGW_SLAVE_ONLY is set. It would be possible to insist that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IFACE should be unset in that case. However, it is more reasonable to allow consistent configuration across nodes except with some nodes configured slave-only. Add tests, update infrastructure and fix a thinko in the stub's "natgwlist" implementation. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Apr 14 06:06:49 CEST 2014 on sn-devel-104
* ctdb-tests: Add some tests for 11.natgw eventscriptMartin Schwenke2014-03-262-18/+148
| | | | | | | | | | | | | | This includes adding support for: * Configuring fake NATGW state in the eventscript unit tests * "natgwlist" and "setnatgwstate" in ctdb command stub * ip command stub to default to "main table" when no table specified, allow routes to be added without "dev" option (just add a default dev), support "metric" option Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests-eventscripts: Testing support for promote_secondariesMartin Schwenke2014-02-131-2/+9
| | | | | | | | | Just enable this behaviour by default in the ip command stub, since 10.interface assumes/sets it. The rc.local replacement for set_proc() doesn't do anything... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb/tests/eventscripts: Improve ip command stub secondary handlingMartin Schwenke2014-01-311-22/+59
| | | | | | | | It should support primary and secondaries per network instead of per interface. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests: in the stub "ip link show" command use echo instead of catMichael Adam2013-11-281-4/+2
| | | | | | | | | | | | This case of "ip link show" does not break autobuild with "Broken pipe" messages, but let's be consistent. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Nov 28 09:23:03 CET 2013 on sn-devel-104
* ctdb:tests: in the stub ip command, avoid broken pipe by using echo instead ↵Michael Adam2013-11-281-9/+3
| | | | | | | | | | | | of cat This fixes running "make autotest" from autobuild, since it prevents irritating error output in delete_ip_from_iface() when calling ip addr list ... | grep -Fq "inet ..." . Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* eventscripts: Rewrite the smb.conf cache file handlingMartin Schwenke2013-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The background update is never guaranteed to complete before the cache is used, so don't bother trying it at the beginning. Instead, put a timeout on a foreground update. If the foreground update fails: * If there's no available cache file then die. * If there is a previous cache file then use it and log a warning. * Do a background update at the end of the monitor event. Also remove commas in the "smb ports" list before use, since (newer?) testparm seem to insert commas into the default value. Update the associated test to add a comma. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8c6f511254ecb0381a609b37e3a0ee6e5ec5d562)
* tests/eventscripts: New tests for 20.multipathdMartin Schwenke2013-10-221-0/+36
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 212d4b201c30804f69cffe4b7150d4b74bf2e54f)
* tests/eventscripts: Tests for memory checking in 00.ctdbMartin Schwenke2013-09-113-2/+31
| | | | | | | | ... plus updates to test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4a388fc6bf54636b7e1f6da8e6aa451cddd574f7)
* eventscripts: kill_tcp_connections() should send connections to stdinMartin Schwenke2013-07-292-0/+11
| | | | | | | | | | | | | | | This avoids issuing multiple "ctdb killtcp" commands to terminate tcp connections, one per connection. This will considerably reduce the time when there is a large number of tcp connections. This also makes it possible to avoid calling "ctdb killtcp" when there are no connections. Add a couple of unit tests for killtcp and update eventscript unit test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a20d94717d2e4ab866d8a002cdf39c0669b74c6a)
* tests/eventscripts: Add tests for monitoring of missing interfacesMartin Schwenke2013-07-191-54/+72
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 53e4eca74429f76adc81d98e3d11d1bd61194d71)
* tests/eventscripts: New tests for 00.ctdb "init" eventMartin Schwenke2013-06-204-6/+50
| | | | | | | | | | | | | | | These test dropping of IPs and TDB checking. New stubs for date, tdbdump, tdbtool. Enhance ip stub to handle "ip addr show to ..." Tweak some infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900)
* tests/eventscripts: Unit tests for $CTDB_NFS_DUMP_STUCK_THREADSMartin Schwenke2013-06-141-0/+10
| | | | | | | | Includes minor test infrastructure updates. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit cd4358b01c6c3d413b431f5760029d2b163b9c03)
* scripts: Use $CTDB_SCRIPT_DEBUGLEVEL instead of something more complexMartin Schwenke2013-04-191-18/+0
| | | | | | | | | | | | | | | | | | | 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/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)
* 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/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/eventscripts: $FAKE_IP_STATE is always set in ip command stubMartin Schwenke2012-04-271-2/+0
| | | | | | | | No need for a default, especially since there is no sane default! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b430a5f61cfdc28e967890602ce6dac0e922c07d)
* tests: Programs run by tests should be found in $PATHMartin Schwenke2012-04-271-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b5308142d03332d6d4e0c3b77283c772462fbb23)
* tests/eventscripts - Restructure according to new conventionMartin Schwenke2012-04-161-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit eb13507713ba6732271b7c3024bfddbda6da5ffc)
* Tests - eventscripts - stub ctdb command updatesMartin Schwenke2012-03-221-50/+158
| | | | | | | | | | * Proper IP (re)allocation using ctdbd's IP allocation algorithm. * Therefore, "ctdb ip" works sensibly. * Add enable, disable, moveip. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6d4b4b1293ba960d8fdf81958d6e8dd23c9d771a)
* Tests - eventscripts - ip stub command should print errors to stderrMartin Schwenke2012-03-221-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 236d572556e447e2d82d14d2c8a40ed8cb98944d)
* Eventscript tests - implement ip route in stubMartin Schwenke2012-03-221-3/+107
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ac2cd2a8cbed97348ceae54167ad83cb074ff6b3)
* Eventscript tests - implement ip rule in stubMartin Schwenke2012-03-221-0/+122
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 26292f362890ca6cb65d0028d50fa97458e0449f)
* Eventscript tests - make ip command stub vaguely maintainableMartin Schwenke2012-03-221-174/+198
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8b8e17bea87a8c16f7c0f54fcfe29190f203f673)
* Tests - eventscripts - allow "ctdb scriptstatus" output to be primedMartin Schwenke2011-08-311-8/+15
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f527ffb55b514b5cb4df3471a0e17ab71307e8a1)
* Tests - eventscripts - ctdb stub - implement scriptstatus, tweaksMartin Schwenke2011-08-301-9/+28
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit edc34d01a1ad83b1335c976593a006166b196569)
* Tests - eventscripts - nmap and netstat stubs can pretend they weren't foundMartin Schwenke2011-08-302-0/+14
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 47f2843b4db767bcc724d8f972e0c2a850d5826f)
* Tests - eventscripts - ctdb default default level is 0.Martin Schwenke2011-08-301-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fcf40500c2158dfbe2390fad7bf0614cc575df14)
* Tests - eventscripts - add output for "not implemented" in ctdb stubMartin Schwenke2011-08-301-0/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 1d02e3c6a7fb5ad5edb21298deba415ba9519f3d)
* Tests - eventscripts - add an nmap stubMartin Schwenke2011-08-301-0/+68
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6ff9545a0fd58f0728b769c7b36d3b6ab7366321)
* Tests - eventscripts - stop timeouts waiting for backgrounded testparmMartin Schwenke2011-08-301-1/+3
| | | | | | | | | | | Not sleeping at all speeds up the tests. However, it can also cause timeouts. Therefore, every time sleep is run we force the stub to do a short 0.1s sleep instead of whatever is specified. This should be enough to avoid races. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 59a1d54bcc15058f7b69e8596b32b26427a3ae57)
* Tests - add getdebug and checktcpport to ctdb eventscripts stubMartin Schwenke2011-08-301-1/+28
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9c6fd7d21c99e605e20620c5c6b4e695c02af771)
* Tests - add hooks to simulate ctdb commands that aren't implementedMartin Schwenke2011-08-301-4/+11
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e9bdfd43af3ed28a7f69a36e3fb037f252a23869)
* Tests - add eventscripts testing stub for sleep command.Martin Schwenke2011-08-301-0/+7
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit aedff41ee1df0a1a573476844993fa8eda2f34bf)
* Tests - Change variable used to fake listening TCP ports.Martin Schwenke2011-08-301-2/+2
| | | | | | | | Change from $FAKE_NETSTAT_TCP_LISTEN to $FAKE_TCP_LISTEN. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f19ba38e382034fba769145d0bfc81b2c2941563)
* Tests - eventscripts exportfs stub should splits linesMartin Schwenke2011-08-301-1/+7
| | | | | | | | | The real exportfs splits lines longer than 15 characters. The stub should do that too... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fb3e123b097d9e36d281c3ab4f3e9a4799fa27bc)
* Tests - exportfs stub needs to print out export options.Martin Schwenke2011-08-151-1/+1
| | | | | | | | This is needed due to bd39b91ad12fd05271a7fced0e6f9d8c4eba92e6. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 92f8e31f6995836b1668639a4dac2862efee269a)
* Tests - implement "ctdb -Y ip -v" in stub for eventscript testing.Martin Schwenke2011-08-081-4/+28
| | | | | | | | This is pretty limited but it gets 10.interfaces tests working. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7130963430e530fa4dd5e6fe132bd7122349cc5f)
* Tests - stub ip program should assume interface name if "dev" not specified.Martin Schwenke2011-08-081-1/+2
| | | | | | | | | | Currently it fails if you don't use the "dev" keyword. This makes it behave as expected. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4fa2073649f25993de4b8ef6b3e7172068a83a29)
* Tests: eventscripts and onnode tests use stubs/ subdirectory instead of bin/.Martin Schwenke2011-08-0818-0/+705
This sets up a more useful convention and avoids future .gitignore problems. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 58c696dc600f1073e693930da061776b6fb199f2)